Skip to content

Commit bec5cb9

Browse files
committed
Fix typescript errors.
1 parent 7162f9f commit bec5cb9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/Date/DatePickerModalContent.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Calendar, {
1111
} from './Calendar'
1212

1313
import AnimatedCrossView from './AnimatedCrossView'
14-
import { useTheme } from 'react-native-paper'
1514
import DatePickerModalHeader from './DatePickerModalHeader'
1615
import DatePickerModalContentHeader, {
1716
HeaderPickProps,
@@ -86,7 +85,6 @@ export function DatePickerModalContent(
8685
startYear,
8786
endYear,
8887
} = props
89-
const theme = useTheme()
9088
const anyProps = props as any
9189

9290
// use local state to add only onConfirm state changes
@@ -164,10 +162,8 @@ export function DatePickerModalContent(
164162
endLabel={props.endLabel}
165163
uppercase={props.uppercase ?? true}
166164
locale={locale}
167-
editIcon={props?.editIcon ?? theme.isV3 ? 'pencil-outline' : 'pencil'}
168-
calendarIcon={
169-
props.calendarIcon ?? theme.isV3 ? 'calendar-blank' : 'calendar'
170-
}
165+
editIcon={props?.editIcon}
166+
calendarIcon={props.calendarIcon}
171167
/>
172168
</DatePickerModalHeaderBackground>
173169
<AnimatedCrossView

src/Date/DatePickerModalContentHeader.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export interface HeaderPickProps {
1616
headerSeparator?: string
1717
startLabel?: string
1818
endLabel?: string
19-
editIcon: string
20-
calendarIcon: string
19+
editIcon?: string
20+
calendarIcon?: string
2121
closeIcon?: string
2222
}
2323

@@ -99,7 +99,15 @@ export default function DatePickerModalContentHeader(
9999
<View style={styles.fill} />
100100
{allowEditing ? (
101101
<IconButton
102-
icon={collapsed ? editIcon : calendarIcon}
102+
icon={
103+
collapsed
104+
? editIcon ?? theme.isV3
105+
? 'pencil-outline'
106+
: 'pencil'
107+
: calendarIcon ?? theme.isV3
108+
? 'calendar-blank'
109+
: 'calendar'
110+
}
103111
accessibilityLabel={
104112
collapsed
105113
? getTranslation(props.locale, 'typeInDate')

0 commit comments

Comments
 (0)