Start on collab panel empty state

This commit is contained in:
Nate Butler 2023-12-18 11:33:37 -05:00
parent 488073deba
commit 196df1c378

View file

@ -2027,20 +2027,33 @@ impl CollabPanel {
} }
fn render_signed_out(&mut self, cx: &mut ViewContext<Self>) -> Div { fn render_signed_out(&mut self, cx: &mut ViewContext<Self>) -> Div {
v_stack().border_1().border_color(gpui::red()).child( v_stack()
Button::new("sign_in", "Sign in to collaborate").on_click(cx.listener( .justify_center()
|this, _, cx| { .items_center()
let client = this.client.clone(); .child(v_stack().gap_1().p_4()
cx.spawn(|_, mut cx| async move { .child(
client Label::new("Work with your team with realtive collaborative editing, voice, shared notes and more.")
.authenticate_and_connect(true, &cx) )
.await .child(
.notify_async_err(&mut cx); Label::new("Sign in to enable collaboration.")
}) )
.detach() .child(
}, Button::new("sign_in", "Sign in")
)), .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()
},
)),
))
} }
fn render_list_entry(&mut self, ix: usize, cx: &mut ViewContext<Self>) -> AnyElement { fn render_list_entry(&mut self, ix: usize, cx: &mut ViewContext<Self>) -> AnyElement {