PLT-6900: Hide DotMenu container when DotMenu empty. (#6770)

Этот коммит содержится в:
George Goldberg
2017-06-28 06:44:02 +01:00
коммит произвёл Saturnino Abril
родитель 155c6600aa
Коммит 99fc4b0988
2 изменённых файлов: 21 добавлений и 1 удалений

Просмотреть файл

@@ -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;
}