kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Remove custom emojis from reaction picker
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>environments/review-update-emo-25jnc5/deployments/2714
rodzic
d6732955de
commit
277045c7a1
|
@ -69,7 +69,7 @@ const EmojiSelector: React.FC<IEmojiSelector> = ({
|
||||||
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);
|
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);
|
||||||
|
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
if ([referenceElement, popperElement].some(el => el?.contains(event.target as Node))) {
|
if ([referenceElement, popperElement, document.querySelector('em-emoji-picker')].some(el => el?.contains(event.target as Node))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,7 @@ const EmojiSelector: React.FC<IEmojiSelector> = ({
|
||||||
visible={expanded}
|
visible={expanded}
|
||||||
setVisible={setExpanded}
|
setVisible={setExpanded}
|
||||||
update={update}
|
update={update}
|
||||||
|
withCustom={false}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<HStack
|
<HStack
|
||||||
|
|
|
@ -46,6 +46,7 @@ export const messages = defineMessages({
|
||||||
export interface IEmojiPickerDropdown {
|
export interface IEmojiPickerDropdown {
|
||||||
onPickEmoji?: (emoji: Emoji) => void
|
onPickEmoji?: (emoji: Emoji) => void
|
||||||
condensed?: boolean
|
condensed?: boolean
|
||||||
|
withCustom?: boolean
|
||||||
visible: boolean
|
visible: boolean
|
||||||
setVisible: (value: boolean) => void
|
setVisible: (value: boolean) => void
|
||||||
update: (() => Promise<Partial<PopperState>>) | null
|
update: (() => Promise<Partial<PopperState>>) | null
|
||||||
|
@ -126,7 +127,7 @@ const RenderAfter = ({ children, update }: any) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({
|
const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({
|
||||||
onPickEmoji, condensed, visible, setVisible, update,
|
onPickEmoji, visible, setVisible, update, withCustom = true,
|
||||||
}) => {
|
}) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -235,7 +236,7 @@ const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({
|
||||||
<RenderAfter update={update}>
|
<RenderAfter update={update}>
|
||||||
{!loading && (
|
{!loading && (
|
||||||
<EmojiPicker
|
<EmojiPicker
|
||||||
custom={[{ emojis: buildCustomEmojis(customEmojis) }]}
|
custom={withCustom ? [{ emojis: buildCustomEmojis(customEmojis) }] : undefined}
|
||||||
title={title}
|
title={title}
|
||||||
onEmojiSelect={handlePick}
|
onEmojiSelect={handlePick}
|
||||||
recent={frequentlyUsedEmojis}
|
recent={frequentlyUsedEmojis}
|
||||||
|
|
|
@ -17,7 +17,7 @@ export const messages = defineMessages({
|
||||||
});
|
});
|
||||||
|
|
||||||
const EmojiPickerDropdownContainer = (
|
const EmojiPickerDropdownContainer = (
|
||||||
props: Pick<IEmojiPickerDropdown, 'onPickEmoji' | 'condensed'>,
|
props: Pick<IEmojiPickerDropdown, 'onPickEmoji' | 'condensed' | 'withCustom'>,
|
||||||
) => {
|
) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const title = intl.formatMessage(messages.emoji);
|
const title = intl.formatMessage(messages.emoji);
|
||||||
|
|
|
@ -804,7 +804,6 @@
|
||||||
"home.column_settings.show_replies": "Show replies",
|
"home.column_settings.show_replies": "Show replies",
|
||||||
"icon_button.icons": "Icons",
|
"icon_button.icons": "Icons",
|
||||||
"icon_button.label": "Select icon",
|
"icon_button.label": "Select icon",
|
||||||
"icon_button.not_found": "No icons!! (╯°□°)╯︵ ┻━┻",
|
|
||||||
"import_data.actions.import": "Import",
|
"import_data.actions.import": "Import",
|
||||||
"import_data.actions.import_blocks": "Import blocks",
|
"import_data.actions.import_blocks": "Import blocks",
|
||||||
"import_data.actions.import_follows": "Import follows",
|
"import_data.actions.import_follows": "Import follows",
|
||||||
|
|
Ładowanie…
Reference in New Issue