@@ -7,6 +7,7 @@ import Modal from '../modal';
7
7
import View from '../view' ;
8
8
import Text from '../text' ;
9
9
import Icon from '../icon' ;
10
+ import Button from '../button' ;
10
11
import WheelPicker from '../WheelPicker' ;
11
12
import { PickerItemProps , PickerItemsListProps , PickerSingleValue } from './types' ;
12
13
import PickerContext from './PickerContext' ;
@@ -95,13 +96,33 @@ const PickerItemsList = (props: PickerItemsListProps) => {
95
96
) ;
96
97
} ;
97
98
99
+ const renderCancel = ( ) => {
100
+ const { cancelButtonProps, cancelLabel, onCancel} = topBarProps ?? { } ;
101
+
102
+ return (
103
+ < >
104
+ { cancelLabel ? (
105
+ < Text text70 $textPrimary accessibilityRole = { 'button' } onPress = { onCancel } >
106
+ { cancelLabel }
107
+ </ Text >
108
+ ) : cancelButtonProps ? (
109
+ < Button key = { 'cancel-button' } link onPress = { onCancel } { ...cancelButtonProps } />
110
+ ) : undefined }
111
+ </ >
112
+ ) ;
113
+ } ;
114
+
98
115
const renderWheel = ( ) => {
116
+ const { cancelButtonProps, cancelLabel, doneLabel, title, titleStyle, containerStyle, useSafeArea} =
117
+ topBarProps ?? { } ;
118
+
99
119
return (
100
- < View >
101
- < View row spread padding-page >
102
- < Text > { topBarProps ?. title } </ Text >
120
+ < View useSafeArea = { useSafeArea } >
121
+ < View row spread padding-page style = { containerStyle } >
122
+ { ( cancelButtonProps || cancelLabel ) && renderCancel ( ) }
123
+ < Text style = { titleStyle } > { title } </ Text >
103
124
< Text text70 $textPrimary accessibilityRole = { 'button' } onPress = { ( ) => context . onPress ( wheelPickerValue ) } >
104
- { topBarProps ?. doneLabel ?? 'Select' }
125
+ { doneLabel ?? 'Select' }
105
126
</ Text >
106
127
</ View >
107
128
< WheelPicker
0 commit comments