Skip to content

Commit

Permalink
Fix code sample in CreateEdit docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvarcas committed Mar 13, 2020
1 parent 594b6a1 commit 0fc88d3
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 0fc88d3

Please sign in to comment.