MM-39161 : Show more recently used reactions in the RHS hover menu (#23937)

This commit is contained in:
TheRealJoeFriel 2023-08-31 22:46:26 -05:00 committed by GitHub
parent a2adc0e33e
commit 831a7db73d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import {FormattedMessage} from 'react-intl';
import {Posts} from 'mattermost-redux/constants/index';
import {isPostEphemeral} from 'mattermost-redux/utils/post_utils';
import {Locations} from 'utils/constants';
import {Locations, Constants} from 'utils/constants';
import {isSystemMessage, fromAutoResponder} from 'utils/post_utils';
import ActionsMenu from 'components/actions_menu';
import DotMenu from 'components/dot_menu';
@ -129,13 +129,17 @@ const PostOptions = (props: Props): JSX.Element => {
let showRecentReactions: ReactNode;
if (showRecentlyUsedReactions) {
const showMoreReactions = props.isExpanded ||
props.location === 'CENTER' ||
(document.getElementById('sidebar-right')?.getBoundingClientRect().width ?? 0) > Constants.SIDEBAR_MINIMUM_WIDTH;
showRecentReactions = (
<PostRecentReactions
channelId={post.channel_id}
postId={post.id}
teamId={props.teamId}
emojis={props.recentEmojis}
size={props.isExpanded || props.location === 'CENTER' ? 3 : 1}
size={showMoreReactions ? 3 : 1}
/>
);
}

View File

@ -1581,6 +1581,7 @@ export const Constants = {
DEFAULT_EMOJI_PICKER_LEFT_OFFSET: 87,
DEFAULT_EMOJI_PICKER_RIGHT_OFFSET: 15,
EMOJI_PICKER_WIDTH_OFFSET: 295,
SIDEBAR_MINIMUM_WIDTH: 400,
THEME_ELEMENTS: [
{
group: 'sidebarElements',