11import { StyleSheet , View } from 'react-native'
2- import { IconButton , MD2Theme , Text , useTheme } from 'react-native-paper'
2+ import { IconButton , Text , useTheme } from 'react-native-paper'
33import type { ModeType } from './Calendar'
44import type { LocalState } from './DatePickerModalContent'
55import { useHeaderTextColor } from '../shared/utils'
@@ -70,14 +70,10 @@ export default function DatePickerModalContentHeader(
7070 const label = getLabel ( props . locale , props . mode , props . label )
7171 const color = useHeaderTextColor ( )
7272 const isEditingEnabled = allowEditing && mode !== 'multiple'
73- const supportingTextColor = theme . isV3 ? theme . colors . onSurfaceVariant : color
74- const textFont = theme ?. isV3
75- ? theme . fonts . labelMedium
76- : ( theme as any as MD2Theme ) . fonts . medium
77- const collapsedIcon = theme . isV3 ? 'pencil-outline' : 'pencil'
78- const expandedIcon = theme . isV3 ? 'calendar-blank' : 'calendar'
79- const finalCollapsedIcon = editIcon ?? collapsedIcon
80- const finalExpandedIcon = calendarIcon ?? expandedIcon
73+ const supportingTextColor = theme . colors . onSurfaceVariant
74+ const textFont = theme . fonts . labelMedium
75+ const finalCollapsedIcon = editIcon ?? 'pencil-outline'
76+ const finalExpandedIcon = calendarIcon ?? 'calendar-blank'
8177
8278 return (
8379 < View style = { styles . header } >
@@ -113,7 +109,7 @@ export default function DatePickerModalContentHeader(
113109 ? getTranslation ( props . locale , 'typeInDate' )
114110 : getTranslation ( props . locale , 'pickDateFromCalendar' )
115111 }
116- iconColor = { theme . isV3 ? theme . colors . onSurface : color }
112+ iconColor = { theme . colors . onSurface }
117113 onPress = { onToggle }
118114 />
119115 ) : null }
@@ -130,11 +126,7 @@ export function HeaderContentSingle({
130126 const theme = useTheme ( )
131127
132128 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
133- const dateColor = state . date
134- ? theme . isV3
135- ? theme . colors . onSurface
136- : color
137- : lighterColor
129+ const dateColor = state . date ? theme . colors . onSurface : lighterColor
138130
139131 const formatter = useMemo ( ( ) => {
140132 return new Intl . DateTimeFormat ( locale , {
@@ -164,11 +156,7 @@ export function HeaderContentMulti({
164156
165157 const dateCount = state . dates ?. length || 0
166158 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
167- const dateColor = dateCount
168- ? theme . isV3
169- ? theme . colors . onSurface
170- : color
171- : lighterColor
159+ const dateColor = dateCount ? theme . colors . onSurface : lighterColor
172160
173161 const formatter = useMemo ( ( ) => {
174162 return new Intl . DateTimeFormat ( locale , {
@@ -208,8 +196,8 @@ export function HeaderContentRange({
208196 const theme = useTheme ( )
209197
210198 const lighterColor = Color ( color ) . fade ( 0.5 ) . rgb ( ) . toString ( )
211- const startColorFilled = theme . isV3 ? theme . colors . onSurface : color
212- const endColorFilled = theme . isV3 ? theme . colors . onSurface : color
199+ const startColorFilled = theme . colors . onSurface
200+ const endColorFilled = theme . colors . onSurface
213201 const startColor = state . startDate ? startColorFilled : lighterColor
214202 const endColor = state . endDate ? endColorFilled : lighterColor
215203
0 commit comments