Skip to content

Commit 00ee231

Browse files
author
Moritz Gramlich
committed
change prop to camelcase
1 parent fb49535 commit 00ee231

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

docs/FileInput.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and
6262
| `multiple` | Optional | `boolean` | `false` | Whether the inputs can accept multiple files. |
6363
| `options` | Optional | `Object` | `{}` | Additional options passed to react-dropzone's `useDropzone()` hook. |
6464
| `placeholder` | Optional | `ReactNode` | - | Invite displayed in the drop zone |
65-
| `RemoveIcon` | Optional | `ReactNode` | [MUI's RemoveCircle icon](https://mui.com/material-ui/material-icons/?query=removeCir&selected=RemoveCircle) | The clickable icon for removing files |
65+
| `removeIcon` | Optional | `ReactNode` | [MUI's RemoveCircle icon](https://mui.com/material-ui/material-icons/?query=removeCir&selected=RemoveCircle) | The clickable icon for removing files |
6666
| `validateFile Removal` | Optional | `function` | - | Allows to cancel the removal of files |
6767

6868
`<FileInput>` also accepts the [common input props](./Inputs.md#common-input-props).
@@ -153,12 +153,12 @@ If that's not enough, you can pass a `placeholder` prop to overwrite it. The val
153153
</FileInput>
154154
```
155155

156-
## `RemoveIcon`
156+
## `removeIcon`
157157

158-
Use the `RemoveIcon` prop to change the icon displayed as the remove button:
158+
Use the `removeIcon` prop to change the icon displayed as the remove button:
159159

160160
```jsx
161-
<ImageInput source="attachments" RemoveIcon={CustomSvgIcon}>
161+
<ImageInput source="attachments" removeIcon={CustomSvgIcon}>
162162
<ImageField source="src" title="title" />
163163
</ImageInput>
164164
```

docs/ImageInput.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and
6060
| `multiple` | Optional | `boolean` | `false` | Whether the inputs can accept multiple files. |
6161
| `options` | Optional | `Object` | `{}` | Additional options passed to react-dropzone's `useDropzone()` hook. |
6262
| `placeholder` | Optional | `ReactNode` | - | Invite displayed in the drop zone |
63-
| `RemoveIcon` | Optional | `ReactNode` | [MUI's RemoveCircle icon](https://mui.com/material-ui/material-icons/?query=removeCir&selected=RemoveCircle) | The clickable icon for removing images |
63+
| `removeIcon` | Optional | `ReactNode` | [MUI's RemoveCircle icon](https://mui.com/material-ui/material-icons/?query=removeCir&selected=RemoveCircle) | The clickable icon for removing images |
6464
| `validateFile Removal` | Optional | `function` | - | Allows to cancel the removal of files |
6565

6666
`<ImageInput>` also accepts the [common input props](./Inputs.md#common-input-props).
@@ -150,12 +150,12 @@ If that's not enough, you can pass a `placeholder` prop to overwrite it. The val
150150
</ImageInput>
151151
```
152152

153-
## `RemoveIcon`
153+
## `removeIcon`
154154

155-
Use the `RemoveIcon` prop to change the icon displayed as the remove button:
155+
Use the `removeIcon` prop to change the icon displayed as the remove button:
156156

157157
```jsx
158-
<ImageInput source="pictures" RemoveIcon={CustomSvgIcon}>
158+
<ImageInput source="pictures" removeIcon={CustomSvgIcon}>
159159
<ImageField source="src" title="title" />
160160
</ImageInput>
161161
```

packages/ra-ui-materialui/src/input/FileInput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const Disabled = () => (
107107

108108
export const CustomRemoveIcon = () => (
109109
<Wrapper>
110-
<FileInput source="attachments" RemoveIcon={DeleteIcon}>
110+
<FileInput source="attachments" removeIcon={DeleteIcon}>
111111
<FileField source="src" title="title" />
112112
</FileInput>
113113
<FormInspector name="attachments" />

packages/ra-ui-materialui/src/input/FileInput.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const FileInput = (props: FileInputProps) => {
4343
onRemove: onRemoveProp,
4444
parse,
4545
placeholder,
46-
RemoveIcon,
46+
removeIcon,
4747
resource,
4848
source,
4949
validate,
@@ -195,7 +195,7 @@ export const FileInput = (props: FileInputProps) => {
195195
file={file}
196196
onRemove={onRemove(file)}
197197
className={FileInputClasses.removeButton}
198-
RemoveIcon={RemoveIcon}
198+
removeIcon={removeIcon}
199199
>
200200
<RecordContextProvider value={file}>
201201
{childrenElement}
@@ -227,7 +227,7 @@ FileInput.propTypes = {
227227
multiple: PropTypes.bool,
228228
validateFileRemoval: PropTypes.func,
229229
options: PropTypes.object,
230-
RemoveIcon: PropTypes.elementType,
230+
removeIcon: PropTypes.elementType,
231231
resource: PropTypes.string,
232232
source: PropTypes.string,
233233
placeholder: PropTypes.node,
@@ -269,7 +269,7 @@ export type FileInputProps = CommonInputProps & {
269269
options?: DropzoneOptions;
270270
onRemove?: Function;
271271
placeholder?: ReactNode;
272-
RemoveIcon?: FC<SvgIconProps>;
272+
removeIcon?: FC<SvgIconProps>;
273273
inputProps?: any;
274274
validateFileRemoval?(file): boolean | Promise<boolean>;
275275
sx?: SxProps;

packages/ra-ui-materialui/src/input/FileInputPreview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const FileInputPreview = (props: FileInputPreviewProps) => {
1313
className,
1414
onRemove,
1515
file,
16-
RemoveIcon = RemoveCircle,
16+
removeIcon: RemoveIcon = RemoveCircle,
1717
...rest
1818
} = props;
1919

@@ -50,7 +50,7 @@ FileInputPreview.propTypes = {
5050
className: PropTypes.string,
5151
file: PropTypes.object,
5252
onRemove: PropTypes.func.isRequired,
53-
RemoveIcon: PropTypes.element,
53+
removeIcon: PropTypes.element,
5454
};
5555

5656
FileInputPreview.defaultProps = {
@@ -80,5 +80,5 @@ export interface FileInputPreviewProps {
8080
className?: string;
8181
onRemove: () => void;
8282
file: any;
83-
RemoveIcon?: FC<SvgIconProps>;
83+
removeIcon?: FC<SvgIconProps>;
8484
}

packages/ra-ui-materialui/src/input/ImageInput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const Required = () => (
8686

8787
export const CustomRemoveIcon = () => (
8888
<Wrapper>
89-
<ImageInput source="image" RemoveIcon={DeleteIcon}>
89+
<ImageInput source="image" removeIcon={DeleteIcon}>
9090
<ImageField source="src" title="title" />
9191
</ImageInput>
9292
<FormInspector name="attachments" />

0 commit comments

Comments
 (0)