fix(striker-ui): add play preset to IconButton

main
Tsu-ba-me 2 years ago
parent 6aaa4f6237
commit f72a348fb5
  1. 6
      striker-ui/components/IconButton/IconButton.tsx
  2. 1
      striker-ui/types/IconButton.d.ts

@ -3,6 +3,7 @@ import {
Close as MUICloseIcon, Close as MUICloseIcon,
Done as MUIDoneIcon, Done as MUIDoneIcon,
Edit as MUIEditIcon, Edit as MUIEditIcon,
PlayCircle as MUIPlayCircleIcon,
Visibility as MUIVisibilityIcon, Visibility as MUIVisibilityIcon,
VisibilityOff as MUIVisibilityOffIcon, VisibilityOff as MUIVisibilityOffIcon,
} from '@mui/icons-material'; } from '@mui/icons-material';
@ -55,6 +56,10 @@ const MAP_TO_EDIT_ICON: IconButtonMapToStateIconBundle = {
true: { iconType: MUIDoneIcon, iconProps: { sx: { color: BLUE } } }, true: { iconType: MUIDoneIcon, iconProps: { sx: { color: BLUE } } },
}; };
const MAP_TO_PLAY_ICON: IconButtonMapToStateIconBundle = {
none: { iconType: MUIPlayCircleIcon },
};
const MAP_TO_VISIBILITY_ICON: IconButtonMapToStateIconBundle = { const MAP_TO_VISIBILITY_ICON: IconButtonMapToStateIconBundle = {
false: { iconType: MUIVisibilityIcon }, false: { iconType: MUIVisibilityIcon },
true: { iconType: MUIVisibilityOffIcon }, true: { iconType: MUIVisibilityOffIcon },
@ -67,6 +72,7 @@ const MAP_TO_MAP_PRESET: Record<
add: MAP_TO_ADD_ICON, add: MAP_TO_ADD_ICON,
close: MAP_TO_CLOSE_ICON, close: MAP_TO_CLOSE_ICON,
edit: MAP_TO_EDIT_ICON, edit: MAP_TO_EDIT_ICON,
play: MAP_TO_PLAY_ICON,
visibility: MAP_TO_VISIBILITY_ICON, visibility: MAP_TO_VISIBILITY_ICON,
}; };

@ -4,6 +4,7 @@ type IconButtonPresetMapToStateIconBundle =
| 'add' | 'add'
| 'close' | 'close'
| 'edit' | 'edit'
| 'play'
| 'visibility'; | 'visibility';
type IconButtonStateIconBundle = { type IconButtonStateIconBundle = {

Loading…
Cancel
Save