mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
refactor: refactor input component, to support tab-index
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { Input } from '@toeverything/components/ui';
|
||||
import { ModifyPanelContentProps } from './types';
|
||||
|
||||
export default ({ onValueChange, initialValue }: ModifyPanelContentProps) => {
|
||||
const [text, setText] = useState(initialValue?.value || '');
|
||||
return (
|
||||
<Input
|
||||
placeholder="Input email"
|
||||
value={text}
|
||||
onChange={e => {
|
||||
setText(e.target.value);
|
||||
onValueChange(e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { Input } from '@toeverything/components/ui';
|
||||
import { ModifyPanelContentProps } from './types';
|
||||
|
||||
export default ({ onValueChange, initialValue }: ModifyPanelContentProps) => {
|
||||
const [text, setText] = useState(initialValue?.value || '');
|
||||
return (
|
||||
<Input
|
||||
placeholder="Input location"
|
||||
value={text}
|
||||
onChange={e => {
|
||||
setText(e.target.value);
|
||||
onValueChange(e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { Input } from '@toeverything/components/ui';
|
||||
import { ModifyPanelContentProps } from './types';
|
||||
|
||||
export default ({ onValueChange, initialValue }: ModifyPanelContentProps) => {
|
||||
const [text, setText] = useState(initialValue?.value || '');
|
||||
return (
|
||||
<Input
|
||||
placeholder="Input phone"
|
||||
value={text}
|
||||
onChange={e => {
|
||||
setText(e.target.value);
|
||||
onValueChange(e.target.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user