Skip to content

Commit

Permalink
change chevronDirection in RTL
Browse files Browse the repository at this point in the history
  • Loading branch information
alikazemkhanloo authored Mar 9, 2020
1 parent 697e037 commit 48dc786
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/ra-ui-materialui/src/list/PaginationActions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Button from '@material-ui/core/Button';
import { makeStyles } from '@material-ui/core/styles';
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';
Expand All @@ -22,6 +22,7 @@ function PaginationActions(props) {
const { page, rowsPerPage, count, onChangePage, color, size } = props;
const classes = useStyles(props);
const translate = useTranslate();
const theme = useTheme();
/**
* Warning: material-ui's page is 0-based
*/
Expand Down Expand Up @@ -126,7 +127,7 @@ function PaginationActions(props) {
onClick={prevPage}
className="previous-page"
>
<ChevronLeft />
{theme.direction === "rtl" ? <ChevronRight /> : <ChevronLeft />}
{translate('ra.navigation.prev')}
</Button>
)}
Expand All @@ -140,7 +141,7 @@ function PaginationActions(props) {
className="next-page"
>
{translate('ra.navigation.next')}
<ChevronRight />
{theme.direction === "rtl" ? <ChevronLeft /> : <ChevronRight />}
</Button>
)}
</div>
Expand All @@ -163,6 +164,7 @@ PaginationActions.propTypes = {
rowsPerPage: PropTypes.number.isRequired,
color: PropTypes.oneOf(['primary', 'secondary']),
size: PropTypes.oneOf(['small', 'medium', 'large']),
theme: PropTypes.object.isRequired,
};

PaginationActions.defaultProps = {
Expand Down

0 comments on commit 48dc786

Please sign in to comment.