Files
aso/frontend/client-portal/src/theme/overrides/ButtonGroup.ts
Server D3 Linksehat 1bf608b1ed Server 103 Commit
2024-07-18 16:05:33 +07:00

52 lines
1.4 KiB
TypeScript
Executable File

import { Theme } from '@mui/material/styles';
// ----------------------------------------------------------------------
export default function ButtonGroup(theme: Theme) {
const styleContained = (
color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'
) => ({
props: { variant: 'contained', color },
style: { boxShadow: theme.customShadows[color] }
});
return {
MuiButtonGroup: {
variants: [
{
props: { variant: 'contained', color: 'inherit' },
style: { boxShadow: theme.customShadows.z8 }
},
styleContained('primary'),
styleContained('secondary'),
styleContained('info'),
styleContained('success'),
styleContained('warning'),
styleContained('error'),
{
props: { disabled: true },
style: {
boxShadow: 'none',
'& .MuiButtonGroup-grouped.Mui-disabled': {
color: theme.palette.action.disabled,
borderColor: `${theme.palette.action.disabledBackground} !important`,
'&.MuiButton-contained': {
backgroundColor: theme.palette.action.disabledBackground
}
}
}
}
],
styleOverrides: {
root: {
'&:hover': {
boxShadow: 'none'
}
}
}
}
};
}