Close feedback modal when clicking cancel
This commit is contained in:
parent
e228422f14
commit
a75f1a4a95
1 changed files with 4 additions and 1 deletions
|
@ -112,6 +112,8 @@ impl Render for FeedbackModal {
|
||||||
type Element = Div;
|
type Element = Div;
|
||||||
|
|
||||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
||||||
|
let dismiss = cx.listener(|_, _, cx| cx.emit(DismissEvent));
|
||||||
|
|
||||||
v_stack()
|
v_stack()
|
||||||
.elevation_3(cx)
|
.elevation_3(cx)
|
||||||
.min_w(rems(40.))
|
.min_w(rems(40.))
|
||||||
|
@ -135,7 +137,8 @@ impl Render for FeedbackModal {
|
||||||
.child(
|
.child(
|
||||||
Button::new("cancel_feedback", "Cancel")
|
Button::new("cancel_feedback", "Cancel")
|
||||||
.style(ButtonStyle::Subtle)
|
.style(ButtonStyle::Subtle)
|
||||||
.color(Color::Muted),
|
.color(Color::Muted)
|
||||||
|
.on_click(dismiss),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new("send_feedback", "Send Feedback")
|
Button::new("send_feedback", "Send Feedback")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue