Skip to content

Commit

Permalink
cleanup function and update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
suneox committed Mar 26, 2024
1 parent 5f3f51c commit 1f8265c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const useEmojiPickerMenu = () => {
const [preferredSkinTone] = usePreferredEmojiSkinTone();
const {windowHeight} = useWindowDimensions();
const StyleUtils = useStyleUtils();
// calculate the height of the emoji picker based popoverInnerContainer style has maxHeight is 95%
/**
* At EmojiPicker has set innerContainerStyle with maxHeight: '95%' by styles.popoverInnerContainer
* to avoid the list style to be cut off due to the list height being larger than the container height
* so we need to calculate listStyle based on the height of the window and innerContainerStyle at the EmojiPicker
*/
const listStyle = StyleUtils.getEmojiPickerListHeight(isListFiltered, windowHeight * 0.95);

useEffect(() => {
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/useViewportOffsetTop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ export default function useViewportOffsetTop(shouldAdjustScrollView = false): nu
}
};
updateOffsetTop();
const removeViewportResizeListener = addViewportResizeListener(updateOffsetTop);

return () => {
removeViewportResizeListener();
};
return addViewportResizeListener(updateOffsetTop);
}, [initialHeight, shouldAdjustScrollView]);

useEffect(() => {
Expand Down

0 comments on commit 1f8265c

Please sign in to comment.