fix(striker-ui): add copy icon button
This commit is contained in:
parent
60da16f6f6
commit
40d13433cf
@ -2,6 +2,7 @@ import {
|
||||
Delete as MUIDeleteIcon,
|
||||
Add as MUIAddIcon,
|
||||
Close as MUICloseIcon,
|
||||
ContentCopy as MUIContentCopy,
|
||||
Done as MUIDoneIcon,
|
||||
Edit as MUIEditIcon,
|
||||
PlayCircle as MUIPlayCircleIcon,
|
||||
@ -62,6 +63,10 @@ const MAP_TO_CLOSE_ICON: IconButtonMapToStateIconBundle = {
|
||||
none: { iconType: MUICloseIcon },
|
||||
};
|
||||
|
||||
const MAP_TO_COPY_ICON: IconButtonMapToStateIconBundle = {
|
||||
none: { iconType: MUIContentCopy },
|
||||
};
|
||||
|
||||
const MAP_TO_DELETE_ICON: IconButtonMapToStateIconBundle = {
|
||||
none: { iconType: MUIDeleteIcon },
|
||||
};
|
||||
@ -86,6 +91,7 @@ const MAP_TO_MAP_PRESET: Record<
|
||||
> = {
|
||||
add: MAP_TO_ADD_ICON,
|
||||
close: MAP_TO_CLOSE_ICON,
|
||||
copy: MAP_TO_COPY_ICON,
|
||||
delete: MAP_TO_DELETE_ICON,
|
||||
edit: MAP_TO_EDIT_ICON,
|
||||
play: MAP_TO_PLAY_ICON,
|
||||
@ -132,7 +138,7 @@ const IconButton: FC<IconButtonProps> = ({
|
||||
}
|
||||
|
||||
return result;
|
||||
}, [mapToIcon, state, defaultIcon, iconProps, children]);
|
||||
}, [children, defaultIcon, iconProps, mapToIcon, state]);
|
||||
const iconButtonElementType = useMemo(
|
||||
() => MAP_TO_VARIANT[variant],
|
||||
[variant],
|
||||
|
1
striker-ui/types/IconButton.d.ts
vendored
1
striker-ui/types/IconButton.d.ts
vendored
@ -3,6 +3,7 @@ type CreatableComponent = Parameters<typeof import('react').createElement>[0];
|
||||
type IconButtonPresetMapToStateIconBundle =
|
||||
| 'add'
|
||||
| 'close'
|
||||
| 'copy'
|
||||
| 'delete'
|
||||
| 'edit'
|
||||
| 'play'
|
||||
|
Loading…
Reference in New Issue
Block a user