migrate ui components to gpui-kit
This commit is contained in:
@@ -4,13 +4,13 @@ use gpui::{
|
||||
AnyElement, App, AppContext, Context, IntoElement, ParentElement, SharedString, Styled, Task,
|
||||
Window, div,
|
||||
};
|
||||
use gpui_kit::component::button::{Button, ButtonVariants};
|
||||
use gpui_kit::component::dock::{DockPlacement, PanelHandle};
|
||||
use gpui_kit::component::notification::Notification;
|
||||
use gpui_kit::component::{ActiveTheme, WindowExt, h_flex, v_flex};
|
||||
use nostr_sdk::prelude::*;
|
||||
use state::NostrRegistry;
|
||||
use theme::{ActiveTheme, TextStyle, Typeset as _};
|
||||
use ui::button::{Button, ButtonVariants};
|
||||
use ui::dock::{DockPlacement, PanelHandle};
|
||||
use ui::notification::Notification;
|
||||
use ui::{StyledExt, WindowExtension, h_flex, v_flex};
|
||||
use ui::{TextStyle, Typeset as _};
|
||||
|
||||
use super::Sidebar;
|
||||
use super::rows::SidebarRow;
|
||||
@@ -127,7 +127,7 @@ impl Sidebar {
|
||||
})?;
|
||||
|
||||
cx.update(|window, cx| {
|
||||
ui::dock::add_panel_to(
|
||||
crate::dock::add_panel_to(
|
||||
&dock,
|
||||
PanelHandle::new(chat_ui::init(room.downgrade(), window, cx)),
|
||||
DockPlacement::Center,
|
||||
@@ -195,7 +195,7 @@ impl Sidebar {
|
||||
.px_4()
|
||||
.border_t_1()
|
||||
.border_color(cx.theme().border)
|
||||
.bg(cx.theme().bg)
|
||||
.bg(cx.theme().background)
|
||||
.child(
|
||||
Button::new("create-chat")
|
||||
.label(if self.selected_contacts.len() > 1 {
|
||||
@@ -212,11 +212,11 @@ impl Sidebar {
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.text_style(TextStyle::Caption)
|
||||
.text_color(cx.theme().text_muted)
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.child("Selected")
|
||||
.child(
|
||||
div()
|
||||
.font_semibold()
|
||||
.font_weight(gpui::FontWeight::SEMIBOLD)
|
||||
.child(SharedString::from(self.selected_contacts.len().to_string())),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user