1
0
mirror of https://github.com/flarum/core.git synced 2025-10-15 00:44:40 +02:00
Files
php-flarum/js/forum/src/components/DiscussionRenamedPost.js
Toby Zerner 53c621d999 Update event post API
- Use more appropriate component class name
- Allow username to be moved in translation
2015-07-20 18:12:08 +09:30

31 lines
730 B
JavaScript

import EventPost from 'flarum/components/EventPost';
/**
* The `DiscussionRenamedPost` component displays a discussion event post
* indicating that the discussion has been renamed.
*
* ### Props
*
* - All of the props for EventPost
*/
export default class DiscussionRenamedPost extends EventPost {
icon() {
return 'pencil';
}
descriptionKey() {
return 'core.discussion_renamed_post';
}
descriptionData() {
const post = this.props.post;
const oldTitle = post.content()[0];
const newTitle = post.content()[1];
return {
old: <strong className="DiscussionRenamedPost-old">{oldTitle}</strong>,
new: <strong className="DiscussionRenamedPost-new">{newTitle}</strong>
};
}
}