compose: Rename message_sent_banner template variables.

This is a prep commit for redesigning this banner. The
change from `note` to `banner_text` is more consistent
with `compose_banner`. `link_class` is renamed to classname
and will be used for the banner a whole and not the link
class anymore, which is why the check for displaying a link
now looks to see if `link_text` is defined instead.
This commit is contained in:
evykassirer
2023-01-07 16:52:26 -08:00
committed by Tim Abbott
parent 2c94d2b22f
commit 3a264c37b5
2 changed files with 12 additions and 12 deletions

View File

@@ -166,16 +166,16 @@ export function is_window_focused() {
export let scroll_to_message_banner_message_id = null; export let scroll_to_message_banner_message_id = null;
export function notify_above_composebox( export function notify_above_composebox(
note, banner_text,
link_class, classname,
above_composebox_narrow_url, above_composebox_narrow_url,
link_msg_id, link_msg_id,
link_text, link_text,
) { ) {
const $notification = $( const $notification = $(
render_message_sent_banner({ render_message_sent_banner({
note, banner_text,
link_class, classname,
above_composebox_narrow_url, above_composebox_narrow_url,
link_msg_id, link_msg_id,
link_text, link_text,
@@ -610,16 +610,16 @@ export function notify_local_mixes(messages, need_user_to_scroll) {
continue; continue;
} }
let reason = get_local_notify_mix_reason(message); let banner_text = get_local_notify_mix_reason(message);
const link_msg_id = message.id; const link_msg_id = message.id;
if (!reason) { if (!banner_text) {
if (need_user_to_scroll) { if (need_user_to_scroll) {
reason = $t({defaultMessage: "Sent!"}); banner_text = $t({defaultMessage: "Sent!"});
const link_text = $t({defaultMessage: "Scroll down to view your message."}); const link_text = $t({defaultMessage: "Scroll down to view your message."});
notify_above_composebox( notify_above_composebox(
reason, banner_text,
"compose_notification_scroll_to_message", "compose_notification_scroll_to_message",
// Don't display a URL on hover for the "Scroll to bottom" link. // Don't display a URL on hover for the "Scroll to bottom" link.
null, null,
@@ -635,15 +635,15 @@ export function notify_local_mixes(messages, need_user_to_scroll) {
} }
const above_composebox_narrow_url = get_above_composebox_narrow_url(message); const above_composebox_narrow_url = get_above_composebox_narrow_url(message);
const link_class = "compose_notification_narrow_by_topic"; const classname = "compose_notification_narrow_by_topic";
const link_text = $t( const link_text = $t(
{defaultMessage: "Narrow to {message_recipient}"}, {defaultMessage: "Narrow to {message_recipient}"},
{message_recipient: get_message_header(message)}, {message_recipient: get_message_header(message)},
); );
notify_above_composebox( notify_above_composebox(
reason, banner_text,
link_class, classname,
above_composebox_narrow_url, above_composebox_narrow_url,
link_msg_id, link_msg_id,
link_text, link_text,

View File

@@ -1,4 +1,4 @@
<div class="compose-notifications-content"> <div class="compose-notifications-content">
{{note}} {{#if link_class}}<a {{#if above_composebox_narrow_url}}href="{{above_composebox_narrow_url}}"{{/if}} class="{{link_class}}" data-message-id="{{link_msg_id}}">{{link_text}}</a>{{/if}} {{banner_text}} {{#if link_text}}<a {{#if above_composebox_narrow_url}}href="{{above_composebox_narrow_url}}"{{/if}} class="{{classname}}" data-message-id="{{link_msg_id}}">{{link_text}}</a>{{/if}}
<button type="button" class="out-of-view-notification-close close">&times;</button> <button type="button" class="out-of-view-notification-close close">&times;</button>
</div> </div>