2022-10-31 04:22:08 +00:00
|
|
|
import {ComponentProps, Ref} from 'react'
|
|
|
|
import {TextInput} from 'react-native-paper'
|
|
|
|
import {CombinedDefaultTheme} from './App'
|
|
|
|
import {MARGIN} from './constants'
|
|
|
|
import useDark from './use-dark'
|
2022-08-26 01:54:51 +00:00
|
|
|
|
|
|
|
export default function MassiveInput(
|
2022-10-28 05:36:47 +00:00
|
|
|
props: Partial<ComponentProps<typeof TextInput>> & {
|
2022-10-31 04:22:08 +00:00
|
|
|
innerRef?: Ref<any>
|
2022-08-26 01:54:51 +00:00
|
|
|
},
|
|
|
|
) {
|
2022-10-31 04:22:08 +00:00
|
|
|
const dark = useDark()
|
2022-08-26 01:54:51 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<TextInput
|
2022-09-01 01:17:50 +00:00
|
|
|
selectionColor={dark ? '#2A2A2A' : CombinedDefaultTheme.colors.border}
|
2022-08-26 01:54:51 +00:00
|
|
|
mode="outlined"
|
2022-09-16 09:07:02 +00:00
|
|
|
style={{marginBottom: MARGIN, minWidth: 100}}
|
2022-08-26 01:54:51 +00:00
|
|
|
selectTextOnFocus
|
|
|
|
ref={props.innerRef}
|
2022-09-30 02:14:53 +00:00
|
|
|
blurOnSubmit={false}
|
2022-08-26 01:54:51 +00:00
|
|
|
{...props}
|
|
|
|
/>
|
2022-10-31 04:22:08 +00:00
|
|
|
)
|
2022-08-26 01:54:51 +00:00
|
|
|
}
|