-
-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Description
See image below.
# cat client/node_modules/material-ui-rating/package.json | grep version
"version": "4.1.0",
Here's my Rating component, there's no `iconHovered` in there
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import MuiRating from 'material-ui-rating'
import { withStyles } from '@material-ui/core'
class Rating extends Component {
static propTypes = {
classes: PropTypes.object.isRequired,
value: PropTypes.number.isRequired,
muiRatingClasses: PropTypes.object,
readOnly: PropTypes.bool,
}
static defaultProps = {
muiRatingClasses: {},
readOnly: true,
}
render() {
const {
classes,
value,
muiRatingClasses,
readOnly,
...restOfProps
} = this.props
return (
<MuiRating
classes={{
root: classes.starsRoot,
icon: classes.star,
iconButton: classes.starButton,
...muiRatingClasses,
}}
value={value}
readOnly
{...restOfProps}
/>
)
}
}
const HEIGHT = 20
const styles = () => ({
starsRoot: {
display: 'flex',
alignItems: 'center',
height: HEIGHT,
},
starButton: {
padding: 0,
margin: 0,
transform: 'scaleX(-1)',
'& > span': {
height: HEIGHT,
},
},
star: {
height: HEIGHT,
width: 16,
},
})
export default withStyles(styles)(Rating)
can you look into it? thanks!
brauliodiez
Metadata
Metadata
Assignees
Labels
No labels