mirror of
https://github.com/flarum/core.git
synced 2025-07-13 21:06:24 +02:00
Webpack (#1367)
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
This commit is contained in:
31
js/src/forum/components/TerminalPost.js
Normal file
31
js/src/forum/components/TerminalPost.js
Normal file
@ -0,0 +1,31 @@
|
||||
import Component from '../../common/Component';
|
||||
import humanTime from '../../common/helpers/humanTime';
|
||||
import icon from '../../common/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('fas fa-reply') : ''}{' '}
|
||||
{app.translator.trans('core.forum.discussion_list.' + (lastPost ? 'replied' : 'started') + '_text', {
|
||||
user,
|
||||
ago: humanTime(time)
|
||||
})}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user