Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import * as React from "react";
import { NavLink } from "react-router-dom";
import styled from "styled-components";
import { HSpacing, ListItem } from "../../../stylesheets/Mixins";
import { px } from "../../../stylesheets/Units";
import { ClassItemWrapperBase } from "./ClassItemWrapperBase";
export class ClassItemWrapper extends ClassItemWrapperBase {
protected Code = styled.div`
font-weight: bold;
justify-self: center;
align-self: center;
`;
protected Title = styled.div`
align-self: center;
justify-self: start;
`;
protected InnerDiv = styled.div`
display: flex;
color: #000;
${HSpacing(px(20))};
&.active {
color: white;
background-color: #236aa7;
&:after {
border-bottom-color: transparent;
}
}
`;
protected Wrapper = styled(NavLink)`
${ListItem()};
text-decoration: none;
padding-right: 20px;
padding-left: 20px;
`;
public render() {
const { course, clazz } = this.props;
const { Code, Title, InnerDiv, Wrapper } = this;
return (
<Wrapper
activeClassName="active"
to={`/courses/${course.code}/${clazz.code}`}>
<InnerDiv>
<Code>{clazz.code}</Code>
<Title>{clazz.title}</Title>
</InnerDiv>
</Wrapper>
);
}
}