Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
asvarcas committed Jun 7, 2021
1 parent 0bae294 commit 23373e6
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,39 +136,17 @@ import IconEvent from '@material-ui/icons/Event';
const ListActions = (props) => {
const {
className,
exporter,
filters,
maxResults,
...rest
} = props;
const {
currentSort,
resource,
displayedFilters,
filterValues,
hasCreate,
basePath,
selectedIds,
showFilter,
total,
} = useListContext();
return (
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
{filters && cloneElement(filters, {
resource,
showFilter,
displayedFilters,
filterValues,
context: 'button',
})}
<CreateButton basePath={basePath} />
<ExportButton
disabled={total === 0}
resource={resource}
sort={currentSort}
filterValues={filterValues}
maxResults={maxResults}
/>
{cloneElement(filters, { context: 'button' })}
<CreateButton />
<ExportButton disabled={total === 0} maxResults={maxResults} />
{/* Add your custom actions */}
<Button
onClick={() => { alert('Your custom action'); }}
Expand Down

0 comments on commit 23373e6

Please sign in to comment.