feat: add invite dialog

This commit is contained in:
DiamondThree
2022-12-19 23:15:29 +08:00
parent a76ab1e729
commit 5ef754823d
2 changed files with 206 additions and 0 deletions
+6
View File
@@ -8,6 +8,7 @@ type inputProps = {
width?: number;
maxLength?: number;
onChange?: (value: string) => void;
onBlur?: (e: any) => void;
};
export const Input = (props: inputProps) => {
@@ -18,12 +19,16 @@ export const Input = (props: inputProps) => {
maxLength,
width = 260,
onChange,
onBlur,
} = props;
const [value, setValue] = useState<string>(valueProp || '');
const handleChange: InputHTMLAttributes<HTMLInputElement>['onChange'] = e => {
setValue(e.target.value);
onChange && onChange(e.target.value);
};
const handleBlur: InputHTMLAttributes<HTMLInputElement>['onBlur'] = e => {
onBlur && onBlur(e);
};
return (
<StyledInput
value={value}
@@ -32,6 +37,7 @@ export const Input = (props: inputProps) => {
width={width}
maxLength={maxLength}
onChange={handleChange}
onBlur={handleBlur}
></StyledInput>
);
};