Skip to content

Commit f404e5b

Browse files
committed
update(review): applied withoutOverlay to edge cases
1 parent 68cc446 commit f404e5b

6 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/components/EmojiPicker/EmojiPicker.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef<Em
3636
vertical: 0,
3737
});
3838
const [emojiPopoverAnchorOrigin, setEmojiPopoverAnchorOrigin] = useState<AnchorOrigin>(DEFAULT_ANCHOR_ORIGIN);
39+
const [isWithoutOverlay, setIsWithoutOverlay] = useState(true);
3940
const [activeID, setActiveID] = useState<string | null>();
4041
const emojiPopoverAnchorRef = useRef<EmojiPopoverAnchor | null>(null);
4142
const emojiAnchorDimension = useRef({
@@ -78,10 +79,12 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef<Em
7879
onWillShow?: OnWillShowPicker,
7980
id?: string,
8081
activeEmojiValue?: string,
82+
withoutOverlay = true,
8183
) => {
8284
onModalHide.current = onModalHideValue;
8385
onEmojiSelected.current = onEmojiSelectedValue;
8486
activeEmoji.current = activeEmojiValue;
87+
setIsWithoutOverlay(withoutOverlay);
8588
emojiPopoverAnchorRef.current = emojiPopoverAnchorValue;
8689
const emojiPopoverAnchor = getEmojiPopoverAnchor();
8790
// Drop focus to avoid blue focus ring.
@@ -203,7 +206,7 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef<Em
203206
horizontal: emojiPopoverAnchorPosition.horizontal,
204207
}}
205208
anchorRef={getEmojiPopoverAnchor() as RefObject<View | HTMLDivElement>}
206-
withoutOverlay
209+
withoutOverlay={isWithoutOverlay}
207210
popoverDimensions={{
208211
width: CONST.EMOJI_PICKER_SIZE.WIDTH,
209212
height: CONST.EMOJI_PICKER_SIZE.HEIGHT,

src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ type EmojiPickerButtonDropdownProps = {
2525
value?: string;
2626
disabled?: boolean;
2727
style: StyleProp<ViewStyle>;
28+
withoutOverlay?: boolean;
2829
};
2930

3031
function EmojiPickerButtonDropdown(
3132
// eslint-disable-next-line @typescript-eslint/no-unused-vars
32-
{isDisabled = false, onModalHide, onInputChange, value, disabled, style, ...otherProps}: EmojiPickerButtonDropdownProps,
33+
{isDisabled = false, withoutOverlay = false, onModalHide, onInputChange, value, disabled, style, ...otherProps}: EmojiPickerButtonDropdownProps,
3334
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3435
ref: ForwardedRef<AnimatedTextInputRef>,
3536
) {
@@ -57,6 +58,7 @@ function EmojiPickerButtonDropdown(
5758
() => {},
5859
undefined,
5960
value,
61+
withoutOverlay,
6062
);
6163
};
6264

src/components/LHNOptionsList/OptionRowLHN.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ function OptionRowLHN({
168168
callbacks: {
169169
onHide: () => setIsContextMenuActive(false),
170170
},
171+
withoutOverlay: false,
171172
});
172173
};
173174

src/libs/actions/EmojiPickerAction.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type EmojiPickerRef = {
2727
onWillShow?: OnWillShowPicker,
2828
id?: string,
2929
activeEmoji?: string,
30+
withoutOverlay?: boolean,
3031
) => void;
3132
isActive: (id: string) => boolean;
3233
clearActive: () => void;
@@ -57,12 +58,13 @@ function showEmojiPicker(
5758
onWillShow: OnWillShowPicker = () => {},
5859
id?: string,
5960
activeEmoji?: string,
61+
withoutOverlay?: boolean,
6062
) {
6163
if (!emojiPickerRef.current) {
6264
return;
6365
}
6466

65-
emojiPickerRef.current.showEmojiPicker(onModalHide, onEmojiSelected, emojiPopoverAnchor, anchorOrigin, onWillShow, id, activeEmoji);
67+
emojiPickerRef.current.showEmojiPicker(onModalHide, onEmojiSelected, emojiPopoverAnchor, anchorOrigin, onWillShow, id, activeEmoji, withoutOverlay);
6668
}
6769

6870
/**

src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
6868
const [isThreadReportParentAction, setIsThreadReportParentAction] = useState(false);
6969
const [disabledActions, setDisabledActions] = useState<ContextMenuAction[]>([]);
7070
const [shouldSwitchPositionIfOverflow, setShouldSwitchPositionIfOverflow] = useState(false);
71+
const [isWithoutOverlay, setIsWithoutOverlay] = useState<boolean>(true);
7172

7273
const contentRef = useRef<View>(null);
7374
const anchorRef = useRef<View | HTMLDivElement | null>(null);
@@ -170,11 +171,13 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
170171
disabledOptions = [],
171172
shouldCloseOnTarget = false,
172173
isOverflowMenu = false,
174+
withoutOverlay = true,
173175
} = showContextMenuParams;
174176
const {reportID, originalReportID, isArchivedRoom = false, isChronos = false, isPinnedChat = false, isUnreadChat = false} = report;
175177
const {reportActionID, draftMessage, isThreadReportParentAction: isThreadReportParentActionParam = false} = reportAction;
176178
const {onShow = () => {}, onHide = () => {}, setIsEmojiPickerActive = () => {}} = callbacks;
177179
setIsContextMenuOpening(true);
180+
setIsWithoutOverlay(withoutOverlay);
178181
const {pageX = 0, pageY = 0} = extractPointerEvent(event);
179182
contextMenuAnchorRef.current = contextMenuAnchor;
180183
contextMenuTargetNode.current = event.target as HTMLDivElement;
@@ -343,7 +346,7 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
343346
disableAnimation={false}
344347
shouldSetModalVisibility={false}
345348
fullscreen
346-
withoutOverlay
349+
withoutOverlay={isWithoutOverlay}
347350
anchorDimensions={contextMenuDimensions.current}
348351
anchorRef={anchorRef}
349352
shouldSwitchPositionIfOverflow={shouldSwitchPositionIfOverflow}

src/pages/home/report/ContextMenu/ReportActionContextMenu.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type ShowContextMenuParams = {
4444
disabledOptions?: ContextMenuAction[];
4545
shouldCloseOnTarget?: boolean;
4646
isOverflowMenu?: boolean;
47+
withoutOverlay?: boolean;
4748
};
4849

4950
type ShowContextMenu = (params: ShowContextMenuParams) => void;

0 commit comments

Comments
 (0)