File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ import DatePickerModalContent, {
1515 DatePickerModalContentRangeProps ,
1616 DatePickerModalContentSingleProps ,
1717} from './DatePickerModalContent'
18- import { useMemo } from 'react'
19- import Color from 'color'
20- import { useHeaderColorIsLight } from '../utils'
18+ import { useHeaderBackgroundColor , useHeaderColorIsLight } from '../utils'
2119
2220interface DatePickerModalProps {
2321 visible : boolean
@@ -61,10 +59,7 @@ export function DatePickerModal(
6159 } )
6260
6361 const isLight = useHeaderColorIsLight ( )
64- const statusBarColor = useMemo < string > (
65- ( ) => Color ( theme . colors . primary ) . darken ( 0.2 ) . hex ( ) ,
66- [ theme ]
67- )
62+ const headerBackgroundColor = useHeaderBackgroundColor ( )
6863
6964 return (
7065 < View style = { [ StyleSheet . absoluteFill ] } pointerEvents = "box-none" >
@@ -110,7 +105,7 @@ export function DatePickerModal(
110105 style = { [
111106 {
112107 height : StatusBar . currentHeight ,
113- backgroundColor : statusBarColor ,
108+ backgroundColor : headerBackgroundColor ,
114109 } ,
115110 ] }
116111 />
Original file line number Diff line number Diff line change @@ -30,9 +30,14 @@ export default function DatePickerModalHeader(
3030 icon = "close"
3131 onPress = { props . onDismiss }
3232 color = { color }
33+ testID = "react-native-paper-dates-close"
3334 />
3435 < Appbar . Content title = { '' } />
35- < Button color = { color } onPress = { props . onSave } >
36+ < Button
37+ color = { color }
38+ onPress = { props . onSave }
39+ testID = "react-native-paper-dates-save"
40+ >
3641 { saveLabel }
3742 </ Button >
3843 </ Appbar >
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ function Day(props: {
6565 />
6666
6767 < TouchableRipple
68+ testID = { `react-native-paper-dates-day-${ year } -${ month } -${ day } ` }
6869 disabled = { disabled }
6970 borderless = { true }
7071 onPress = { disabled ? undefined : onPress }
You can’t perform that action at this time.
0 commit comments