Skip to content

Commit

Permalink
fix extra padding below emoji skin ton selection when keyboard is up
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhutornyi committed Jan 8, 2024
1 parent cd60aae commit c96835f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {forwardRef, useCallback, useEffect, useMemo, useRef} from 'react'
import {View} from 'react-native';
import ReactNativeModal from 'react-native-modal';
import ColorSchemeWrapper from '@components/ColorSchemeWrapper';
import useKeyboardState from '@hooks/useKeyboardState';
import usePrevious from '@hooks/usePrevious';
import useSafeAreaInsets from '@hooks/useSafeAreaInsets';
import useStyleUtils from '@hooks/useStyleUtils';
Expand Down Expand Up @@ -45,6 +46,7 @@ function BaseModal(
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {windowWidth, windowHeight, isSmallScreenWidth} = useWindowDimensions();
const keyboardStateContextValue = useKeyboardState();

const safeAreaInsets = useSafeAreaInsets();

Expand Down Expand Up @@ -161,7 +163,7 @@ function BaseModal(
safeAreaPaddingRight,
shouldAddBottomSafeAreaMargin,
shouldAddTopSafeAreaMargin,
shouldAddBottomSafeAreaPadding,
shouldAddBottomSafeAreaPadding: !keyboardStateContextValue?.isKeyboardShown && shouldAddBottomSafeAreaPadding,
shouldAddTopSafeAreaPadding,
modalContainerStyleMarginTop: modalContainerStyle.marginTop,
modalContainerStyleMarginBottom: modalContainerStyle.marginBottom,
Expand Down

0 comments on commit c96835f

Please sign in to comment.