Skip to content

Commit

Permalink
Fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw committed Dec 11, 2019
1 parent 529cfdb commit 6fafb15
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
16 changes: 11 additions & 5 deletions docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,16 +754,22 @@ You can use the `empty` prop to replace that page by a custom component:
{% raw %}

```jsx
import Box from '@material-ui/core/Box';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import { CreateButton, List } from 'react-admin';

const Empty = ({ basePath, resource }) => (
<div style={{ textAlign: 'center', margin: '1em' }}>
<h1>No products available</h1>
<div>Create one or import from a file</div>
<Box textAlign="center" m={1}>
<Typography variant="h4" paragraph>
No products available
</Typography>
<Typography variant="body1">
Create one or import from a file
</Typography>
<CreateButton basePath={basePath} />
<Button onClick={...}>Import</Button>
</div>
</Box>
);

const ProductList = props => (
Expand Down Expand Up @@ -808,7 +814,7 @@ const PostList = props => (
...
</List>
);
````
```

The default value for the `component` prop is `Card`.

Expand Down
10 changes: 7 additions & 3 deletions packages/ra-ui-materialui/src/list/Empty.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Inbox from '@material-ui/icons/Inbox';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/styles';
import { useTranslate } from 'ra-core';
import { CreateButton } from '../button';
Expand All @@ -8,7 +9,6 @@ import inflection from 'inflection';
const useStyles = makeStyles({
message: {
textAlign: 'center',
fontFamily: 'Roboto, sans-serif',
opacity: 0.5,
margin: '0 1em',
},
Expand Down Expand Up @@ -38,8 +38,12 @@ const Empty = ({ resource, basePath }) => {
<>
<div className={classes.message}>
<Inbox className={classes.icon} />
<h1>{translate('ra.page.empty', { name: resourceName })}</h1>
<div>{translate('ra.page.invite')}</div>
<Typography variant="h4" paragraph>
{translate('ra.page.empty', { name: resourceName })}
</Typography>
<Typography variant="body1">
{translate('ra.page.invite')}
</Typography>
</div>
<div className={classes.toolbar}>
<CreateButton variant="contained" basePath={basePath} />
Expand Down

0 comments on commit 6fafb15

Please sign in to comment.