diff --git a/src/components/common/Screen.tsx b/src/components/common/Screen.tsx index 69114888..20f66055 100644 --- a/src/components/common/Screen.tsx +++ b/src/components/common/Screen.tsx @@ -3,7 +3,6 @@ import { StyleSheet, View, ViewStyle } from 'react-native' import SplashScreen from 'react-native-splash-screen' import { SafeAreaView } from 'react-navigation' -import Platform from '../../../src/libs/platform' import theme from '../../styles/themes/dark' let isSplashScreenVisible = true @@ -23,7 +22,7 @@ const styles = StyleSheet.create({ export default class Screen extends PureComponent { static defaultProps = { - useSafeArea: Platform.OS !== 'web', + useSafeArea: true, } componentDidMount() { @@ -36,7 +35,7 @@ export default class Screen extends PureComponent { render() { const { useSafeArea, style, ...props } = this.props - if (useSafeArea && Platform.OS !== 'web') + if (useSafeArea) return return diff --git a/src/components/common/Screen.web.tsx b/src/components/common/Screen.web.tsx new file mode 100644 index 00000000..fccdfd79 --- /dev/null +++ b/src/components/common/Screen.web.tsx @@ -0,0 +1,32 @@ +import React, { PureComponent, ReactNode } from 'react' +import { SafeAreaView, StyleSheet, View, ViewStyle } from 'react-native' + +import theme from '../../styles/themes/dark' + +export interface IProps { + children?: ReactNode + useSafeArea?: boolean + style?: ViewStyle +} + +const styles = StyleSheet.create({ + container: { + backgroundColor: theme.base00, + flex: 1, + } as ViewStyle, +}) + +export default class Screen extends PureComponent { + static defaultProps = { + useSafeArea: true, + } + + render() { + const { useSafeArea, style, ...props } = this.props + + if (useSafeArea) + return + + return + } +} diff --git a/web/src/index.css b/web/src/index.css index 704728c1..9bd47a4a 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -16,7 +16,7 @@ box-sizing: border-box; } -html, body { +html, body, #root, #root > div { width: 100%; height: 100%; overflow: hidden;