Tweak code to remove duplication

This commit is contained in:
Joseph Lyons 2023-02-24 08:53:58 -05:00
parent f8f1a3f86e
commit 72197802a2

View file

@ -44,13 +44,13 @@ impl View for FeedbackInfoText {
)
.with_child(
MouseEventHandler::<OpenZedCommunityRepo>::new(0, cx, |state, _| {
let text = if state.hovered() {
theme.feedback.link_text_hover.clone()
let contained_text = if state.hovered() {
&theme.feedback.link_text_hover
} else {
theme.feedback.link_text_default.clone()
&theme.feedback.link_text_default
};
Label::new("community repo", text.text)
Label::new("community repo", contained_text.text.clone())
.contained()
.aligned()
.left()