Skip to content

Commit

Permalink
Adjust skillListHeight based on Notch
Browse files Browse the repository at this point in the history
- If it is ios it might not have a notch, so lets use
hasNotch
  • Loading branch information
rottabonus committed Nov 12, 2023
1 parent 0720be2 commit b390c4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Screens/Main/MentorSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { StackScreenProps } from '@react-navigation/stack';
import { StackRoutes } from '../..';

import useLayout from '../../../lib/use-layout';
import { isDevice } from '../../../lib/isDevice';
import { hasNotch } from '../../../lib/isDevice';

import TitledContainer from '../../components/TitledContainer';
import colors from '../../components/colors';
Expand Down Expand Up @@ -47,8 +47,8 @@ export default ({ navigation }: Props) => {
const [{ height }, onLayout] = useLayout();

// Make sure skill area has enough height even when keyboard is showing.
const padding = isDevice('ios') ? 50 : 0;
const some = 350 + padding;
const padding = hasNotch() ? 50 : 0;
const some = 380 + padding;
const min = 250;
const max = (height || some) - some;
const skillAreaHeight = max >= min ? max : min;
Expand Down

0 comments on commit b390c4f

Please sign in to comment.