Skip to content

Commit d3d73ac

Browse files
committed
chore: message at the page
1 parent f4542f3 commit d3d73ac

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

extensions/messages/js/src/forum/components/DialogSection.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ export default class DialogSection<CustomAttrs extends IDialogStreamAttrs = IDia
4242
<div className="DialogSection-header">
4343
<Avatar user={recipient} />
4444
<div className="DialogSection-header-info">
45-
{(recipient && (
46-
<Link href={app.route.user(recipient!)}>
47-
<h2>{username(recipient)}</h2>
48-
</Link>
49-
)) || <h2>{username(recipient)}</h2>}
45+
<h2 className="DialogSection-header-info-title">
46+
{(recipient && <Link href={app.route.user(recipient!)}>{username(recipient)}</Link>) || username(recipient)}
47+
{recipient && recipient.canSendAnyMessage() ? null : (
48+
<span className="DialogSection-header-info-helperText">
49+
{app.translator.trans('flarum-messages.forum.dialog_section.cannot_reply_text')}
50+
</span>
51+
)}
52+
</h2>
5053
<div className="badges">{listItems(recipient?.badges().toArray() || [])}</div>
5154
</div>
5255
<div className="DialogSection-header-actions">{this.actionItems().toArray()}</div>

extensions/messages/less/forum.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@
232232
gap: 6px;
233233
}
234234

235+
.DialogSection-header-info-title {
236+
display: flex;
237+
flex-direction: column;
238+
}
239+
240+
.DialogSection-header-info-helperText {
241+
font-size: 0.8rem;
242+
font-weight: normal;
243+
color: var(--control-color);
244+
}
245+
235246
.DialogSection-back {
236247
display: flex;
237248

extensions/messages/locale/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ flarum-messages:
2222

2323
dialog_section:
2424
back_label: Go back
25+
cannot_reply_text: This user cannot reply
2526
controls:
2627
details_button: Details
2728
controls_toggle_label: Dialog control actions

0 commit comments

Comments
 (0)