Massive/AppInput.tsx

27 lines
660 B
TypeScript
Raw Permalink Normal View History

import React, { ComponentProps, Ref } from "react";
import { TextInput, useTheme } from "react-native-paper";
import { CombinedDefaultTheme } from "./App";
import { MARGIN } from "./constants";
2022-08-26 01:54:51 +00:00
2022-12-30 06:39:20 +00:00
function AppInput(
props: Partial<ComponentProps<typeof TextInput>> & {
innerRef?: Ref<any>;
}
2022-08-26 01:54:51 +00:00
) {
const { dark } = useTheme();
2022-08-26 01:54:51 +00:00
return (
<TextInput
selectionColor={dark ? "#2A2A2A" : CombinedDefaultTheme.colors.border}
2023-06-27 03:16:59 +00:00
style={{ marginBottom: MARGIN, minWidth: 100 }}
2022-08-26 01:54:51 +00:00
selectTextOnFocus
ref={props.innerRef}
blurOnSubmit={false}
mode="outlined"
2022-08-26 01:54:51 +00:00
{...props}
/>
);
2022-08-26 01:54:51 +00:00
}
2022-12-30 06:39:20 +00:00
export default React.memo(AppInput);