Skip to content

Commit

Permalink
Merge pull request #4524 from WiXSL/fix-docs-createedit-example
Browse files Browse the repository at this point in the history
Fix code sample in CreateEdit docs.
  • Loading branch information
fzaninotto authored Mar 13, 2020
2 parents aaeff7f + 0fc88d3 commit 27b4b61
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/CreateEdit.md
Original file line number Diff line number Diff line change
Expand Up @@ -1042,18 +1042,28 @@ The `<SimpleForm>` and `<TabbedForm>` layouts are quite simple. In order to bett
Here is an example of such custom form, taken from the Posters Galore demo. It uses [material-ui's `<Box>` component](https://material-ui.com/components/box/), and it's a good starting point for your custom form layouts.

```jsx
import React from 'react';
import {
FormWithRedirect,
DateInput,
SelectArrayInput,
TextInput,
Toolbar,
SaveButton,
DeleteButton,
NullableBooleanInput,
} from 'react-admin';
import { CardContent, Typography, Box, Toolbar } from '@material-ui/core';
const VisitorForm = (props) => (
import { Typography, Box, Toolbar } from '@material-ui/core';
const segments = [
{ id: 'compulsive', name: 'Compulsive' },
{ id: 'collector', name: 'Collector' },
{ id: 'ordered_once', name: 'Ordered Once' },
{ id: 'regular', name: 'Regular' },
{ id: 'returns', name: 'Returns' },
{ id: 'reviewer', name: 'Reviewer' },
];
const VisitorForm = props => (
<FormWithRedirect
{...props}
render={formProps => (
Expand Down

0 comments on commit 27b4b61

Please sign in to comment.