young_account_banner.rs

 1use gpui::{IntoElement, ParentElement};
 2use ui::{Banner, prelude::*};
 3
 4#[derive(IntoElement)]
 5pub struct YoungAccountBanner;
 6
 7impl RenderOnce for YoungAccountBanner {
 8    fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
 9        const YOUNG_ACCOUNT_DISCLAIMER: &str = "To prevent abuse of our service, GitHub accounts created fewer than 30 days ago are not eligible for the Pro trial. You can request an exception by reaching out to billing-support@zed.dev";
10
11        let label = div()
12            .w_full()
13            .text_sm()
14            .text_color(cx.theme().colors().text_muted)
15            .child(YOUNG_ACCOUNT_DISCLAIMER);
16
17        div()
18            .max_w_full()
19            .my_1()
20            .child(Banner::new().severity(Severity::Warning).child(label))
21    }
22}