Skip to content

Commit 597b61b

Browse files
fix: add testID + more fixes
1 parent 7b80b97 commit 597b61b

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/Date/DatePickerModal.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff 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

2220
interface 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
/>

src/Date/DatePickerModalHeader.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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>

src/Date/Day.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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}

0 commit comments

Comments
 (0)