我正在使用 Material UI 的分页组件,并希望组件的文本部分为灰色。我想要的颜色是白色的动作按钮和灰色的文本部分。有什么办法可以让我决定文本部分的颜色吗?本质上希望文本像照片中的左操作箭头一样是灰色的。
import React from 'react';
import TablePagination from '@material-ui/core/TablePagination';
import PropTypes from 'prop-types';
import { withTheme, withStyles } from '@material-ui/core/styles';
const styles = theme => ({
root: {
flexShrink: 0,
color: theme.palette.common.white,
marginLeft: theme.spacing.unit * 2.5,
},
});
const PortfolioPagination = ({
numOfItems, rowsPerPage, page, handleChangePage, classes
}) => {
return (
<div >
<TablePagination
component="div"
className={classes.root}
count={numOfItems}
page={page}
onChangePage={handleChangePage}
rowsPerPageOptions={[]}
rowsPerPage={rowsPerPage} />
</div>
);
};
PortfolioPagination.defaultProps = {
};
PortfolioPagination.propTypes = {
classes: PropTypes.object.isRequired,
numOfItems: PropTypes.number.isRequired,
rowsPerPage: PropTypes.number.isRequired,
page: PropTypes.number.isRequired,
handleChangePage: PropTypes.func.isRequired,
};
export default withTheme()(withStyles(styles)(PortfolioPagination));