Skip to content

Commit fb49535

Browse files
author
Moritz Gramlich
committed
adapt documentation
1 parent db67e5b commit fb49535

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

docs/FileInput.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and
5555

5656
| Prop | Required | Type | Default | Description |
5757
|------------------------|----------|---------------------|-----------|---------------------------------------------------------------------|
58-
| `accept` | Optional | `string | string[]` | - | Accepted file type(s). When empty, all file types are accepted. |
58+
| `accept` | Optional | `string | string[]` | - | Accepted file type(s). When empty, all file types are accepted. |
5959
| `children` | Optional | `ReactNode` | - | Element used to preview file(s) |
6060
| `minSize` | Optional | `number` | 0 | Minimum file size (in bytes), e.g. 5000 for 5KB |
6161
| `maxSize` | Optional | `number` | `Infinity` | Maximum file size (in bytes), e.g. 5000000 for 5MB |
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 images |
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,9 +153,9 @@ 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-
Optionally overwrite the [default icon](https://mui.com/material-ui/material-icons/?query=removeCir&selected=RemoveCircle) for removing files:
158+
Use the `RemoveIcon` prop to change the icon displayed as the remove button:
159159

160160
```jsx
161161
<ImageInput source="attachments" RemoveIcon={CustomSvgIcon}>

docs/ImageInput.md

Lines changed: 3 additions & 3 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,9 +150,9 @@ 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-
Optionally overwrite the [default icon](https://mui.com/material-ui/material-icons/?query=removeCir&selected=RemoveCircle) for removing images:
155+
Use the `RemoveIcon` prop to change the icon displayed as the remove button:
156156

157157
```jsx
158158
<ImageInput source="pictures" RemoveIcon={CustomSvgIcon}>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 = {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AdminContext } from '../AdminContext';
66
import { Create } from '../detail';
77
import { SimpleForm } from '../form';
88
import { ImageInput } from './ImageInput';
9-
import { FileField, ImageField } from '../field';
9+
import { ImageField } from '../field';
1010
import { required } from 'ra-core';
1111
import { FormInspector } from './common.stories';
1212
import DeleteIcon from '@mui/icons-material/DeleteOutline';
@@ -87,7 +87,7 @@ export const Required = () => (
8787
export const CustomRemoveIcon = () => (
8888
<Wrapper>
8989
<ImageInput source="image" RemoveIcon={DeleteIcon}>
90-
<FileField source="src" title="title" />
90+
<ImageField source="src" title="title" />
9191
</ImageInput>
9292
<FormInspector name="attachments" />
9393
</Wrapper>

0 commit comments

Comments
 (0)