This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/src/pages/dashboard.tsx

46 lines
1.3 KiB
TypeScript
Raw Normal View History

2018-08-26 14:23:48 +00:00
import * as React from "react";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
2018-08-26 15:12:07 +00:00
import Paper from "@material-ui/core/Paper";
import Scoreboard from "../components/scoreboard";
2018-08-26 14:23:48 +00:00
import { ILesson } from "../models/lesson";
2018-08-26 15:12:07 +00:00
import { ILearner } from "../models/learner";
2018-08-26 14:23:48 +00:00
interface IProps {
lessons: ILesson[];
2018-08-26 15:12:07 +00:00
learners: ILearner[];
2018-08-26 14:23:48 +00:00
}
export default class Dashboard extends React.Component<{}> {
render() {
const small = window.matchMedia("(max-width: 700px)").matches;
2018-08-26 15:12:07 +00:00
const direction = small ? "column" : "row";
2018-08-26 14:23:48 +00:00
2018-08-26 15:12:07 +00:00
return <Grid container direction={direction} spacing={16}>
<Grid item lg={4}>
<Paper className="paper">
N&auml;chstes Level
</Paper>
</Grid>
<Grid item lg={4}>
<Paper className="paper">
<Typography variant="title" component="p">
2018-08-26 17:27:21 +00:00
Rangliste: Top 10
2018-08-26 15:12:07 +00:00
</Typography>
2018-08-26 14:23:48 +00:00
2018-08-26 17:27:21 +00:00
<Scoreboard learners={this.props.learners.slice(0, 10)} />
2018-08-26 15:12:07 +00:00
</Paper>
</Grid>
<Grid item lg={4}>
<Paper className="paper">
Some stuff
</Paper>
</Grid>
</Grid>;
2018-08-26 14:23:48 +00:00
}
};