kopia lustrzana https://github.com/cheeaun/phanpy
Remember custom emoji zoom
rodzic
c2bd325b26
commit
a6cfd32136
|
@ -107,6 +107,8 @@ const CustomEmojisList = memo(({ emojis, onSelect }) => {
|
|||
);
|
||||
});
|
||||
|
||||
const CUSTOM_EMOJI_SIZE = 'composer-customEmojiSize';
|
||||
|
||||
function CustomEmojisModal({
|
||||
masto,
|
||||
instance,
|
||||
|
@ -165,15 +167,27 @@ function CustomEmojisModal({
|
|||
|
||||
const scrollableRef = useRef();
|
||||
const [matches, setMatches] = useState(null);
|
||||
const [emojiSize, setEmojiSize] = useState(EMOJI_SIZE_MIN);
|
||||
const [emojiSize, setEmojiSize] = useState(
|
||||
store.local.get(CUSTOM_EMOJI_SIZE) || EMOJI_SIZE_MIN,
|
||||
);
|
||||
const onEmojiSizeDecrease = useCallback(() => {
|
||||
const newSize = Math.max(EMOJI_SIZE_MIN, emojiSize - EMOJI_SIZE_STEP);
|
||||
setEmojiSize(newSize);
|
||||
if (newSize === EMOJI_SIZE_MIN) {
|
||||
store.local.del(CUSTOM_EMOJI_SIZE);
|
||||
} else {
|
||||
store.local.set(CUSTOM_EMOJI_SIZE, newSize);
|
||||
}
|
||||
}, [emojiSize]);
|
||||
|
||||
const onEmojiSizeIncrease = useCallback(() => {
|
||||
const newSize = Math.min(EMOJI_SIZE_MAX, emojiSize + EMOJI_SIZE_STEP);
|
||||
setEmojiSize(newSize);
|
||||
if (newSize === EMOJI_SIZE_MIN) {
|
||||
store.local.del(CUSTOM_EMOJI_SIZE);
|
||||
} else {
|
||||
store.local.set(CUSTOM_EMOJI_SIZE, newSize);
|
||||
}
|
||||
}, [emojiSize]);
|
||||
|
||||
const onFind = useCallback(
|
||||
|
|
|
@ -265,7 +265,7 @@ msgstr "View post stats"
|
|||
#: src/components/account-sheet.jsx:38
|
||||
#: src/components/add-remove-lists-sheet.jsx:45
|
||||
#: src/components/compose.jsx:993
|
||||
#: src/components/custom-emojis-modal.jsx:256
|
||||
#: src/components/custom-emojis-modal.jsx:270
|
||||
#: src/components/drafts.jsx:57
|
||||
#: src/components/edit-profile-sheet.jsx:87
|
||||
#: src/components/embed-modal.jsx:13
|
||||
|
@ -626,31 +626,31 @@ msgstr "Failed to download GIF"
|
|||
msgid "{0} more…"
|
||||
msgstr ""
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:262
|
||||
#: src/components/custom-emojis-modal.jsx:276
|
||||
msgid "Custom emojis"
|
||||
msgstr ""
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:282
|
||||
#: src/components/custom-emojis-modal.jsx:296
|
||||
msgid "Search emoji"
|
||||
msgstr "Search emoji"
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:313
|
||||
#: src/components/custom-emojis-modal.jsx:327
|
||||
msgid "Error loading custom emojis"
|
||||
msgstr ""
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:324
|
||||
#: src/components/custom-emojis-modal.jsx:338
|
||||
msgid "Recently used"
|
||||
msgstr "Recently used"
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:325
|
||||
#: src/components/custom-emojis-modal.jsx:339
|
||||
msgid "Others"
|
||||
msgstr "Others"
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:344
|
||||
#: src/components/custom-emojis-modal.jsx:358
|
||||
msgid "Zoom out"
|
||||
msgstr "Zoom out"
|
||||
|
||||
#: src/components/custom-emojis-modal.jsx:352
|
||||
#: src/components/custom-emojis-modal.jsx:366
|
||||
msgid "Zoom in"
|
||||
msgstr "Zoom in"
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue