mirror of
https://github.com/flarum/core.git
synced 2025-10-11 06:54:26 +02:00
- Changes all `app.trans` calls to `app.translator.trans` calls. - Changes existing keys to [three-tier namespace structure](https://github.com/flarum/english/pull/12). - Extracts additional strings for `lib:` namespace. - Extracts two previously missed strings for EditGroupModal.js.
32 lines
853 B
JavaScript
32 lines
853 B
JavaScript
import Component from 'flarum/Component';
|
|
import humanTime from 'flarum/helpers/humanTime';
|
|
import icon from 'flarum/helpers/icon';
|
|
|
|
/**
|
|
* Displays information about a the first or last post in a discussion.
|
|
*
|
|
* ### Props
|
|
*
|
|
* - `discussion`
|
|
* - `lastPost`
|
|
*/
|
|
export default class TerminalPost extends Component {
|
|
view() {
|
|
const discussion = this.props.discussion;
|
|
const lastPost = this.props.lastPost && discussion.repliesCount();
|
|
|
|
const user = discussion[lastPost ? 'lastUser' : 'startUser']();
|
|
const time = discussion[lastPost ? 'lastTime' : 'startTime']();
|
|
|
|
return (
|
|
<span>
|
|
{lastPost ? icon('reply') : ''}{' '}
|
|
{app.translator.trans('core.forum.discussion_list.' + (lastPost ? 'replied' : 'started') + '_text', {
|
|
user,
|
|
ago: humanTime(time)
|
|
})}
|
|
</span>
|
|
);
|
|
}
|
|
}
|