Skip to content

Commit 0d5fb1a

Browse files
committed
improved alignment
1 parent ab9d0d0 commit 0d5fb1a

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/Date/DatePickerInput.shared.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type DatePickerInputProps = {
2121
endYear?: number
2222
onChangeText?: (text: string | undefined) => void
2323
inputEnabled?: boolean
24-
inputButton?: React.ReactNode
2524
} & Omit<
2625
React.ComponentProps<typeof TextInput>,
2726
'value' | 'onChange' | 'onChangeText' | 'inputMode'

src/Date/DatePickerInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22

3-
import { IconButton } from 'react-native-paper'
3+
import { TextInput } from 'react-native-paper'
44
import DatePickerModal from './DatePickerModal'
55
import { useLatest } from '../utils'
66
import type { DatePickerInputProps } from './DatePickerInput.shared'
@@ -33,7 +33,7 @@ function DatePickerInput(
3333
{...rest}
3434
inputButton={
3535
withModal ? (
36-
<IconButton
36+
<TextInput.Icon
3737
size={24}
3838
icon={calendarIcon}
3939
disabled={rest.disabled}

src/Date/DatePickerInputWithoutModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function DatePickerInputWithoutModal(
4242
endYear: DatePickerInputProps['endYear']
4343
inputEnabled: DatePickerInputProps['inputEnabled']
4444
}) => any
45-
inputButtons?: any
45+
inputButton?: React.ReactNode
4646
},
4747
ref: any
4848
) {
@@ -76,7 +76,6 @@ function DatePickerInputWithoutModal(
7676
<View style={styles.root}>
7777
<View style={styles.inputContainer}>
7878
<TextInputWithMask
79-
inputButton={inputButton}
8079
{...rest}
8180
ref={ref}
8281
label={getLabel({
@@ -94,6 +93,7 @@ function DatePickerInputWithoutModal(
9493
keyboardAppearance={theme.dark ? 'dark' : 'default'}
9594
error={(!!error && !hideValidationErrors) || !!hasError}
9695
style={[styles.input, style]}
96+
inputButton={inputButton}
9797
/>
9898
</View>
9999
{error && !hideValidationErrors ? (

src/TextInputMask.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function TextInputWithMask(
8585
onChange && onChange(e)
8686
}}
8787
maxLength={10}
88-
right={<TextInput.Icon icon={() => inputButton} />}
88+
right={inputButton}
8989
/>
9090
</>
9191
)

0 commit comments

Comments
 (0)