mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 13:58:50 +08:00
feat: add invite dialog
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user