This commit is contained in:
2026-10-22 15:58:24 +07:00
parent 49f2d9edc1
commit bebb4cebbf
25 changed files with 147 additions and 100 deletions
+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75C6.89137 2.75 2.75 6.89137 2.75 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.25 13L12 16.25L8.75 13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 7.75V15.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 571 B

+14 -1
View File
@@ -1,3 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M10 5.75L3.75 12L10 18.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.5 12H20.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path
d="M10 5.75L3.75 12L10 18.25"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M4.5 12H20.25"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 418 B

+1 -13
View File
@@ -1,13 +1 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"> <path d="M9.25 9.75C7.317 9.75 5.75 8.183 5.75 6.25C5.75 4.317 7.317 2.75 9.25 2.75C11.183 2.75 12.75 4.317 12.75 6.25C12.75 8.183 11.183 9.75 9.25 9.75Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 2.75C16.933 2.75 18.5 4.317 18.5 6.25C18.5 8.183 16.933 9.75 15 9.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M9.24806 12.75C5.46395 12.75 2.27489 15.1517 1.30259 18.2496C0.971822 19.3035 1.89349 20.2187 2.99806 20.2188H15.4981C16.6026 20.2188 17.5243 19.3035 17.1935 18.2496C16.2212 15.1517 13.0322 12.75 9.24806 12.75Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M20.75 20.25H21.25C22.3546 20.25 23.2748 19.3347 22.9405 18.2819C22.2598 16.1389 20.512 14.31 18.25 13.5088" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 1014 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M5.75 9.5L12 15.75L18.25 9.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 209 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M9.5 18.25L15.75 12L9.5 5.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 209 B

+2 -13
View File
@@ -1,14 +1,3 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="10" />
<path d="m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" />
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="9.25" stroke="currentColor" stroke-width="1.5"/><ellipse cx="12" cy="12" rx="3.5" ry="9.25" stroke="currentColor" stroke-width="1.5"/><path d="M3.5 9.25H20.5" stroke="currentColor" stroke-width="1.5"/><path d="M3.5 14.75H20.5" stroke="currentColor" stroke-width="1.5"/>
</svg>

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 377 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M2.75 21.25L21.25 21.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.75 21.25V4.75C4.75 3.64543 5.64543 2.75 6.75 2.75H17.25C18.3546 2.75 19.25 3.64543 19.25 4.75V21.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.75 12.25H8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 522 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="8.75" r="3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="4" cy="9.80005" r="2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="20" cy="9.80005" r="2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.25 16.625V16.5C7.25 13.8766 9.37665 11.75 12 11.75C14.6234 11.75 16.75 13.8766 16.75 16.5V16.625C16.75 17.5225 16.0225 18.25 15.125 18.25H8.875C7.97754 18.25 7.25 17.5225 7.25 16.625Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.25 17.2602H2.75C1.64543 17.2602 0.706551 16.3538 0.919944 15.2701C1.25877 13.5493 2.15049 12.3257 4 11.8301" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.75 17.2601H21.25C22.3546 17.2601 23.2935 16.3538 23.08 15.27C22.7412 13.5493 21.8495 12.3257 20 11.8301" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M4.75 10.9853V4.75C4.75 3.64543 5.64543 2.75 6.75 2.75H17.25C18.3546 2.75 19.25 3.64543 19.25 4.75V10.9853M9.75 7.75H14.25M12.617 13.5499L19.9415 11.1744C20.5875 10.9649 21.25 11.4465 21.25 12.1256V18.25C21.25 19.3546 20.3546 20.25 19.25 20.25H4.75C3.64543 20.25 2.75 19.3546 2.75 18.25V12.1256C2.75 11.4465 3.41249 10.9649 4.0585 11.1744L11.383 13.5499C11.784 13.68 12.216 13.68 12.617 13.5499Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 576 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M21.75 12C21.75 6.84375 17.9583 3.75 12 3.75C6.04167 3.75 2.25 6.84375 2.25 12C2.25 13.3368 3.17054 15.6055 3.3145 15.9522C3.32742 15.9833 3.34021 16.0117 3.3518 16.0433C3.45089 16.3136 3.85722 17.7527 2.25 19.8828C4.41667 20.914 6.71766 19.2188 6.71766 19.2188C8.30963 20.0597 10.2038 20.25 12 20.25C17.9583 20.25 21.75 17.1562 21.75 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 520 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"> <path d="M21.75 12C21.75 6.84375 17.9583 3.75 12 3.75C6.04167 3.75 2.25 6.84375 2.25 12C2.25 13.3368 3.17054 15.6055 3.3145 15.9522C3.32742 15.9833 3.34021 16.0117 3.3518 16.0433C3.45089 16.3136 3.85722 17.7527 2.25 19.8828C4.41667 20.914 6.71766 19.2188 6.71766 19.2188C8.30963 20.0597 10.2038 20.25 12 20.25C17.9583 20.25 21.75 17.1562 21.75 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/><path d="M12 8.75V15.25M8.75 12H15.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> </svg>

After

Width:  |  Height:  |  Size: 624 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M17.75 2.75H6.25C5.14543 2.75 4.25 3.64543 4.25 4.75V19.25C4.25 20.3546 5.14543 21.25 6.25 21.25H17.75C18.8546 21.25 19.75 20.3546 19.75 19.25V4.75C19.75 3.64543 18.8546 2.75 17.75 2.75Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="12.25" r="2.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M16 21C16 18.7909 14.2091 17 12 17C9.79086 17 8 18.7909 8 21" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M9.75 6.25H14.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 696 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="9.25" r="1.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.75 21.25L11.75 9.25H12.25L16.25 21.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M9.5 17.75H14.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.75693 12.7501C6.08102 10.7234 6.08103 7.77679 7.75693 5.75M16.2431 5.75C17.919 7.77679 17.919 10.7234 16.2431 12.7501" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.06494 2.7574C1.64285 6.40823 1.64502 12.1018 5.07145 15.75M18.9281 2.75C22.3572 6.40053 22.3573 12.0993 18.9285 15.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 899 B

+3 -1
View File
@@ -1 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M20.25 20.25L16.1265 16.1265M16.1265 16.1265C17.4385 14.8145 18.25 13.002 18.25 11C18.25 6.99594 15.0041 3.75 11 3.75C6.99594 3.75 3.75 6.99594 3.75 11C3.75 15.0041 6.99594 18.25 11 18.25C13.002 18.25 14.8145 17.4385 16.1265 16.1265Z" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path d="M20 20L16.1265 16.1265M16.1265 16.1265C17.4385 14.8145 18.25 13.002 18.25 11C18.25 6.99594 15.0041 3.75 11 3.75C6.99594 3.75 3.75 6.99594 3.75 11C3.75 15.0041 6.99594 18.25 11 18.25C13.002 18.25 14.8145 17.4385 16.1265 16.1265Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 408 B

+1
View File
@@ -1155,6 +1155,7 @@ impl ChatPanel {
.avatar(
Avatar::new(author.avatar())
.seed(author.avatar_seed())
.small()
.flex_shrink_0()
.relative()
.dropdown_menu(move |this, _window, _cx| {
+3 -4
View File
@@ -10,7 +10,6 @@ use gpui_kit::component::{
ActiveTheme, InteractiveElementExt as _, StyledExt as _, h_flex, v_flex,
};
use smallvec::SmallVec;
pub use ui::Avatar;
type MouseDownListener = Box<dyn Fn(&MouseDownEvent, &mut Window, &mut App) + 'static>;
@@ -191,10 +190,10 @@ impl RenderOnce for MessageRow {
if show_author {
match avatar {
Some(avatar) => this.child(avatar),
None => this.child(div().flex_shrink_0().w(px(32.))),
None => this.child(div().flex_shrink_0().w(px(24.))),
}
} else {
this.child(div().flex_shrink_0().w(px(32.)))
this.child(div().flex_shrink_0().w(px(24.)))
}
})
.child(
@@ -229,7 +228,7 @@ impl RenderOnce for MessageRow {
.when_some(on_double_click, |this, listener| {
this.on_double_click(listener)
})
.hover(|this| this.bg(cx.theme().accent))
.hover(|this| this.bg(cx.theme().list_hover))
.into_any_element()
}
}
+2 -1
View File
@@ -61,6 +61,7 @@ pub(crate) fn render(
.avatar(
Avatar::new(author.avatar())
.seed(author.avatar_seed())
.small()
.flex_shrink_0(),
)
.author(author.name())
@@ -218,7 +219,7 @@ pub(crate) fn render_activity(
.gap_2()
.py_1()
.px_3()
.hover(|this| this.bg(cx.theme().primary))
.hover(|this| this.bg(cx.theme().list_hover))
.child(badge(activity, cx))
.when(!hide_avatar, |this| {
this.child(
+45
View File
@@ -0,0 +1,45 @@
use gpui::SharedString;
use gpui_kit::assets::IconNamed;
/// Coop icons kept from before the gpui-kit migration; absent from the kit bundle.
#[derive(Clone, Copy)]
pub enum IconName {
ArrowDownCircle,
ArrowLeft,
Book,
CaretDown,
CaretRight,
Compass,
Door,
Group,
Invite,
Message,
PlusChat,
Profile,
Relay,
Search,
Settings,
}
impl IconNamed for IconName {
fn path(self) -> SharedString {
match self {
Self::ArrowDownCircle => "icons/arrow-down-circle.svg",
Self::ArrowLeft => "icons/arrow-left.svg",
Self::Book => "icons/book.svg",
Self::CaretDown => "icons/caret-down.svg",
Self::CaretRight => "icons/caret-right.svg",
Self::Compass => "icons/compass.svg",
Self::Door => "icons/door.svg",
Self::Group => "icons/group.svg",
Self::Invite => "icons/invite.svg",
Self::Message => "icons/message.svg",
Self::PlusChat => "icons/plus-chat.svg",
Self::Profile => "icons/profile.svg",
Self::Relay => "icons/relay.svg",
Self::Search => "icons/search.svg",
Self::Settings => "icons/settings.svg",
}
.into()
}
}
+2
View File
@@ -1,5 +1,7 @@
pub use avatar::Avatar;
pub use icon::IconName;
pub use window_drag::title_bar_drag_handlers;
pub mod avatar;
pub mod icon;
pub mod window_drag;
+8 -6
View File
@@ -231,7 +231,7 @@ impl GreeterPanel {
.gap_2()
.rounded(cx.theme().radius)
.cursor_pointer()
.hover(|this| this.bg(cx.theme().primary))
.hover(|this| this.bg(cx.theme().list_hover))
.on_click({
let room = room.clone();
let dock = dock.clone();
@@ -312,8 +312,9 @@ impl GreeterPanel {
)
.child(
v_flex()
.p_2()
.rounded(cx.theme().radius)
.px_2()
.py_1()
.rounded(cx.theme().radius_lg)
.bg(cx.theme().group_box)
.text_color(cx.theme().group_box_foreground)
.children(rows),
@@ -349,7 +350,7 @@ impl GreeterPanel {
.gap_2()
.rounded(cx.theme().radius)
.cursor_pointer()
.hover(|this| this.bg(cx.theme().primary))
.hover(|this| this.bg(cx.theme().list_hover))
.on_click({
let room = room.clone();
let dock = dock.clone();
@@ -430,8 +431,9 @@ impl GreeterPanel {
)
.child(
v_flex()
.p_2()
.rounded(cx.theme().radius)
.px_2()
.py_1()
.rounded(cx.theme().radius_lg)
.bg(cx.theme().group_box)
.text_color(cx.theme().group_box_foreground)
.children(rows),
+3 -4
View File
@@ -6,7 +6,6 @@ use gpui::{
AnyElement, ClipboardItem, Context, Entity, InteractiveElement as _, IntoElement,
ParentElement, SharedString, Styled, WeakEntity, div, relative, uniform_list,
};
use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::menu::{ContextMenuExt as _, PopupMenuItem};
@@ -15,7 +14,7 @@ use nip29::Group;
use nostr_sdk::prelude::*;
use settings::AppSettings;
use state::NostrRegistry;
use ui::Avatar;
use ui::{Avatar, IconName};
use super::Sidebar;
use crate::dialogs::profile;
@@ -235,9 +234,9 @@ impl Sidebar {
GroupSection::Members => self.members_open,
};
let icon = if open {
IconName::ChevronDown
IconName::CaretDown
} else {
IconName::ChevronRight
IconName::CaretRight
};
let label = section.label();
+24 -37
View File
@@ -4,8 +4,6 @@ use gpui::{
AnyElement, App, Context, Div, Entity, InteractiveElement, IntoElement, ParentElement,
Stateful, Styled, Window, div, px,
};
use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariant, ButtonVariants};
use gpui_kit::component::dialog::DialogButtonProps;
use gpui_kit::component::menu::{DropdownMenu, PopupMenuItem};
@@ -14,7 +12,7 @@ use gpui_kit::component::{
};
use nostr_sdk::prelude::*;
use state::NostrRegistry;
use ui::Avatar;
use ui::{Avatar, IconName};
use super::Sidebar;
use crate::Command;
@@ -30,7 +28,6 @@ impl Sidebar {
let updater = AutoUpdater::try_global(cx);
let profile = self.directory.read(cx).person(current_user, cx);
let avatar = profile.avatar();
let name = profile.name();
h_flex()
.id("sidebar-user")
@@ -46,36 +43,28 @@ impl Sidebar {
.dropdown_caret(true)
.min_w_0()
.flex_shrink_1()
.child(
h_flex()
.min_w_0()
.gap_1p5()
.child(Avatar::new(avatar).seed(profile.avatar_seed()).small())
.child(
div()
.min_w_0()
.truncate()
.text_xs()
.font_semibold()
.child(name),
),
)
.child(Avatar::new(avatar).seed(profile.avatar_seed()).small())
.dropdown_menu(move |this, _window, _cx| {
this.menu("Profile", Box::new(Command::ShowProfile))
.menu("Relays", Box::new(Command::ShowRelayList))
.separator()
.item(
PopupMenuItem::element(|_, cx| {
div().text_color(cx.theme().danger).child("Log out")
})
.on_click(|_, window, cx| {
open_logout_dialog(window, cx);
}),
)
this.menu_with_icon(
"Profile",
IconName::Profile,
Box::new(Command::ShowProfile),
)
.menu_with_icon("Relays", IconName::Relay, Box::new(Command::ShowRelayList))
.separator()
.item(
PopupMenuItem::element(|_, cx| {
div().text_color(cx.theme().danger).child("Log out")
})
.on_click(|_, window, cx| {
open_logout_dialog(window, cx);
}),
)
}),
)
.child(
h_flex()
.gap_1()
.when_some(updater, |this, updater| {
this.child(self.render_updater(updater, cx))
})
@@ -86,34 +75,32 @@ impl Sidebar {
.selected(self.search_open)
.ghost()
.small()
.flex_shrink_0()
.on_click(cx.listener(|this, _event, window, cx| {
this.toggle_search(window, cx);
})),
)
.child(
Button::new("sidebar-new")
.icon(IconName::MessageSquarePlus)
.icon(IconName::PlusChat)
.tooltip("New")
.ghost()
.small()
.flex_shrink_0()
.dropdown_menu(|menu, _window, _cx| {
menu.label("Public Group")
.menu_with_icon(
"New Group",
IconName::Users,
IconName::Group,
Box::new(Command::NewGroup),
)
.menu_with_icon(
"Join Group",
IconName::DoorOpen,
IconName::Door,
Box::new(Command::JoinGroup),
)
.separator()
.menu_with_icon(
"New Chat",
IconName::MessageSquare,
IconName::Message,
Box::new(Command::NewChat),
)
}),
@@ -150,7 +137,7 @@ impl Sidebar {
.when(!up_to_date, |this| {
this.child(
Button::new("update")
.icon(IconName::CircleArrowDown)
.icon(IconName::ArrowDownCircle)
.tooltip(status)
.small()
.ghost()
@@ -160,7 +147,7 @@ impl Sidebar {
.when(staged, |this| {
this.child(
Button::new("restart")
.icon(IconName::CircleArrowDown)
.icon(IconName::ArrowDownCircle)
.tooltip("Quit and relaunch into the installed update")
.small()
.ghost()
+3 -6
View File
@@ -5,11 +5,11 @@ use gpui::prelude::FluentBuilder;
use gpui::{
AnyElement, App, Context, IntoElement, ParentElement, SharedString, Styled, div, uniform_list,
};
use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::{ActiveTheme, Icon, Sizable, h_flex, v_flex};
use nip29::GroupsRegistry;
use settings::AppSettings;
use ui::IconName;
use super::Sidebar;
use super::rows::SidebarRow;
@@ -46,10 +46,7 @@ impl Sidebar {
let (list_id, title) = if contacts_open {
("sidebar-contacts", Some(("Contacts", IconName::Book)))
} else if requests_open {
(
"sidebar-requests",
Some(("Requests", IconName::UserRoundPlus)),
)
("sidebar-requests", Some(("Requests", IconName::Invite)))
} else {
("sidebar-list", None)
};
@@ -80,7 +77,7 @@ impl Sidebar {
)
.child(
Nav::new("reqs")
.prefix(Icon::new(IconName::UserRoundPlus).small())
.prefix(Icon::new(IconName::Invite).small())
.label("Requests")
.text_sm()
.when(request_count > 0, |this| {
+5 -10
View File
@@ -1,8 +1,8 @@
use gpui_kit::component::button::{Button, ButtonCustomVariant, ButtonVariants};
use gpui_kit::component::{Sizable, v_flex};
use std::time::{SystemTime, UNIX_EPOCH};
use gpui::{AnyElement, App, IntoElement, ParentElement, SharedString, Styled, Window, img};
use gpui_kit::component::button::{Button, ButtonVariants};
use gpui_kit::component::{Sizable, v_flex};
use crate::dialogs::import;
@@ -16,11 +16,12 @@ pub(super) fn pick_banner() -> SharedString {
.map(|elapsed| elapsed.subsec_nanos())
.unwrap_or_default();
let index = nanos as usize % SIGNED_OUT_BANNERS.len();
SIGNED_OUT_BANNERS[index].into()
}
/// The headline and identity import shown while signed out.
pub(super) fn render_signed_out(_window: &mut Window, cx: &mut App) -> AnyElement {
pub(super) fn render_signed_out(_window: &mut Window, _cx: &mut App) -> AnyElement {
v_flex()
.size_full()
.justify_end()
@@ -30,13 +31,7 @@ pub(super) fn render_signed_out(_window: &mut Window, cx: &mut App) -> AnyElemen
.child(
Button::new("import")
.label("Import Identity")
.custom(
ButtonCustomVariant::new(cx)
.color(gpui::white())
.foreground(gpui::black())
.hover(gpui::white().opacity(0.9))
.active(gpui::white().opacity(0.8)),
)
.primary()
.large()
.on_click(|_, window, cx| {
import::open(window, cx);
+3 -4
View File
@@ -7,7 +7,6 @@ use gpui::{
AnyElement, App, Context, Entity, InteractiveElement as _, IntoElement, ParentElement,
SharedString, Styled, WeakEntity, Window, div, px,
};
use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::dialog::DialogButtonProps;
use gpui_kit::component::dock::{ClosePanel, DockArea, DockPlacement, PanelHandle};
@@ -16,7 +15,7 @@ use gpui_kit::component::{ActiveTheme, Icon, Selectable, Sizable, WindowExt, h_f
use nip29::Group;
use nostr_sdk::prelude::*;
use settings::AppSettings;
use ui::Avatar;
use ui::{Avatar, IconName};
use super::Sidebar;
use super::list::ListSection;
@@ -112,9 +111,9 @@ impl Sidebar {
};
let icon = if open {
IconName::ChevronDown
IconName::CaretDown
} else {
IconName::ChevronRight
IconName::CaretRight
};
Nav::new(label)