From 3a9e088bbda3cb31763b1beacecd586b133e87bb Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:05:56 +0200 Subject: [PATCH] Emoji Status: Fix styles (#4765) --- src/components/common/CustomEmojiPicker.tsx | 5 ++++- src/components/common/StickerButton.scss | 2 +- src/components/common/StickerSet.tsx | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/common/CustomEmojiPicker.tsx b/src/components/common/CustomEmojiPicker.tsx index 45757ede0..c168aeaa7 100644 --- a/src/components/common/CustomEmojiPicker.tsx +++ b/src/components/common/CustomEmojiPicker.tsx @@ -93,6 +93,7 @@ const HEADER_BUTTON_WIDTH = 2.5 * REM; // px (including margin) const DEFAULT_ID_PREFIX = 'custom-emoji-set'; const TOP_REACTIONS_COUNT = 16; const RECENT_REACTIONS_COUNT = 32; +const RECENT_DEFAULT_STATUS_COUNT = 7; const FADED_BUTTON_SET_IDS = new Set([RECENT_SYMBOL_SET_ID, FAVORITE_SYMBOL_SET_ID, POPULAR_SYMBOL_SET_ID]); const STICKER_SET_IDS_WITH_COVER = new Set([ RECENT_SYMBOL_SET_ID, @@ -222,7 +223,9 @@ const CustomEmojiPicker: FC = ({ } else if (isStatusPicker) { const defaultStatusIconsPack = stickerSetsById[defaultStatusIconsId!]; if (defaultStatusIconsPack?.stickers?.length) { - const stickers = (defaultStatusIconsPack.stickers || []).concat(recentCustomEmojis || []); + const stickers = defaultStatusIconsPack.stickers + .slice(0, RECENT_DEFAULT_STATUS_COUNT) + .concat(recentCustomEmojis || []); defaultSets.push({ ...defaultStatusIconsPack, stickers, diff --git a/src/components/common/StickerButton.scss b/src/components/common/StickerButton.scss index bcb630397..969510184 100644 --- a/src/components/common/StickerButton.scss +++ b/src/components/common/StickerButton.scss @@ -22,7 +22,7 @@ &.status-default { font-size: 2rem; - padding: 0.25rem; + padding: 0.125rem; color: var(--color-text); } } diff --git a/src/components/common/StickerSet.tsx b/src/components/common/StickerSet.tsx index ada88534a..47208545c 100644 --- a/src/components/common/StickerSet.tsx +++ b/src/components/common/StickerSet.tsx @@ -243,7 +243,7 @@ const StickerSet: FC = ({ const [isCut, , expand] = useFlag(canCut); const itemsBeforeCutout = itemsPerRow * 3 - 1; - const totalItemsCount = withDefaultTopicIcon ? stickerSet.count + 1 : stickerSet.count; + const totalItemsCount = (withDefaultTopicIcon || withDefaultStatusIcon) ? stickerSet.count + 1 : stickerSet.count; const itemHeight = itemSize + verticalMargin; const heightWhenCut = Math.ceil(Math.min(itemsBeforeCutout, totalItemsCount) / itemsPerRow)