diff options
author | George Goldberg <george@gberg.me> | 2017-06-28 06:44:02 +0100 |
---|---|---|
committer | Saturnino Abril <saturnino.abril@gmail.com> | 2017-06-28 13:44:02 +0800 |
commit | 99fc4b0988e941242732feff428468c6df69fe50 (patch) | |
tree | a0826c8e0b7a2aa6348628da479537c162a6d492 /webapp | |
parent | 155c6600aa2f7e9e23aa4117326fbbd5fd441da3 (diff) | |
download | chat-99fc4b0988e941242732feff428468c6df69fe50.tar.gz chat-99fc4b0988e941242732feff428468c6df69fe50.tar.bz2 chat-99fc4b0988e941242732feff428468c6df69fe50.zip |
PLT-6900: Hide DotMenu container when DotMenu empty. (#6770)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/post_view/post_info/post_info.jsx | 2 | ||||
-rw-r--r-- | webapp/utils/post_utils.jsx | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/webapp/components/post_view/post_info/post_info.jsx b/webapp/components/post_view/post_info/post_info.jsx index f037bf03b..c07a58bc7 100644 --- a/webapp/components/post_view/post_info/post_info.jsx +++ b/webapp/components/post_view/post_info/post_info.jsx @@ -192,7 +192,7 @@ export default class PostInfo extends React.PureComponent { /> ); - if (dotMenu) { + if (PostUtils.shouldShowDotMenu(this.props.post)) { options = ( <div ref='dotMenu' diff --git a/webapp/utils/post_utils.jsx b/webapp/utils/post_utils.jsx index 991c8fbec..a71aeef31 100644 --- a/webapp/utils/post_utils.jsx +++ b/webapp/utils/post_utils.jsx @@ -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; +} |