feat: Display the level cap

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

No files matched your search

+4 -2
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
}