Skip to content

Commit

Permalink
fix: add testID + more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLindhout committed May 13, 2021
1 parent 7b80b97 commit 597b61b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/Date/DatePickerModal.tsx
Expand Up @@ -15,9 +15,7 @@ import DatePickerModalContent, {
DatePickerModalContentRangeProps,
DatePickerModalContentSingleProps,
} from './DatePickerModalContent'
import { useMemo } from 'react'
import Color from 'color'
import { useHeaderColorIsLight } from '../utils'
import { useHeaderBackgroundColor, useHeaderColorIsLight } from '../utils'

interface DatePickerModalProps {
visible: boolean
Expand Down Expand Up @@ -61,10 +59,7 @@ export function DatePickerModal(
})

const isLight = useHeaderColorIsLight()
const statusBarColor = useMemo<string>(
() => Color(theme.colors.primary).darken(0.2).hex(),
[theme]
)
const headerBackgroundColor = useHeaderBackgroundColor()

return (
<View style={[StyleSheet.absoluteFill]} pointerEvents="box-none">
Expand Down Expand Up @@ -110,7 +105,7 @@ export function DatePickerModal(
style={[
{
height: StatusBar.currentHeight,
backgroundColor: statusBarColor,
backgroundColor: headerBackgroundColor,
},
]}
/>
Expand Down
7 changes: 6 additions & 1 deletion src/Date/DatePickerModalHeader.tsx
Expand Up @@ -30,9 +30,14 @@ export default function DatePickerModalHeader(
icon="close"
onPress={props.onDismiss}
color={color}
testID="react-native-paper-dates-close"
/>
<Appbar.Content title={''} />
<Button color={color} onPress={props.onSave}>
<Button
color={color}
onPress={props.onSave}
testID="react-native-paper-dates-save"
>
{saveLabel}
</Button>
</Appbar>
Expand Down
1 change: 1 addition & 0 deletions src/Date/Day.tsx
Expand Up @@ -65,6 +65,7 @@ function Day(props: {
/>

<TouchableRipple
testID={`react-native-paper-dates-day-${year}-${month}-${day}`}
disabled={disabled}
borderless={true}
onPress={disabled ? undefined : onPress}
Expand Down

0 comments on commit 597b61b

Please sign in to comment.