replace sign-in banner with simple centered layout
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 421 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 598 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 639 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB |
@@ -5,8 +5,6 @@ use rust_embed::RustEmbed;
|
||||
#[derive(RustEmbed)]
|
||||
#[folder = "assets"]
|
||||
#[include = "icons/**/*.svg"]
|
||||
#[include = "backgrounds/**/*.jpg"]
|
||||
#[include = "backgrounds/**/*.png"]
|
||||
#[exclude = "*.DS_Store"]
|
||||
pub struct Assets;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use gpui::{
|
||||
Context, IntoElement, ObjectFit, ParentElement as _, Render, SharedString, Styled as _,
|
||||
StyledImage as _, Window, div, img,
|
||||
Context, FontWeight, IntoElement, ParentElement as _, Render, Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
@@ -10,15 +7,11 @@ use gpui_native_kit::layout::panel::Panel;
|
||||
|
||||
use crate::identity;
|
||||
|
||||
pub struct SignedOutView {
|
||||
banner: SharedString,
|
||||
}
|
||||
pub struct SignedOutView;
|
||||
|
||||
impl SignedOutView {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
banner: pick_banner(),
|
||||
}
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,30 +21,26 @@ impl Render for SignedOutView {
|
||||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||
v_flex()
|
||||
.size_full()
|
||||
.relative()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.gap_4()
|
||||
.child(
|
||||
div().absolute().inset_0().child(
|
||||
img(self.banner.clone())
|
||||
.size_full()
|
||||
.object_fit(ObjectFit::Cover),
|
||||
),
|
||||
div()
|
||||
.text_2xl()
|
||||
.font_weight(FontWeight::SEMIBOLD)
|
||||
.child("Signed"),
|
||||
)
|
||||
.child(
|
||||
v_flex()
|
||||
.size_full()
|
||||
.justify_end()
|
||||
.p_4()
|
||||
.gap_4()
|
||||
.child(img("backgrounds/headline.png").max_w_48())
|
||||
.child(
|
||||
v_flex()
|
||||
.gap_1()
|
||||
.w_full()
|
||||
.child(Button::new("onboarding").label("Join now").on_click(
|
||||
|_, _, cx| {
|
||||
.w_48()
|
||||
.child(
|
||||
Button::new("onboarding")
|
||||
.label("Join now")
|
||||
.on_click(|_, _, cx| {
|
||||
identity::helpers::open_onboarding(cx);
|
||||
},
|
||||
))
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
Button::new("import")
|
||||
.label("Import identity")
|
||||
@@ -60,17 +49,6 @@ impl Render for SignedOutView {
|
||||
identity::helpers::open_import(cx);
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn pick_banner() -> SharedString {
|
||||
let num = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.map(|duration| duration.subsec_nanos())
|
||||
.unwrap_or(1)
|
||||
% 3
|
||||
+ 1;
|
||||
format!("backgrounds/banner{num}.jpg").into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user