From 63cc9e506801694f3413f6155834751652811833 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Fri, 8 Dec 2023 13:07:16 -0500 Subject: [PATCH] Move character counter up above editor in feedback modal --- crates/feedback2/src/feedback_modal.rs | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/crates/feedback2/src/feedback_modal.rs b/crates/feedback2/src/feedback_modal.rs index 5ac2197609..ada844ecda 100644 --- a/crates/feedback2/src/feedback_modal.rs +++ b/crates/feedback2/src/feedback_modal.rs @@ -301,6 +301,29 @@ impl Render for FeedbackModal { // TODO: Add Headline component to `ui2` div().text_xl().child("Share Feedback"), )) + .child( + Label::new(if self.character_count < *FEEDBACK_CHAR_LIMIT.start() { + format!( + "Feedback must be at least {} characters.", + FEEDBACK_CHAR_LIMIT.start() + ) + } else if self.character_count > *FEEDBACK_CHAR_LIMIT.end() { + format!( + "Feedback must be less than {} characters.", + FEEDBACK_CHAR_LIMIT.end() + ) + } else { + format!( + "Characters: {}", + *FEEDBACK_CHAR_LIMIT.end() - self.character_count + ) + }) + .color(if valid_character_count { + Color::Success + } else { + Color::Error + }), + ) .child( div() .flex_1() @@ -313,29 +336,6 @@ impl Render for FeedbackModal { ) .child( div() - .child( - Label::new(if self.character_count < *FEEDBACK_CHAR_LIMIT.start() { - format!( - "Feedback must be at least {} characters.", - FEEDBACK_CHAR_LIMIT.start() - ) - } else if self.character_count > *FEEDBACK_CHAR_LIMIT.end() { - format!( - "Feedback must be less than {} characters.", - FEEDBACK_CHAR_LIMIT.end() - ) - } else { - format!( - "Characters: {}", - *FEEDBACK_CHAR_LIMIT.end() - self.character_count - ) - }) - .color(if valid_character_count { - Color::Success - } else { - Color::Error - }), - ) .child( h_stack() .bg(cx.theme().colors().editor_background)