-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rating] Move from lab to core (#22725)
- Loading branch information
Showing
38 changed files
with
971 additions
and
918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Rating from '@material-ui/core/Rating'; | ||
import Typography from '@material-ui/core/Typography'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
'& > legend': { | ||
marginTop: theme.spacing(2), | ||
}, | ||
}, | ||
})); | ||
|
||
export default function BasicRating() { | ||
const classes = useStyles(); | ||
const [value, setValue] = React.useState(2); | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Typography component="legend">Controlled</Typography> | ||
<Rating | ||
name="simple-controlled" | ||
value={value} | ||
onChange={(event, newValue) => { | ||
setValue(newValue); | ||
}} | ||
/> | ||
<Typography component="legend">Read only</Typography> | ||
<Rating name="read-only" value={value} readOnly /> | ||
<Typography component="legend">Disabled</Typography> | ||
<Rating name="disabled" value={value} disabled /> | ||
<Typography component="legend">No rating given</Typography> | ||
<Rating name="no-value" value={null} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as React from 'react'; | ||
import { makeStyles, createStyles } from '@material-ui/core/styles'; | ||
import Rating from '@material-ui/core/Rating'; | ||
import Typography from '@material-ui/core/Typography'; | ||
|
||
const useStyles = makeStyles((theme) => | ||
createStyles({ | ||
root: { | ||
'& > legend': { | ||
marginTop: theme.spacing(2), | ||
}, | ||
}, | ||
}), | ||
); | ||
|
||
export default function BasicRating() { | ||
const classes = useStyles(); | ||
const [value, setValue] = React.useState<number | null>(2); | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Typography component="legend">Controlled</Typography> | ||
<Rating | ||
name="simple-controlled" | ||
value={value} | ||
onChange={(event, newValue) => { | ||
setValue(newValue); | ||
}} | ||
/> | ||
<Typography component="legend">Read only</Typography> | ||
<Rating name="read-only" value={value} readOnly /> | ||
<Typography component="legend">Disabled</Typography> | ||
<Rating name="disabled" value={value} disabled /> | ||
<Typography component="legend">No rating given</Typography> | ||
<Rating name="no-value" value={null} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.