Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Fix outdated SimpleShowLayout doc about custom styles #2707

Merged
merged 1 commit into from
Dec 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions docs/Show.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ React-admin provides guessers for the `List` view (`ListGuesser`), the `Edit` vi

The `<SimpleShowLayout>` component receives the `record` as prop from its parent component. It is responsible for rendering the actual view.

The `<SimpleShowLayout>` renders its child components line by line (within `<div>` components).
The `<SimpleShowLayout>` renders its child components line by line (within `<div>` components) inside a material-ui `<CardContent/>`.

```jsx
export const PostShow = (props) => (
Expand All @@ -200,28 +200,7 @@ export const PostShow = (props) => (
);
```

It is possible to override its style by specifying the `style` prop, for example:

```jsx
const styles = {
container: {
display: 'flex',
},
item: {
marginRight: '1rem',
},
};

export const PostShow = (props) => (
<Show {...props}>
<SimpleShowLayout style={styles.container}>
<TextField source="title" style={styles.item} />
<RichTextField source="body" style={styles.item} />
<NumberField source="nb_views" style={styles.item} />
</SimpleShowLayout>
</Show>
);
```
It accepts a `className` prop to let you override the style of the `<CardContent/>`.

## The `<TabbedShowLayout>` component

Expand Down