Skip to content

Commit 36337c2

Browse files
committed
added a test for single student overview and some styling/functionality for single student overview pages
1 parent a0df950 commit 36337c2

File tree

18 files changed

+1299
-407
lines changed

18 files changed

+1299
-407
lines changed

package-lock.json

Lines changed: 34 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"formik": "^2.2.6",
3131
"get-video-id": "^3.2.0",
3232
"graphql": "^15.5.0",
33+
"history": "^5.0.0",
3334
"react": "^17.0.2",
3435
"react-bootstrap": "^1.5.2",
3536
"react-dom": "^17.0.2",

src/Components/Content/Content.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import SingleStudentOverview from '../SingleStudentOverview/SingleStudentOvervie
88
import SingleStudentMasteryOverview from '../SingleStudentMasteryOverview/SingleStudentMasteryOverview';
99
import CourseHome from '../CourseHome/CourseHome';
1010
import SingleTargetOverview from '../SingleTargetOverview/SingleTargetOverview';
11+
import SingleMissionOverview from '../SingleStudentOverview/SingleMissionOverview';
12+
1113
import TaskView from '../../Screens/TaskView/TaskView';
1214
import ClassMastery from '../../Screens/ClassMastery/ClassMastery';
1315
import './Content.css';
@@ -40,6 +42,9 @@ export default function Content() {
4042
<Route path="/singleTargetOverview">
4143
<SingleTargetOverview />
4244
</Route>
45+
<Route path="/singleMissionOverview/:name">
46+
<SingleMissionOverview />
47+
</Route>
4348
<Route path="/viewTask">
4449
<TaskView taskId="90e0c730e56" />
4550
</Route>

src/Components/LinearProgressWithLabel/MissionDropDown.tsx

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import Collapse from '@material-ui/core/Collapse';
88
import ExpandLess from '@material-ui/icons/ExpandLess';
99
import ExpandMore from '@material-ui/icons/ExpandMore';
1010
import { Link } from 'react-router-dom';
11+
import { Divider } from '@material-ui/core';
1112
import LinearProgressWithLabel from './LinearProgressWithLabel';
12-
import ObjectiveDropDown from './ObjectiveDropDown';
1313
import { MissionSubMission } from '../../interfaces/MissionSubMission';
1414
import { TaskStats } from '../../__generated__/types';
1515

@@ -29,12 +29,8 @@ const useStyles = makeStyles((theme: Theme) =>
2929
})
3030
);
3131

32-
const PaddedDiv = styled.div`
33-
padding-left: 10px;
34-
`;
35-
3632
const DoublePaddedDiv = styled.div`
37-
padding-left: 30px;
33+
padding-left: 40px;
3834
width: 100%;
3935
justify-content: left;
4036
`;
@@ -59,23 +55,14 @@ export default function MissionDropDown({ name, progress }: MissionDropDownProps
5955
const TARGET_PERCENT = 50;
6056

6157
return (
62-
<List component="nav" aria-labelledby="nested-list-subheader" className={classes.root}>
63-
<PaddedDiv>
64-
<ListItem
65-
button
66-
onClick={() => handleClick(open, setOpen)}
67-
style={{
68-
borderTop: '1px',
69-
borderBottom: '1px',
70-
borderColor: '#C2D2FC',
71-
borderStyle: 'solid',
72-
}}
73-
>
74-
{open ? <ExpandLess /> : <ExpandMore />}
75-
<ListItemText primary={name} />
76-
<LinearProgressWithLabel className={classes.progressBar} value={TARGET_PERCENT} />
77-
</ListItem>
78-
</PaddedDiv>
58+
<List component="div" disablePadding>
59+
<ListItem button onClick={() => handleClick(open, setOpen)}>
60+
{open ? <ExpandLess /> : <ExpandMore />}
61+
<ListItemText primary={name} />
62+
<LinearProgressWithLabel className={classes.progressBar} value={TARGET_PERCENT} />
63+
</ListItem>
64+
65+
<Divider orientation="horizontal" />
7966
<Collapse in={open} timeout="auto" unmountOnExit>
8067
{progress.map((task: TaskStats) => (
8168
<Link to="/viewTask">

src/Components/LinearProgressWithLabel/ObjectiveDropDown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function TargetDropDown({ name, tasks }: ObjectiveDropDownProps)
5454
const OBJECTIVE_PERCENT = 50;
5555

5656
return (
57-
<List component="div" disablePadding>
57+
<List component="div" disablePadding style={{ justifyContent: 'right', width: '100%' }}>
5858
<ListItem button onClick={() => handleClick(open, setOpen)} divider>
5959
{open ? <ExpandLess /> : <ExpandMore />}
6060
<ListItemText primary={name} />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.dashboard-container {
2+
display: flex;
3+
flex-wrap: wrap;
4+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.mission-card {
2+
border: 1px solid gray;
3+
margin: 12px;
4+
box-sizing: border-box;
5+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
6+
border-radius: 4px;
7+
overflow: hidden;
8+
background: #fff;
9+
width: 262px;
10+
height: 120px;
11+
display: inline-block;
12+
vertical-align: top;
13+
margin: 36px 0 0 36px;
14+
// padding: 5px;
15+
}
16+
17+
.mission-card {
18+
.mission-title {
19+
font-size: 1.2em;
20+
color: black;
21+
text-overflow: ellipsis;
22+
display: inline-block;
23+
}
24+
25+
.mission-card-header {
26+
display: block;
27+
height: 30px;
28+
background-color: #2f80ed;
29+
}
30+
31+
.mission-card-body {
32+
padding: 12px;
33+
text-align: center;
34+
}
35+
}

0 commit comments

Comments
 (0)