From f9bf688c9e3fb80466e2a60600b4ed1b58550072 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Mon, 24 Apr 2023 16:24:50 -0700 Subject: [PATCH] compose: Add DM icon to the recipient dropdown. This commit adds the new users icon and uses it in the recipient dropdown, both in the selection options and the selected option displayed on the button. --- web/images/icons/users.svg | 6 ++++++ web/src/compose_actions.js | 5 ++++- web/src/compose_recipient.js | 1 + web/styles/app_components.css | 4 +++- web/templates/settings/dropdown_list.hbs | 2 ++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 web/images/icons/users.svg diff --git a/web/images/icons/users.svg b/web/images/icons/users.svg new file mode 100644 index 0000000000..b54475b48c --- /dev/null +++ b/web/images/icons/users.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/web/src/compose_actions.js b/web/src/compose_actions.js index 75d5263222..b759ccf5ce 100644 --- a/web/src/compose_actions.js +++ b/web/src/compose_actions.js @@ -96,7 +96,10 @@ export function show_compose_box(msg_type, opts) { // button. It would be nice if the dropdown supported a way to attach // the "DM" button display string so we wouldn't have to manually change // it here. - $("#compose_select_recipient_name").text($t({defaultMessage: "DM"})); + const direct_message_label = $t({defaultMessage: "DM"}); + $("#compose_select_recipient_name").html( + ` ${direct_message_label}`, + ); } compose_banner.clear_errors(); compose_banner.clear_warnings(); diff --git a/web/src/compose_recipient.js b/web/src/compose_recipient.js index 5da787640a..f6f5dd3156 100644 --- a/web/src/compose_recipient.js +++ b/web/src/compose_recipient.js @@ -202,6 +202,7 @@ function get_options_for_recipient_widget() { const direct_messages_option = { name: $t({defaultMessage: "Direct message"}), value: DIRECT_MESSAGE, + is_direct_message: true, }; if ( page_params.realm_private_message_policy === diff --git a/web/styles/app_components.css b/web/styles/app_components.css index 4b704bf1aa..95b93d265d 100644 --- a/web/styles/app_components.css +++ b/web/styles/app_components.css @@ -829,13 +829,15 @@ div.overlay { position: relative; top: 0.06rem; padding-right: 1px; + width: 12px; &.zulip-icon-globe, &.zulip-icon-hashtag { font-size: 0.75em; } - &.zulip-icon-lock { + &.zulip-icon-lock, + &.zulip-icon-users { font-size: 0.8em; } } diff --git a/web/templates/settings/dropdown_list.hbs b/web/templates/settings/dropdown_list.hbs index 58cc715cd5..39303e4d19 100644 --- a/web/templates/settings/dropdown_list.hbs +++ b/web/templates/settings/dropdown_list.hbs @@ -3,6 +3,8 @@ {{#if stream}} {{> ../inline_decorated_stream_name stream=stream show_colored_icon=true}} + {{else if is_direct_message}} + {{name}} {{else}} {{name}} {{/if}}