mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-27 05:38:12 +00:00
Fix reaction skin tone picker
This commit is contained in:
@@ -373,7 +373,7 @@ export function CallScreen({
|
||||
target => {
|
||||
if (
|
||||
target instanceof Element &&
|
||||
target.closest('.FunPopover') != null
|
||||
target.closest('[data-fun-overlay]') != null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export function CustomizingPreferredReactionsModal({
|
||||
target => {
|
||||
if (
|
||||
target instanceof Element &&
|
||||
target.closest('.FunPopover') != null
|
||||
target.closest('[data-fun-overlay]') != null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export const ModalHost = React.memo(function ModalHostInner({
|
||||
if (
|
||||
modalContainer === document.body &&
|
||||
node instanceof Element &&
|
||||
node.closest('.module-calling__modal-container, .FunPopover')
|
||||
node.closest('.module-calling__modal-container, [data-fun-overlay]')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ export function TimelineMessage(props: Props): JSX.Element {
|
||||
target => {
|
||||
if (
|
||||
target instanceof Element &&
|
||||
target.closest('.FunPopover') != null
|
||||
target.closest('[data-fun-overlay]') != null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ export function FunSkinTonesList(props: FunSkinTonesListProps): JSX.Element {
|
||||
aria-label={i18n('icu:FunSkinTones__List')}
|
||||
className="FunSkinTones__ListBox"
|
||||
orientation="horizontal"
|
||||
selectedKeys={props.skinTone != null ? [props.skinTone] : []}
|
||||
selectedKeys={props.skinTone != null ? [props.skinTone] : undefined}
|
||||
selectionMode="single"
|
||||
disallowEmptySelection
|
||||
disallowEmptySelection={false}
|
||||
onSelectionChange={handleSelectionChange}
|
||||
>
|
||||
<FunSkinTonesListItem
|
||||
|
||||
@@ -161,6 +161,7 @@ export function FunGridHeaderPopover(
|
||||
): JSX.Element {
|
||||
return (
|
||||
<Popover
|
||||
data-fun-overlay
|
||||
className="FunGrid__HeaderPopover"
|
||||
placement="bottom end"
|
||||
offset={6}
|
||||
|
||||
@@ -16,6 +16,7 @@ export type FunPopoverProps = Readonly<{
|
||||
export function FunPopover(props: FunPopoverProps): JSX.Element {
|
||||
return (
|
||||
<Popover
|
||||
data-fun-overlay
|
||||
className={classNames('FunPopover', {
|
||||
'light-theme': props.theme === ThemeType.light,
|
||||
'dark-theme': props.theme === ThemeType.dark,
|
||||
|
||||
@@ -432,7 +432,6 @@ export function FunPanelEmojis({
|
||||
i18n={i18n}
|
||||
open={skinTonePopoverOpen}
|
||||
onOpenChange={handleSkinTonePopoverOpenChange}
|
||||
skinTone={fun.emojiSkinToneDefault}
|
||||
onSelectSkinTone={fun.onEmojiSkinToneDefaultChange}
|
||||
/>
|
||||
)}
|
||||
@@ -597,9 +596,13 @@ const Cell = memo(function Cell(props: CellProps): JSX.Element {
|
||||
|
||||
const handleSelectSkinTone = useCallback(
|
||||
(skinToneSelection: EmojiSkinTone) => {
|
||||
const variant = getEmojiVariantByParentKeyAndSkinTone(
|
||||
emojiParent.key,
|
||||
skinToneSelection
|
||||
);
|
||||
onEmojiSkinToneDefaultChange(skinToneSelection);
|
||||
onSelectEmoji({
|
||||
variantKey: emojiVariant.key,
|
||||
variantKey: variant.key,
|
||||
parentKey: emojiParent.key,
|
||||
englishShortName: emojiParent.englishShortNameDefault,
|
||||
skinTone: skinToneSelection,
|
||||
@@ -607,7 +610,6 @@ const Cell = memo(function Cell(props: CellProps): JSX.Element {
|
||||
},
|
||||
[
|
||||
onEmojiSkinToneDefaultChange,
|
||||
emojiVariant.key,
|
||||
emojiParent.key,
|
||||
emojiParent.englishShortNameDefault,
|
||||
onSelectEmoji,
|
||||
@@ -637,6 +639,7 @@ const Cell = memo(function Cell(props: CellProps): JSX.Element {
|
||||
</FunItemButton>
|
||||
{emojiHasSkinToneVariants && (
|
||||
<Popover
|
||||
data-fun-overlay
|
||||
isOpen={popoverOpen}
|
||||
onOpenChange={handlePopoverOpenChange}
|
||||
triggerRef={popoverTriggerRef}
|
||||
@@ -661,7 +664,7 @@ const Cell = memo(function Cell(props: CellProps): JSX.Element {
|
||||
<FunSkinTonesList
|
||||
i18n={i18n}
|
||||
emoji={emojiParent.key}
|
||||
skinTone={skinTone}
|
||||
skinTone={null}
|
||||
onSelectSkinTone={handleSelectSkinTone}
|
||||
/>
|
||||
</Dialog>
|
||||
@@ -675,7 +678,6 @@ type SectionSkinToneHeaderPopoverProps = Readonly<{
|
||||
i18n: LocalizerType;
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
skinTone: EmojiSkinTone | null;
|
||||
onSelectSkinTone: (emojiSkinTone: EmojiSkinTone) => void;
|
||||
}>;
|
||||
|
||||
@@ -706,7 +708,7 @@ function SectionSkinToneHeaderPopover(
|
||||
<FunSkinTonesList
|
||||
i18n={i18n}
|
||||
emoji={emojiParentKeyConstant('\u{270B}')}
|
||||
skinTone={props.skinTone}
|
||||
skinTone={null}
|
||||
onSelectSkinTone={handleSelectSkinTone}
|
||||
/>
|
||||
</FunGridHeaderPopover>
|
||||
|
||||
Reference in New Issue
Block a user