mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 01:01:43 +10:00
-- code refactored --
This commit is contained in:
@ -32,18 +32,7 @@ export const ProfilesDialog = () => {
|
|||||||
|
|
||||||
const [iconSrc, setIconSrc] = useDebounceValue("", 400)
|
const [iconSrc, setIconSrc] = useDebounceValue("", 400)
|
||||||
|
|
||||||
const handleIconChange = useCallback((event: React.ChangeEvent<HTMLInputElement>, field: ControllerRenderProps<{
|
const handleIconChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
id: string;
|
|
||||||
visible: boolean;
|
|
||||||
network: string;
|
|
||||||
username: string;
|
|
||||||
icon: string;
|
|
||||||
url: {
|
|
||||||
label: string;
|
|
||||||
href: string;
|
|
||||||
};
|
|
||||||
}, "icon">) => {
|
|
||||||
field.onChange(event);
|
|
||||||
if (event.target.value === "") {
|
if (event.target.value === "") {
|
||||||
setIconSrc("");
|
setIconSrc("");
|
||||||
} else {
|
} else {
|
||||||
@ -115,7 +104,10 @@ export const ProfilesDialog = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<Input {...field} id="iconSlug" placeholder="linkedin" onChange={(e) => handleIconChange(e, field)} />
|
<Input {...field} id="iconSlug" placeholder="linkedin" onChange={(event) => {
|
||||||
|
field.onChange(event)
|
||||||
|
handleIconChange(event)
|
||||||
|
}} />
|
||||||
</div>
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
Reference in New Issue
Block a user