Skip to content

Commit

Permalink
Merge pull request #4891 from marmelab/pagination-styles
Browse files Browse the repository at this point in the history
Allow to style pagination buttons
  • Loading branch information
fzaninotto committed Jun 3, 2020
2 parents 02f4923 + 3ce8c3a commit 70284c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ra-ui-materialui/src/list/PaginationActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { makeStyles, useTheme } from '@material-ui/core/styles';
import ChevronLeft from '@material-ui/icons/ChevronLeft';
import ChevronRight from '@material-ui/icons/ChevronRight';
import { useTranslate } from 'ra-core';
import classnames from 'classnames';

const useStyles = makeStyles(
theme => ({
Expand All @@ -13,6 +14,8 @@ const useStyles = makeStyles(
color: theme.palette.text.secondary,
marginLeft: 20,
},
button: {},
currentPageButton: {},
hellip: { padding: '1.2em' },
}),
{ name: 'RaPaginationActions' }
Expand Down Expand Up @@ -99,7 +102,9 @@ function PaginationActions(props) {
) : (
<Button
size={size}
className="page-number"
className={classnames('page-number', classes.button, {
[classes.currentPageButton]: pageNum === page + 1,
})}
color={pageNum === page + 1 ? 'default' : color}
key={pageNum}
data-page={pageNum - 1}
Expand Down

0 comments on commit 70284c3

Please sign in to comment.