diff --git a/assets/icons/github.svg b/assets/icons/github.svg
new file mode 100644
index 0000000000000000000000000000000000000000..28148b9894b21f0f5995f3ffcfc464b161f3169a
--- /dev/null
+++ b/assets/icons/github.svg
@@ -0,0 +1 @@
+
diff --git a/crates/collab_ui2/src/collab_panel.rs b/crates/collab_ui2/src/collab_panel.rs
index 5f01d4987838961e9c7e086ec1f115e527bbee33..5fc0c77d0c151a130ce9900a724dfaaa17e99cb7 100644
--- a/crates/collab_ui2/src/collab_panel.rs
+++ b/crates/collab_ui2/src/collab_panel.rs
@@ -2027,20 +2027,40 @@ impl CollabPanel {
}
fn render_signed_out(&mut self, cx: &mut ViewContext) -> Div {
- v_stack().border_1().border_color(gpui::red()).child(
- Button::new("sign_in", "Sign in to collaborate").on_click(cx.listener(
- |this, _, cx| {
- let client = this.client.clone();
- cx.spawn(|_, mut cx| async move {
- client
- .authenticate_and_connect(true, &cx)
- .await
- .notify_async_err(&mut cx);
- })
- .detach()
- },
- )),
- )
+ v_stack()
+ .items_center()
+ .child(v_stack().gap_6().p_4()
+ .child(
+ Label::new("Work with your team in realtime with collaborative editing, voice, shared notes and more.")
+ )
+ .child(v_stack().gap_2()
+
+ .child(
+ Button::new("sign_in", "Sign in")
+ .icon_color(Color::Muted)
+ .icon(Icon::Github)
+ .icon_position(IconPosition::Start)
+ .style(ButtonStyle::Filled)
+ .full_width()
+ .on_click(cx.listener(
+ |this, _, cx| {
+ let client = this.client.clone();
+ cx.spawn(|_, mut cx| async move {
+ client
+ .authenticate_and_connect(true, &cx)
+ .await
+ .notify_async_err(&mut cx);
+ })
+ .detach()
+ },
+ )))
+ .child(
+ div().flex().w_full().items_center().child(
+ Label::new("Sign in to enable collaboration.")
+ .color(Color::Muted)
+ .size(LabelSize::Small)
+ )),
+ ))
}
fn render_list_entry(&mut self, ix: usize, cx: &mut ViewContext) -> AnyElement {
diff --git a/crates/ui2/src/components/button/button.rs b/crates/ui2/src/components/button/button.rs
index fc7ca2c12872142e5e41a8a2a96e6c8fe764697a..014a2f536278e6064769a5605eb43dafd01a4ee0 100644
--- a/crates/ui2/src/components/button/button.rs
+++ b/crates/ui2/src/components/button/button.rs
@@ -151,26 +151,31 @@ impl RenderOnce for Button {
self.base.child(
h_stack()
.gap_1()
- .map(|this| {
- if self.icon_position == Some(IconPosition::End) {
- this.flex_row_reverse()
- } else {
- this
- }
+ .when(self.icon_position.is_some(), |this| {
+ this.children(self.icon.map(|icon| {
+ ButtonIcon::new(icon)
+ .disabled(is_disabled)
+ .selected(is_selected)
+ .selected_icon(self.selected_icon)
+ .size(self.icon_size)
+ .color(self.icon_color)
+ }))
})
.child(
Label::new(label)
.color(label_color)
.line_height_style(LineHeightStyle::UILabel),
)
- .children(self.icon.map(|icon| {
- ButtonIcon::new(icon)
- .disabled(is_disabled)
- .selected(is_selected)
- .selected_icon(self.selected_icon)
- .size(self.icon_size)
- .color(self.icon_color)
- })),
+ .when(!self.icon_position.is_some(), |this| {
+ this.children(self.icon.map(|icon| {
+ ButtonIcon::new(icon)
+ .disabled(is_disabled)
+ .selected(is_selected)
+ .selected_icon(self.selected_icon)
+ .size(self.icon_size)
+ .color(self.icon_color)
+ }))
+ }),
)
}
}
diff --git a/crates/ui2/src/components/button/button_like.rs b/crates/ui2/src/components/button/button_like.rs
index 8255490476b8a58f4a39d03de10412151f320db6..54f2a0e9eaa0a7a87a93927088bc3a6e7975c06b 100644
--- a/crates/ui2/src/components/button/button_like.rs
+++ b/crates/ui2/src/components/button/button_like.rs
@@ -355,7 +355,7 @@ impl RenderOnce for ButtonLike {
.group("")
.flex_none()
.h(self.size.height())
- .when_some(self.width, |this, width| this.w(width))
+ .when_some(self.width, |this, width| this.w(width).justify_center())
.rounded_md()
.gap_1()
.map(|this| match self.size {
diff --git a/crates/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs
index 6876630100e95d3ec23252e80787642263783d56..6216acac483489f283366177fe5b6416495122c9 100644
--- a/crates/ui2/src/components/icon.rs
+++ b/crates/ui2/src/components/icon.rs
@@ -67,6 +67,7 @@ pub enum Icon {
Folder,
FolderOpen,
FolderX,
+ Github,
Hash,
InlayHint,
Link,
@@ -147,6 +148,7 @@ impl Icon {
Icon::Folder => "icons/file_icons/folder.svg",
Icon::FolderOpen => "icons/file_icons/folder_open.svg",
Icon::FolderX => "icons/stop_sharing.svg",
+ Icon::Github => "icons/github.svg",
Icon::Hash => "icons/hash.svg",
Icon::InlayHint => "icons/inlay_hint.svg",
Icon::Link => "icons/link.svg",