feat: Display the level cap

This commit is contained in:
Alexander Polynomdivision
2018-09-20 19:54:03 +02:00
parent 466e5a3107
commit 8ab29bece8
4 changed files with 61 additions and 3 deletions

View File

@@ -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
}