mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 07:24:56 -06:00
fix full screen modal notch background
This commit is contained in:
parent
e9cdfd35dc
commit
46e2f03838
1 changed files with 20 additions and 15 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SafeAreaView } from 'react-native';
|
import { View, SafeAreaView } from 'react-native';
|
||||||
import { Toolbar } from 'react-native-material-ui';
|
import { Toolbar } from 'react-native-material-ui';
|
||||||
import { compose, renderComponent, mapProps, pure } from 'recompose';
|
import { compose, renderComponent, mapProps, pure } from 'recompose';
|
||||||
import TopSaveButton from '../components/TopSaveButton';
|
import TopSaveButton from '../components/TopSaveButton';
|
||||||
|
import { palette } from '../ui-theme';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onClose: () => void,
|
onClose: () => void,
|
||||||
|
|
@ -13,28 +14,32 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const FullScreenModal = ({ onSave, onClose, title, children }: Props) => (
|
const FullScreenModal = ({ onSave, onClose, title, children }: Props) => (
|
||||||
<SafeAreaView
|
<View
|
||||||
style={{
|
style={{
|
||||||
|
backgroundColor: 'white',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 0,
|
top: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
backgroundColor: 'white',
|
|
||||||
}}>
|
}}>
|
||||||
<Toolbar
|
<View style={{ backgroundColor: palette.primaryColor }}>
|
||||||
leftElement="close"
|
<SafeAreaView>
|
||||||
onLeftElementPress={onClose}
|
<Toolbar
|
||||||
centerElement={title}
|
leftElement="close"
|
||||||
rightElement={onSave && <TopSaveButton onSave={onSave} />}
|
onLeftElementPress={onClose}
|
||||||
style={{
|
centerElement={title}
|
||||||
container: {
|
rightElement={onSave && <TopSaveButton onSave={onSave} />}
|
||||||
elevation: 3,
|
style={{
|
||||||
},
|
container: {
|
||||||
}}
|
elevation: 3,
|
||||||
/>
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SafeAreaView>
|
||||||
|
</View>
|
||||||
{children}
|
{children}
|
||||||
</SafeAreaView>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default FullScreenModal;
|
export default FullScreenModal;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue