1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 12:40:40 +02:00
Files
php-flarum/js/forum/src/components/DiscussionRenamedPost.js
dcsjapan d5d7185794 Primary key renaming
Improved consistency for existing core translation key names.

See flarum/core#265
- Completely overhauled core en.yml
- Replaced existing key names in all core JS files to match
- Extracted a hardcoded string in IndexPage.js
- Combined two app.trans calls in DiscussionControls.js
- Removed hardcoded spaces from LogInModal.js and SignUpModal.js
- Added two new keys from DiscussionControls.js (soft delete)
- Created two new “reused keys” to YML to accommodate same
2015-09-23 14:58:33 +09:00

31 lines
746 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.post_stream_discussion_renamed_text';
}
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>
};
}
}