@@ -10,53 +10,57 @@ import Text from '../../components/text';
10
10
11
11
export interface ModalTopBarProps {
12
12
/**
13
- * title to display in the center of the top bar
14
- */
15
- title ?: string ;
16
- /**
17
- * title custom style
18
- */
19
- titleStyle ?: StyleProp < TextStyle > ;
20
- /**
21
- * done action props (Button props)
22
- */
23
- doneButtonProps ?: Omit < ButtonProps , 'onPress' > ;
24
- /**
25
- * done action label
26
- */
27
- doneLabel ?: string ;
28
- /**
29
- * done action icon
30
- */
31
- doneIcon ?: ImageSourcePropType ;
32
- /**
33
- * done action callback
34
- */
35
- onDone ?: ( props ?: any ) => void ;
36
- /**
37
- * cancel action props (Button props)
38
- */
39
- cancelButtonProps ?: Omit < ButtonProps , 'onPress' > ;
40
- /**
41
- * cancel action label
42
- */
43
- cancelLabel ?: string ;
44
- /**
45
- * cancel action icon
46
- */
47
- cancelIcon ?: ImageSourcePropType ;
48
- /**
49
- * cancel action callback
50
- */
51
- onCancel ?: ( props ?: any ) => void ;
52
- /**
53
- * whether to include status bar or not (height claculations)
54
- */
55
- includeStatusBar ?: boolean ;
56
- /**
57
- * style for the TopBar container
58
- */
59
- containerStyle ?: ViewProps [ 'style' ] ;
13
+ * title to display in the center of the top bar
14
+ */
15
+ title ?: string ;
16
+ /**
17
+ * title custom style
18
+ */
19
+ titleStyle ?: StyleProp < TextStyle > ;
20
+ /**
21
+ * done action props (Button props)
22
+ */
23
+ doneButtonProps ?: Omit < ButtonProps , 'onPress' > ;
24
+ /**
25
+ * done action label
26
+ */
27
+ doneLabel ?: string ;
28
+ /**
29
+ * done action icon
30
+ */
31
+ doneIcon ?: ImageSourcePropType ;
32
+ /**
33
+ * done action callback
34
+ */
35
+ onDone ?: ( props ?: any ) => void ;
36
+ /**
37
+ * cancel action props (Button props)
38
+ */
39
+ cancelButtonProps ?: Omit < ButtonProps , 'onPress' > ;
40
+ /**
41
+ * cancel action label
42
+ */
43
+ cancelLabel ?: string ;
44
+ /**
45
+ * cancel action icon
46
+ */
47
+ cancelIcon ?: ImageSourcePropType ;
48
+ /**
49
+ * cancel action callback
50
+ */
51
+ onCancel ?: ( props ?: any ) => void ;
52
+ /**
53
+ * whether to include status bar or not (height claculations)
54
+ */
55
+ includeStatusBar ?: boolean ;
56
+ /**
57
+ * style for the TopBar container
58
+ */
59
+ containerStyle ?: ViewProps [ 'style' ] ;
60
+ /**
61
+ * Whether or not to handle SafeArea
62
+ */
63
+ useSafeArea ?: boolean ;
60
64
}
61
65
62
66
type topBarButtonProp = {
@@ -65,7 +69,7 @@ type topBarButtonProp = {
65
69
icon ?: ImageSourcePropType ;
66
70
accessibilityLabel ?: string ;
67
71
buttonProps ?: Omit < ButtonProps , 'onPress' > ;
68
- }
72
+ } ;
69
73
70
74
const TOP_BAR_HEIGHT = Constants . isIOS ? 44 : 56 ;
71
75
const DEFAULT_BUTTON_PROPS = {
@@ -132,10 +136,10 @@ class TopBar extends Component<ModalTopBarProps> {
132
136
}
133
137
134
138
render ( ) {
135
- const { title, titleStyle, includeStatusBar, containerStyle} = this . props ;
139
+ const { title, titleStyle, includeStatusBar, containerStyle, useSafeArea } = this . props ;
136
140
137
141
return (
138
- < View style = { containerStyle } >
142
+ < View style = { containerStyle } useSafeArea = { useSafeArea } >
139
143
{ includeStatusBar && < View style = { styles . statusBar } /> }
140
144
< View style = { styles . container } >
141
145
< View row flex bottom paddingL-15 centerV >
0 commit comments