-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29947 from software-mansion-labs/ts-migration/Saf…
…eArea [TS migration] Migrate 'SafeArea' component to TypeScript
- Loading branch information
Showing
4 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
10 changes: 3 additions & 7 deletions
10
src/components/SafeArea/index.ios.js → src/components/SafeArea/index.ios.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {SafeAreaView} from 'react-native-safe-area-context'; | ||
import styles from '@styles/styles'; | ||
import SafeAreaProps from './types'; | ||
|
||
function SafeArea(props) { | ||
function SafeArea({children}: SafeAreaProps) { | ||
return ( | ||
<SafeAreaView | ||
style={[styles.iPhoneXSafeArea]} | ||
edges={['left', 'right']} | ||
> | ||
{props.children} | ||
{children} | ||
</SafeAreaView> | ||
); | ||
} | ||
|
||
SafeArea.propTypes = { | ||
/** App content */ | ||
children: PropTypes.node.isRequired, | ||
}; | ||
SafeArea.displayName = 'SafeArea'; | ||
|
||
export default SafeArea; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SafeAreaProps from './types'; | ||
|
||
export default ({children}: SafeAreaProps) => children; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import ChildrenProps from '@src/types/utils/ChildrenProps'; | ||
|
||
type SafeAreaProps = ChildrenProps; | ||
|
||
export default SafeAreaProps; |