Minor UI improvements (#3904)
* PLT-3917 - Adding cross icon to remove deleted post in the RHS. * PLT-3997 - Improving the integration confirmation screen
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
f6c183e749
Коммит
85f8b90aeb
@@ -30,6 +30,7 @@ export default class RhsComment extends React.Component {
|
||||
super(props);
|
||||
|
||||
this.handlePermalink = this.handlePermalink.bind(this);
|
||||
this.removePost = this.removePost.bind(this);
|
||||
this.flagPost = this.flagPost.bind(this);
|
||||
this.unflagPost = this.unflagPost.bind(this);
|
||||
|
||||
@@ -41,6 +42,23 @@ export default class RhsComment extends React.Component {
|
||||
GlobalActions.showGetPostLinkModal(this.props.post);
|
||||
}
|
||||
|
||||
removePost() {
|
||||
GlobalActions.emitRemovePost(this.props.post);
|
||||
}
|
||||
|
||||
createRemovePostButton() {
|
||||
return (
|
||||
<a
|
||||
href='#'
|
||||
className='post__remove theme'
|
||||
type='button'
|
||||
onClick={this.removePost}
|
||||
>
|
||||
{'×'}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
if (nextProps.status !== this.props.status) {
|
||||
return true;
|
||||
@@ -344,6 +362,21 @@ export default class RhsComment extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
let options;
|
||||
if (Utils.isPostEphemeral(post)) {
|
||||
options = (
|
||||
<li className='col col__remove'>
|
||||
{this.createRemovePostButton()}
|
||||
</li>
|
||||
);
|
||||
} else {
|
||||
options = (
|
||||
<li className='col col__reply'>
|
||||
{dropdown}
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={'post post--thread ' + currentUserCss + ' ' + compactClass}>
|
||||
<div className='post__content'>
|
||||
@@ -368,9 +401,7 @@ export default class RhsComment extends React.Component {
|
||||
</time>
|
||||
{flagTrigger}
|
||||
</li>
|
||||
<li className='col col__reply'>
|
||||
{dropdown}
|
||||
</li>
|
||||
{options}
|
||||
</ul>
|
||||
<div className='post__body'>
|
||||
<div className={postClass}>
|
||||
|
||||
Ссылка в новой задаче
Block a user