@@ -16,8 +16,8 @@ export interface HeaderPickProps {
1616 headerSeparator ?: string
1717 startLabel ?: string
1818 endLabel ?: string
19- editIcon ? : string
20- calendarIcon ? : string
19+ editIcon : string
20+ calendarIcon : string
2121 closeIcon ?: string
2222}
2323
@@ -58,23 +58,26 @@ export default function DatePickerModalContentHeader(
5858 mode,
5959 moreLabel,
6060 uppercase,
61- editIcon = 'pencil' ,
62- calendarIcon = 'calendar' ,
61+ editIcon,
62+ calendarIcon,
6363 } = props
6464 const theme = useTheme ( )
6565 const label = getLabel ( props . locale , props . mode , props . label )
6666
6767 const color = useHeaderTextColor ( )
68+ const supportingTextColor = theme . isV3 ? theme . colors . onSurfaceVariant : color
6869 const allowEditing = mode !== 'multiple'
6970
7071 let textFont = theme ?. isV3
71- ? theme . fonts . bodyLarge
72+ ? theme . fonts . labelMedium
7273 : ( theme as any as MD2Theme ) . fonts . medium
7374
7475 return (
75- < View style = { [ styles . header ] } >
76+ < View style = { styles . header } >
7677 < View >
77- < Text style = { [ styles . label , { color, ...textFont } ] } >
78+ < Text
79+ style = { [ styles . label , { color : supportingTextColor , ...textFont } ] }
80+ >
7881 { uppercase ? label . toUpperCase ( ) : label }
7982 </ Text >
8083 < View style = { styles . headerContentContainer } >
@@ -102,7 +105,7 @@ export default function DatePickerModalContentHeader(
102105 ? getTranslation ( props . locale , 'typeInDate' )
103106 : getTranslation ( props . locale , 'pickDateFromCalendar' )
104107 }
105- iconColor = { color }
108+ iconColor = { theme . isV3 ? theme . colors . onSurface : color }
106109 onPress = { onToggle }
107110 />
108111 ) : null }
@@ -116,8 +119,13 @@ export function HeaderContentSingle({
116119 color,
117120 locale,
118121} : HeaderContentProps & { color : string } ) {
122+ const theme = useTheme ( )
119123 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
120- const dateColor = state . date ? color : lighterColor
124+ const dateColor = state . date
125+ ? theme . isV3
126+ ? theme . colors . onSurface
127+ : color
128+ : lighterColor
121129
122130 const formatter = React . useMemo ( ( ) => {
123131 return new Intl . DateTimeFormat ( locale , {
@@ -140,9 +148,14 @@ export function HeaderContentMulti({
140148 color,
141149 locale,
142150} : HeaderContentProps & { color : string ; moreLabel : string | undefined } ) {
151+ const theme = useTheme ( )
143152 const dateCount = state . dates ?. length || 0
144153 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
145- const dateColor = dateCount ? color : lighterColor
154+ const dateColor = dateCount
155+ ? theme . isV3
156+ ? theme . colors . onSurface
157+ : color
158+ : lighterColor
146159
147160 const formatter = React . useMemo ( ( ) => {
148161 return new Intl . DateTimeFormat ( locale , {
@@ -174,6 +187,7 @@ export function HeaderContentRange({
174187 endLabel = 'End' ,
175188 color,
176189} : HeaderContentProps & { color : string } ) {
190+ const theme = useTheme ( )
177191 const formatter = React . useMemo ( ( ) => {
178192 return new Intl . DateTimeFormat ( locale , {
179193 month : 'short' ,
@@ -182,8 +196,16 @@ export function HeaderContentRange({
182196 } , [ locale ] )
183197
184198 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
185- const startColor = state . startDate ? color : lighterColor
186- const endColor = state . endDate ? color : lighterColor
199+ const startColor = state . startDate
200+ ? theme . isV3
201+ ? theme . colors . onSurface
202+ : color
203+ : lighterColor
204+ const endColor = state . endDate
205+ ? theme . isV3
206+ ? theme . colors . onSurface
207+ : color
208+ : lighterColor
187209
188210 return (
189211 < >
@@ -226,7 +248,6 @@ const styles = StyleSheet.create({
226248 marginTop : - 3 ,
227249 marginLeft : 3 ,
228250 } ,
229-
230251 headerSeparator : {
231252 color : 'rgba(255,255,255,1)' ,
232253 fontSize : 25 ,
0 commit comments