Skip to content

Commit

Permalink
[1.x] [extensibility] refactor(core): allow labels of `PostStreamScru…
Browse files Browse the repository at this point in the history
…bber` to be customized (#4049)

* refactor(core): allow labels to be customized

* chore: change type annotation

* chore: remove type annotations

Importing `NestedStringArray` did cause issues in the CI
  • Loading branch information
DavideIadeluca authored Oct 2, 2024
1 parent 359681f commit 12d21cd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions framework/core/js/src/forum/components/PostStreamScrubber.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class PostStreamScrubber extends Component {
<div className="Dropdown-menu dropdown-menu">
<div className="Scrubber">
<a className="Scrubber-first" onclick={this.goToFirst.bind(this)}>
{icon('fas fa-angle-double-up')} {app.translator.trans('core.forum.post_scrubber.original_post_link')}
{icon('fas fa-angle-double-up')} {this.firstPostLabel()}
</a>

<div className="Scrubber-scrollbar">
Expand All @@ -79,19 +79,31 @@ export default class PostStreamScrubber extends Component {
<div className="Scrubber-after" />

<div className="Scrubber-unread" oncreate={styleUnread} onupdate={styleUnread}>
{app.translator.trans('core.forum.post_scrubber.unread_text', { count: unreadCount })}
{this.unreadLabel(unreadCount)}
</div>
</div>

<a className="Scrubber-last" onclick={this.goToLast.bind(this)}>
{icon('fas fa-angle-double-down')} {app.translator.trans('core.forum.post_scrubber.now_link')}
{icon('fas fa-angle-double-down')} {this.lastPostLabel()}
</a>
</div>
</div>
</div>
);
}

firstPostLabel() {
return app.translator.trans('core.forum.post_scrubber.original_post_link');
}

unreadLabel(unreadCount) {
return app.translator.trans('core.forum.post_scrubber.unread_text', { count: unreadCount });
}

lastPostLabel() {
return app.translator.trans('core.forum.post_scrubber.now_link');
}

onupdate(vnode) {
super.onupdate(vnode);

Expand Down

0 comments on commit 12d21cd

Please sign in to comment.