feat(EditableTypography): support disable state

This commit is contained in:
Ali BARIN
2025-01-08 15:10:26 +00:00
parent e29e71bdf1
commit 0b4af4b1b9
2 changed files with 13 additions and 18 deletions

View File

@@ -3,8 +3,7 @@ import MuiBox from '@mui/material/Box';
import MuiTextField from '@mui/material/TextField';
import { inputClasses } from '@mui/material/Input';
const boxShouldForwardProp = (prop) =>
!['editing', 'disabledEditing'].includes(prop);
const boxShouldForwardProp = (prop) => !['editing', 'disabled'].includes(prop);
export const Box = styled(MuiBox, {
shouldForwardProp: boxShouldForwardProp,
@@ -15,7 +14,7 @@ export const Box = styled(MuiBox, {
max-width: 90%;
height: 33px;
align-items: center;
${({ disabledEditing }) => !disabledEditing && 'cursor: pointer;'}
${({ disabled }) => !disabled && 'cursor: pointer;'}
${({ editing }) => editing && 'border-bottom: 1px dashed #000;'}
`;