From e228422f1444c15b6bb4f90f64c0946b807c4fd5 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 30 Nov 2023 16:42:58 -0500 Subject: [PATCH] Update feedback modal UI Co-Authored-By: Joseph T. Lyons <19867440+JosephTLyons@users.noreply.github.com> --- crates/feedback2/src/feedback_modal.rs | 64 ++++++++++++++++++++------ 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/crates/feedback2/src/feedback_modal.rs b/crates/feedback2/src/feedback_modal.rs index 3335576028..bc42c3ec3c 100644 --- a/crates/feedback2/src/feedback_modal.rs +++ b/crates/feedback2/src/feedback_modal.rs @@ -1,8 +1,8 @@ use gpui::{ - div, AppContext, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, Render, + div, rems, AppContext, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, Render, ViewContext, }; -use ui::prelude::*; +use ui::{prelude::*, Button, ButtonStyle, Label, Tooltip}; use workspace::Workspace; use crate::feedback_editor::GiveFeedback; @@ -112,19 +112,53 @@ impl Render for FeedbackModal { type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { - div().elevation_3(cx).w_1_2().h_2_3().child( - v_stack() - .w_full() - .child(h_stack().child("header")) - .child("editor"), - // Header - // - has some info, maybe some links - // Body - // - Markdown Editor - // - Email address - // Footer - // - CTA buttons (Send, Cancel) - ) + v_stack() + .elevation_3(cx) + .min_w(rems(40.)) + .max_w(rems(96.)) + .h(rems(40.)) + .p_2() + .gap_2() + .child(h_stack().child(Label::new("Give Feedback").color(Color::Default))) + .child( + div() + .flex_1() + .bg(cx.theme().colors().editor_background) + .border() + .border_color(cx.theme().colors().border) + .child("editor"), + ) + .child( + h_stack() + .justify_end() + .gap_1() + .child( + Button::new("cancel_feedback", "Cancel") + .style(ButtonStyle::Subtle) + .color(Color::Muted), + ) + .child( + Button::new("send_feedback", "Send Feedback") + .color(Color::Accent) + .style(ButtonStyle::Filled) + .tooltip(|cx| { + Tooltip::with_meta( + "Submit feedback to the Zed team.", + None, + "Provide an email address if you want us to be able to reply.", + cx, + ) + }), + ), + ) + + // Header + // - has some info, maybe some links + // Body + // - Markdown Editor + // - Email address + // Footer + // - CTA buttons (Send, Cancel) // div() // .elevation_2(cx)