Skip to content

Commit

Permalink
update(SuggestedEmoji): Improve Suggested Emoji UI (#1548)
Browse files Browse the repository at this point in the history
Co-authored-by: Phill Wisniewski <93608357+phillsatellite@users.noreply.github.com>
Co-authored-by: InfamousVague <infamousvaguerat@gmail.com>
Co-authored-by: Sara Tavares <29093946+stavares843@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 28, 2023
1 parent f884017 commit f87f6a5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
1 change: 1 addition & 0 deletions common/locales/en-US/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ messages = Messages
.pinned-max = You reached the maximum amount of pinned messages for this chat
.missing-emoji-picker = Emoji extension is disabled
.unknown-identity = User not found:
.suggested-emoji = Suggested Emoji
favorites = Favorites
.favorites = Favorites
Expand Down
19 changes: 10 additions & 9 deletions kit/src/layout/chatbar/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use common::icons::outline::Shape as Icon;
use dioxus::prelude::*;
use dioxus_elements::input_data::keyboard_types::Code;
use warp::constellation::file::File;
Expand Down Expand Up @@ -261,16 +260,18 @@ fn EmojiSuggesions<'a>(cx: Scope<'a, EmojiSuggestionProps<'a>>) -> Element<'a> {
*cx.props.selected.write() = None;
},
Button {
small: true,
aria_label: "emoji-suggestion-close-button".into(),
icon: Icon::XMark,
appearance: Appearance::Transparent,
onpress: move |_| {
cx.props.on_close.call(());
}
},
Label {
text: "Suggested Emoji".into()
appearance: Appearance::Secondary,
icon: icons::outline::Shape::XMark,
onpress: move |_| cx.props.on_close.call(()),
},
div {
class: "emoji-suggestions-header",
Label {
text: get_local_text("messages.suggested-emoji"),
},
}
cx.props.suggestions.iter().enumerate().map(|(num, (emoji,alias))| {
cx.render(rsx!(div {
class: format_args!("{} {}", "emoji-suggestion", match cx.props.selected.read().as_ref() {
Expand Down
31 changes: 22 additions & 9 deletions ui/src/layouts/chats/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -731,12 +731,13 @@
position: absolute;
bottom: 100%;
color: var(--text-color);
background-color: var(--secondary);
padding: var(--gap-less) var(--gap);
background: var(--secondary-dark);
padding: var(--gap);
border-radius: var(--border-radius);
border: 1px solid var(--border-subtle-color);
max-height: 200px;
width: calc(100% - var(--padding-more));
overflow: scroll;
width: calc(100% - var(--padding));
overflow-y: auto;
&::-webkit-scrollbar-track {
background: transparent;
}
Expand All @@ -749,21 +750,33 @@
background: var(--secondary-light);
}


.emoji-suggestions-header {
height: var(--height-input);
display: inline-flex;
align-items: center;
width: 100%;
}

.emoji-suggestion {
display: flex;
align-items: center;
border-radius: var(--border-radius);
padding: var(--gap-less) var(--gap);
padding: var(--gap-less) var(--gap);
padding: var(--gap);
width: 100%;

&.emoji-selected {
background-color: var(--secondary-dark);
background-color: var(--secondary-light);
}
&:hover {
cursor: pointer;
background-color: var(--secondary-dark);
background-color: var(--secondary-light);
}
}

.btn-wrap {
position: absolute;
top: var(--gap);
right: var(--gap);
z-index: 1;
}
}

0 comments on commit f87f6a5

Please sign in to comment.