feat: Display the level cap
This commit is contained in:
@@ -22,7 +22,7 @@ import HomeIcon from "@material-ui/icons/Home";
|
||||
import BookIcon from "@material-ui/icons/Book";
|
||||
import ViewWeekIcon from "@material-ui/icons/ViewWeek";
|
||||
|
||||
import { IUser } from "../models/user";
|
||||
import { IUser, userScoreToLevel } from "../models/user";
|
||||
|
||||
interface IProps {
|
||||
logout: () => void;
|
||||
@@ -43,6 +43,8 @@ export default class Drawer extends React.Component<IProps> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const level = userScoreToLevel(this.props.user.score);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<AppBar position="static">
|
||||
@@ -62,7 +64,7 @@ export default class Drawer extends React.Component<IProps> {
|
||||
{
|
||||
this.props.authenticated ? (
|
||||
<Button color="inherit">
|
||||
{`${this.props.user.score} / 200`}
|
||||
{`${this.props.user.score} / ${level.levelCap}`}
|
||||
</Button>
|
||||
) : undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user