FIX: chat navbar followups (#24953)

- displays title on threads screen on one line instead of two on mobile

- ensures chat is not overflowing the screen width
This commit is contained in:
Joffrey JAFFEUX 2023-12-18 21:39:36 +01:00 committed by GitHub
parent 2ed59266a9
commit 608ce620fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,6 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { inject as service } from "@ember/service"; import { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import replaceEmoji from "discourse/helpers/replace-emoji"; import replaceEmoji from "discourse/helpers/replace-emoji";
import i18n from "discourse-common/helpers/i18n"; import i18n from "discourse-common/helpers/i18n";
import I18n from "discourse-i18n"; import I18n from "discourse-i18n";
@ -11,6 +12,16 @@ export default class ChatThreadListHeader extends Component {
threadListTitle = I18n.t("chat.threads.list"); threadListTitle = I18n.t("chat.threads.list");
get title() {
let title = replaceEmoji(this.threadListTitle);
if (this.site.mobileView) {
title += " - " + replaceEmoji(this.args.channel.title);
}
return htmlSafe(title);
}
<template> <template>
<Navbar as |navbar|> <Navbar as |navbar|>
<navbar.BackButton <navbar.BackButton
@ -19,15 +30,7 @@ export default class ChatThreadListHeader extends Component {
@title={{i18n "chat.return_to_channel"}} @title={{i18n "chat.return_to_channel"}}
/> />
<navbar.Title <navbar.Title @title={{this.title}} @icon="discourse-threads" />
@title={{replaceEmoji this.threadListTitle}}
@icon="discourse-threads"
as |title|
>
{{#if this.site.mobileView}}
<title.SubTitle @title={{replaceEmoji @channel.title}} />
{{/if}}
</navbar.Title>
<navbar.Actions as |action|> <navbar.Actions as |action|>
<action.CloseThreadsButton @channel={{@channel}} /> <action.CloseThreadsButton @channel={{@channel}} />

View File

@ -271,6 +271,7 @@ html.has-full-page-chat {
.main-chat-outlet { .main-chat-outlet {
min-height: 0; min-height: 0;
max-width: 100vw;
} }
} }
} }