@@ -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 } >
@@ -96,13 +99,21 @@ export default function DatePickerModalContentHeader(
9699 < View style = { styles . fill } />
97100 { allowEditing ? (
98101 < IconButton
99- icon = { collapsed ? editIcon : calendarIcon }
102+ icon = {
103+ collapsed
104+ ? editIcon ?? theme . isV3
105+ ? 'pencil-outline'
106+ : 'pencil'
107+ : calendarIcon ?? theme . isV3
108+ ? 'calendar-blank'
109+ : 'calendar'
110+ }
100111 accessibilityLabel = {
101112 collapsed
102113 ? getTranslation ( props . locale , 'typeInDate' )
103114 : getTranslation ( props . locale , 'pickDateFromCalendar' )
104115 }
105- iconColor = { color }
116+ iconColor = { theme . isV3 ? theme . colors . onSurface : color }
106117 onPress = { onToggle }
107118 />
108119 ) : null }
@@ -116,8 +127,13 @@ export function HeaderContentSingle({
116127 color,
117128 locale,
118129} : HeaderContentProps & { color : string } ) {
130+ const theme = useTheme ( )
119131 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
120- const dateColor = state . date ? color : lighterColor
132+ const dateColor = state . date
133+ ? theme . isV3
134+ ? theme . colors . onSurface
135+ : color
136+ : lighterColor
121137
122138 const formatter = React . useMemo ( ( ) => {
123139 return new Intl . DateTimeFormat ( locale , {
@@ -140,9 +156,14 @@ export function HeaderContentMulti({
140156 color,
141157 locale,
142158} : HeaderContentProps & { color : string ; moreLabel : string | undefined } ) {
159+ const theme = useTheme ( )
143160 const dateCount = state . dates ?. length || 0
144161 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
145- const dateColor = dateCount ? color : lighterColor
162+ const dateColor = dateCount
163+ ? theme . isV3
164+ ? theme . colors . onSurface
165+ : color
166+ : lighterColor
146167
147168 const formatter = React . useMemo ( ( ) => {
148169 return new Intl . DateTimeFormat ( locale , {
@@ -174,6 +195,7 @@ export function HeaderContentRange({
174195 endLabel = 'End' ,
175196 color,
176197} : HeaderContentProps & { color : string } ) {
198+ const theme = useTheme ( )
177199 const formatter = React . useMemo ( ( ) => {
178200 return new Intl . DateTimeFormat ( locale , {
179201 month : 'short' ,
@@ -182,8 +204,16 @@ export function HeaderContentRange({
182204 } , [ locale ] )
183205
184206 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
185- const startColor = state . startDate ? color : lighterColor
186- const endColor = state . endDate ? color : lighterColor
207+ const startColor = state . startDate
208+ ? theme . isV3
209+ ? theme . colors . onSurface
210+ : color
211+ : lighterColor
212+ const endColor = state . endDate
213+ ? theme . isV3
214+ ? theme . colors . onSurface
215+ : color
216+ : lighterColor
187217
188218 return (
189219 < >
@@ -226,7 +256,6 @@ const styles = StyleSheet.create({
226256 marginTop : - 3 ,
227257 marginLeft : 3 ,
228258 } ,
229-
230259 headerSeparator : {
231260 color : 'rgba(255,255,255,1)' ,
232261 fontSize : 25 ,
0 commit comments