more consistent theming
This commit is contained in:
parent
af2d6a1f16
commit
f7e20fc608
1 changed files with 127 additions and 93 deletions
21
tank-frontend/src/components/TextInput.tsx
Normal file
21
tank-frontend/src/components/TextInput.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import {ChangeEventHandler} from "react";
|
||||
import './TextInput.css';
|
||||
|
||||
export default function TextInput(props: {
|
||||
onChange?: ChangeEventHandler<HTMLInputElement> | undefined;
|
||||
className?: string;
|
||||
value: string;
|
||||
placeholder: string;
|
||||
onEnter?: () => void;
|
||||
}) {
|
||||
return <input
|
||||
{...props}
|
||||
type="text"
|
||||
className={'TextInput ' + (props.className?? '')}
|
||||
|
||||
onKeyUp={event => {
|
||||
if (props.onEnter && event.key === 'Enter')
|
||||
props.onEnter();
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
Reference in a new issue