From e9d0e96cee3ef3b9310f3afc38a97e6aacccc8a6 Mon Sep 17 00:00:00 2001 From: thibault-barrat Date: Thu, 11 Aug 2022 15:10:07 +0200 Subject: [PATCH 1/2] remove useless classnames --- docs/FileInput.md | 1 - docs/ImageInput.md | 1 - packages/ra-ui-materialui/src/input/FileInput.tsx | 2 -- packages/ra-ui-materialui/src/input/ImageInput.tsx | 5 ----- 4 files changed, 9 deletions(-) diff --git a/docs/FileInput.md b/docs/FileInput.md index c4eaa8c9f03..e95e9458680 100644 --- a/docs/FileInput.md +++ b/docs/FileInput.md @@ -124,7 +124,6 @@ The `` component accepts the usual `className` prop. You can also ove | Rule name | Description | |-------------------------------|----------------------------------------------------------------------------| | `& .RaFileInput-dropZone` | Applied to the main container of the component | -| `& .RaFileInput-preview` | Applied to each children | | `& .RaFileInput-removeButton` | Applied to each of the MUI's `IconButton` component used as remove button | To override the style of all instances of `` using the [MUI style overrides](https://mui.com/customization/globals/#css), use the `RaFileInput` key. diff --git a/docs/ImageInput.md b/docs/ImageInput.md index e138b649ae7..b11178b6fa8 100644 --- a/docs/ImageInput.md +++ b/docs/ImageInput.md @@ -60,7 +60,6 @@ The `` component accepts the usual `className` prop. You can also ov | Rule name | Description | |---------------------------------|-----------------------------------------------------| | `& .RaImageInput-dropZone` | Styles pass to the underlying `FileInput` component | -| `& .RaImageInput-preview` | Styles pass to the underlying `FileInput` component | | `& .RaImageInput-removeButton` | Styles pass to the underlying `FileInput` component | To override the style of all instances of `` using the [MUI style overrides](https://mui.com/customization/globals/#css), use the `RaImageInput` key. diff --git a/packages/ra-ui-materialui/src/input/FileInput.tsx b/packages/ra-ui-materialui/src/input/FileInput.tsx index 7964430ba30..7bb6669ac72 100644 --- a/packages/ra-ui-materialui/src/input/FileInput.tsx +++ b/packages/ra-ui-materialui/src/input/FileInput.tsx @@ -231,7 +231,6 @@ const PREFIX = 'RaFileInput'; export const FileInputClasses = { dropZone: `${PREFIX}-dropZone`, - preview: `${PREFIX}-preview`, removeButton: `${PREFIX}-removeButton`, }; @@ -249,7 +248,6 @@ const StyledLabeled = styled(Labeled, { textAlign: 'center', color: theme.palette.getContrastText(theme.palette.background.default), }, - [`& .${FileInputClasses.preview}`]: {}, [`& .${FileInputClasses.removeButton}`]: {}, })); diff --git a/packages/ra-ui-materialui/src/input/ImageInput.tsx b/packages/ra-ui-materialui/src/input/ImageInput.tsx index f082585209d..c5e39d7d8ae 100644 --- a/packages/ra-ui-materialui/src/input/ImageInput.tsx +++ b/packages/ra-ui-materialui/src/input/ImageInput.tsx @@ -29,11 +29,6 @@ const StyledFileInput = styled(FileInput, { textAlign: 'center', color: theme.palette.getContrastText(theme.palette.background.default), }, - - [`& .${FileInputClasses.preview}`]: { - display: 'inline-block', - }, - [`& .${FileInputClasses.removeButton}`]: { display: 'inline-block', position: 'relative', From 74c8c922c2abe5b2d69ad5a81e59c51fbb4f29a0 Mon Sep 17 00:00:00 2001 From: thibault-barrat Date: Thu, 11 Aug 2022 17:40:32 +0200 Subject: [PATCH 2/2] replace ImageInput classnames by FileInput classnames in docs --- docs/ImageInput.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ImageInput.md b/docs/ImageInput.md index b11178b6fa8..a0b691c7a9d 100644 --- a/docs/ImageInput.md +++ b/docs/ImageInput.md @@ -59,7 +59,7 @@ The `` component accepts the usual `className` prop. You can also ov | Rule name | Description | |---------------------------------|-----------------------------------------------------| -| `& .RaImageInput-dropZone` | Styles pass to the underlying `FileInput` component | -| `& .RaImageInput-removeButton` | Styles pass to the underlying `FileInput` component | +| `& .RaFileInput-dropZone` | Styles pass to the underlying `FileInput` component | +| `& .RaFileInput-removeButton` | Styles pass to the underlying `FileInput` component | To override the style of all instances of `` using the [MUI style overrides](https://mui.com/customization/globals/#css), use the `RaImageInput` key.