Skip to content

Commit 735f307

Browse files
feat: fix width of date picker input
1 parent e0f580f commit 735f307

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

example/src/ReadMeExampleDatePickerInput.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export default function ReadMeExampleDatePickerInput() {
1313
value={inputDate}
1414
onChange={(d) => setInputDate(d)}
1515
inputMode="start"
16-
// FIXME : remove the ts error
17-
// @ts-ignore
1816
autoCompleteType="birthdate-full"
1917
// mode="outlined" (see react-native-paper docs)
2018
// other react native TextInput props

src/Date/DatePickerInput.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ function DatePickerInput(
2020
withModal = true,
2121
withDateFormatInLabel = true,
2222
...rest
23-
}: Omit<React.ComponentProps<typeof TextInput>, 'value' | 'onChange'> & {
23+
}: {
2424
inputMode: 'start' | 'end'
2525
locale: string
2626
onChange: (date: Date | undefined) => void
2727
value: Date | undefined
2828
validRange?: ValidRangeType | undefined
2929
withModal?: boolean
3030
withDateFormatInLabel?: boolean
31-
},
31+
} & Omit<
32+
React.ComponentProps<typeof TextInput>,
33+
'value' | 'onChange' | 'onChangeText'
34+
>,
3235
ref: any
3336
) {
3437
const theme = useTheme()
@@ -122,7 +125,6 @@ const styles = StyleSheet.create({
122125
position: 'relative',
123126
alignItems: 'center',
124127
flexGrow: 1,
125-
alignSelf: 'flex-start',
126128
},
127129
input: {
128130
flexGrow: 1,

src/Date/DatePickerModalContentHeader.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ export default function DatePickerModalContentHeader(
5858
return (
5959
<View style={[styles.header]}>
6060
<View>
61-
<Text style={[styles.label, { color }]}>{uppercase ? label.toUpperCase() : label}</Text>
62-
61+
<Text style={[styles.label, { color }]}>
62+
{uppercase ? label.toUpperCase() : label}
63+
</Text>
6364
<View style={styles.headerContentContainer}>
6465
{mode === 'range' ? (
6566
<HeaderContentRange {...props} color={color} />

src/Time/TimePickerModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ export function TimePickerModal({
162162
tvParallaxProperties={undefined}
163163
/>
164164
<View style={styles.fill} />
165-
<Button onPress={onDismiss} uppercase={uppercase}>{cancelLabel}</Button>
165+
<Button onPress={onDismiss} uppercase={uppercase}>
166+
{cancelLabel}
167+
</Button>
166168
<Button
167169
onPress={() =>
168170
onConfirm({ hours: localHours, minutes: localMinutes })

0 commit comments

Comments
 (0)