11import * as React from 'react'
2- import { MD3DarkTheme , Text , TouchableRipple } from 'react-native-paper'
2+ import { Theme , Text , TouchableRipple } from 'react-native-paper'
33import { StyleSheet , View } from 'react-native'
44import DayRange from './DayRange'
55import { daySize } from './dateUtils'
6+ import type {
7+ Fonts ,
8+ MD3Typescale ,
9+ } from 'react-native-paper/lib/typescript/types'
610
711function EmptyDayPure ( ) {
812 return < View style = { styles . empty } />
913}
1014export const EmptyDay = React . memo ( EmptyDayPure )
1115
1216function Day ( props : {
13- theme : typeof MD3DarkTheme
17+ theme : Theme
1418 textColorOnPrimary : string
1519 day : number
1620 month : number
@@ -41,7 +45,6 @@ function Day(props: {
4145 textColorOnPrimary,
4246 theme,
4347 } = props
44- // console.log(month, { day })
4548 const onPress = React . useCallback ( ( ) => {
4649 onPressDate ( new Date ( year , month , day ) )
4750 } , [ onPressDate , year , month , day ] )
@@ -55,6 +58,12 @@ function Day(props: {
5558 const textColor =
5659 selected || ( inRange && theme . dark ) ? textColorOnPrimary : undefined
5760
61+ let textFont = ( theme . fonts as Fonts ) ?. medium
62+
63+ if ( theme . isV3 ) {
64+ textFont = ( theme . fonts as MD3Typescale ) ?. bodyMedium
65+ }
66+
5867 return (
5968 < View style = { [ styles . root , disabled && styles . disabled ] } >
6069 < DayRange
@@ -83,7 +92,10 @@ function Day(props: {
8392 ] }
8493 >
8594 < Text
86- style = { textColor ? { color : textColor } : undefined }
95+ style = { [
96+ textColor ? { color : textColor } : undefined ,
97+ { ...textFont } ,
98+ ] }
8799 selectable = { false }
88100 >
89101 { day }
0 commit comments