PLT-6900: Hide DotMenu container when DotMenu empty. (#6770)
Этот коммит содержится в:
коммит произвёл
Saturnino Abril
родитель
155c6600aa
Коммит
99fc4b0988
@@ -192,7 +192,7 @@ export default class PostInfo extends React.PureComponent {
|
||||
/>
|
||||
);
|
||||
|
||||
if (dotMenu) {
|
||||
if (PostUtils.shouldShowDotMenu(this.props.post)) {
|
||||
options = (
|
||||
<div
|
||||
ref='dotMenu'
|
||||
|
||||
@@ -82,3 +82,23 @@ export function canEditPost(post, editDisableAction) {
|
||||
}
|
||||
return canEdit;
|
||||
}
|
||||
|
||||
export function shouldShowDotMenu(post) {
|
||||
if (Utils.isMobile()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isSystemMessage(post)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (canDeletePost(post)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (canEditPost(post)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user