Skip to content

Commit

Permalink
revert rating changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krzotki committed Jul 29, 2024
1 parent e0f14ef commit 1218c69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 40 deletions.
30 changes: 0 additions & 30 deletions src/components/rating/Rating.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,19 @@ import RatingA11y from './stories/Rating.a11y.mdx';
size: {
table: {defaultValue: {summary: RATING_SIZE.XS}},
},
rate: {
table: {
defaultValue: {
summary: 0,
},
},
},
metricSize: {
table: {
defaultValue: {
summary: 5,
},
},
},
'aria-label': {
table: {
defaultValue: {
summary: 'current rate',
},
},
},
onMouseLeave: {
table: {
category: 'Events',
defaultValue: {
summary: '() => undefined',
},
},
},
onStarMouseEnter: {
table: {
category: 'Events',
defaultValue: {
summary: '() => undefined',
},
},
},
onChange: {
table: {
category: 'Events',
defaultValue: {
summary: '() => undefined',
},
},
},
}}
Expand Down
20 changes: 10 additions & 10 deletions src/components/rating/Rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ export type RatingPropsType = {
/* eslint-disable react/default-props-match-prop-types */
// legacy files without proper flow checks can suffer from this

const defaultProps: RatingPropsType = {
onChange: () => undefined,
onStarMouseEnter: () => undefined,
onMouseLeave: () => undefined,
metricSize: 5,
rate: 0,
'aria-label': 'current rate',
};

class Rating extends React.Component<RatingPropsType> {
constructor(props = defaultProps) {
static defaultProps = {
onChange: () => undefined,
onStarMouseEnter: () => undefined,
onMouseLeave: () => undefined,
metricSize: 5,
rate: 0,
'aria-label': 'current rate',
};

constructor(props: RatingPropsType) {
super(props);
this.createStarsOnChangeFunctions(this.props.metricSize);
this.createStarsMouseEnterFunctions(this.props.metricSize);
Expand Down

0 comments on commit 1218c69

Please sign in to comment.