diff --git a/src/Date/Calendar.tsx b/src/Date/Calendar.tsx index f35acd23..76dbc538 100644 --- a/src/Date/Calendar.tsx +++ b/src/Date/Calendar.tsx @@ -100,6 +100,9 @@ function Calendar( const theme = useTheme() const selectColor = useMemo(() => { + if (theme.isV3) { + return theme.colors.primaryContainer + } if (theme.dark) { return darkenBy(Color(theme.colors.primary), 0.1).hex() } diff --git a/src/Date/CalendarHeader.tsx b/src/Date/CalendarHeader.tsx index e094c92d..d95206b2 100644 --- a/src/Date/CalendarHeader.tsx +++ b/src/Date/CalendarHeader.tsx @@ -53,7 +53,6 @@ function CalendarHeader({ onPress={onPrev} /> - - + - + {uppercase ? label.toUpperCase() : label} @@ -96,13 +99,21 @@ export default function DatePickerModalContentHeader( {allowEditing ? ( ) : null} @@ -116,8 +127,13 @@ export function HeaderContentSingle({ color, locale, }: HeaderContentProps & { color: string }) { + const theme = useTheme() const lighterColor = Color(color).fade(0.5).rgb().toString() - const dateColor = state.date ? color : lighterColor + const dateColor = state.date + ? theme.isV3 + ? theme.colors.onSurface + : color + : lighterColor const formatter = React.useMemo(() => { return new Intl.DateTimeFormat(locale, { @@ -140,9 +156,14 @@ export function HeaderContentMulti({ color, locale, }: HeaderContentProps & { color: string; moreLabel: string | undefined }) { + const theme = useTheme() const dateCount = state.dates?.length || 0 const lighterColor = Color(color).fade(0.5).rgb().toString() - const dateColor = dateCount ? color : lighterColor + const dateColor = dateCount + ? theme.isV3 + ? theme.colors.onSurface + : color + : lighterColor const formatter = React.useMemo(() => { return new Intl.DateTimeFormat(locale, { @@ -174,6 +195,7 @@ export function HeaderContentRange({ endLabel = 'End', color, }: HeaderContentProps & { color: string }) { + const theme = useTheme() const formatter = React.useMemo(() => { return new Intl.DateTimeFormat(locale, { month: 'short', @@ -182,8 +204,16 @@ export function HeaderContentRange({ }, [locale]) const lighterColor = Color(color).fade(0.5).rgb().toString() - const startColor = state.startDate ? color : lighterColor - const endColor = state.endDate ? color : lighterColor + const startColor = state.startDate + ? theme.isV3 + ? theme.colors.onSurface + : color + : lighterColor + const endColor = state.endDate + ? theme.isV3 + ? theme.colors.onSurface + : color + : lighterColor return ( <> @@ -226,7 +256,6 @@ const styles = StyleSheet.create({ marginTop: -3, marginLeft: 3, }, - headerSeparator: { color: 'rgba(255,255,255,1)', fontSize: 25, diff --git a/src/Date/DatePickerModalHeader.tsx b/src/Date/DatePickerModalHeader.tsx index b8a72083..58079714 100644 --- a/src/Date/DatePickerModalHeader.tsx +++ b/src/Date/DatePickerModalHeader.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { Animated, StyleSheet } from 'react-native' -import { Appbar, Button } from 'react-native-paper' +import { Appbar, Button, useTheme } from 'react-native-paper' import { useHeaderTextColor } from '../utils' import { getTranslation } from '../translations/utils' @@ -20,6 +20,7 @@ export interface DatePickerModalHeaderProps { export default function DatePickerModalHeader( props: DatePickerModalHeaderProps ) { + const theme = useTheme() const { disableSafeTop, locale, closeIcon = 'close' } = props const saveLabel = props.saveLabel || getTranslation(locale, 'save') const color = useHeaderTextColor() @@ -29,6 +30,7 @@ export default function DatePickerModalHeader(