Skip to content

Commit

Permalink
wraps iOS modals in SafeAreaView
Browse files Browse the repository at this point in the history
  • Loading branch information
rdjuric committed Jun 21, 2021
1 parent 5e00c66 commit 7d531d6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/components/Modal/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import React from 'react';
import {SafeAreaView} from 'react-native';
import withWindowDimensions from '../withWindowDimensions';
import BaseModal from './BaseModal';
import {propTypes, defaultProps} from './ModalPropTypes';

// Only wan to use <SafeAreaView> on iOS. Avoids ScrollBar in the middle of the modal.
// https://github.com/facebook/react-native/issues/26610
const Modal = props => (
<BaseModal
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{props.children}
</BaseModal>
<SafeAreaView>
<BaseModal
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{props.children}
</BaseModal>
</SafeAreaView>

);

Modal.propTypes = propTypes;
Expand Down

0 comments on commit 7d531d6

Please sign in to comment.