wip
This commit is contained in:
@@ -1,10 +1,3 @@
|
||||
use gpui_kit::assets::IconName;
|
||||
use gpui_kit::component::avatar::Avatar;
|
||||
use gpui_kit::component::button::{Button, ButtonVariants};
|
||||
use gpui_kit::component::dock::DockPlacement;
|
||||
use gpui_kit::component::input::{Input, InputState, Textarea, TextareaState};
|
||||
use gpui_kit::component::notification::Notification;
|
||||
use gpui_kit::component::{ActiveTheme, Disableable, Sizable, WindowExt, h_flex, v_flex};
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::Error;
|
||||
@@ -12,14 +5,20 @@ use chat::{ChatRegistry, Room, RoomKind};
|
||||
use gpui::prelude::FluentBuilder;
|
||||
use gpui::{
|
||||
App, AppContext, ClipboardItem, Context, Div, Entity, IntoElement, ParentElement,
|
||||
PathPromptOptions, Render, SharedString, Styled, Task, Window, div, px, retain_all,
|
||||
PathPromptOptions, Render, SharedString, Styled, Task, Window, div, retain_all,
|
||||
};
|
||||
use gpui_kit::assets::IconName;
|
||||
use gpui_kit::component::button::{Button, ButtonVariants};
|
||||
use gpui_kit::component::dock::DockPlacement;
|
||||
use gpui_kit::component::input::{Input, InputState, Textarea, TextareaState};
|
||||
use gpui_kit::component::notification::Notification;
|
||||
use gpui_kit::component::{ActiveTheme, Disableable, Sizable, WindowExt, h_flex, v_flex};
|
||||
use instant::Duration;
|
||||
use nostr_sdk::prelude::*;
|
||||
use person::{Directory, Person, PersonRegistry, shorten_pubkey};
|
||||
use settings::AppSettings;
|
||||
use state::{NostrRegistry, upload};
|
||||
use ui::{TextStyle, Typeset as _, button_radius};
|
||||
use ui::Avatar;
|
||||
|
||||
use crate::Workspace;
|
||||
|
||||
@@ -374,10 +373,7 @@ impl Render for ProfileDialog {
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.bg(cx.theme().sidebar)
|
||||
.child(match avatar {
|
||||
Some(picture) => Avatar::new().src(picture).large().into_any_element(),
|
||||
None => Avatar::new().large().into_any_element(),
|
||||
})
|
||||
.child(Avatar::new(avatar).seed(profile.avatar_seed()).large())
|
||||
.when(self.editing, |this| {
|
||||
this.child(
|
||||
Button::new("upload")
|
||||
@@ -400,9 +396,9 @@ impl Render for ProfileDialog {
|
||||
.w_full()
|
||||
.justify_center()
|
||||
.gap_3()
|
||||
.rounded(px(button_radius()))
|
||||
.rounded(cx.theme().radius)
|
||||
.bg(cx.theme().sidebar)
|
||||
.text_style(TextStyle::Callout)
|
||||
.text_xs()
|
||||
.child(shorten_pkey)
|
||||
.child(
|
||||
Button::new("copy")
|
||||
@@ -537,7 +533,7 @@ impl Render for ProfileDialog {
|
||||
|
||||
fn label(label: &'static str, cx: &App) -> Div {
|
||||
div()
|
||||
.text_style(TextStyle::Caption)
|
||||
.text_xs()
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.font_weight(gpui::FontWeight::SEMIBOLD)
|
||||
.child(label)
|
||||
@@ -554,10 +550,8 @@ fn field(
|
||||
None => (SharedString::from(placeholder), cx.theme().muted_foreground),
|
||||
};
|
||||
|
||||
v_flex().gap_1p5().child(label(text, cx)).child(
|
||||
div()
|
||||
.text_style(TextStyle::Callout)
|
||||
.text_color(color)
|
||||
.child(content),
|
||||
)
|
||||
v_flex()
|
||||
.gap_1p5()
|
||||
.child(label(text, cx))
|
||||
.child(div().text_xs().text_color(color).child(content))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user