forked from rage/java-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoodleExercise.js
More file actions
50 lines (43 loc) · 1.28 KB
/
MoodleExercise.js
File metadata and controls
50 lines (43 loc) · 1.28 KB
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
import React from "react"
import styled from "styled-components"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faUniversity as icon } from "@fortawesome/free-solid-svg-icons"
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
import { normalizeExerciseId } from "../util/strings"
const Wrapper = styled.aside`
padding 1rem;
margin-bottom: 2rem;
border-left: 0.2rem solid var(--color);
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
border-radius: 4px;
`
const StyledIcon = styled(FontAwesomeIcon)`
vertical-align: middle;
margin-right: 1rem;
margin-left: 0.5rem;
color: var(--color);
`
const Header = styled.h3`
font-size: 1.3rem;
font-weight: normal;
padding-bottom: 1rem;
border-bottom: 1px solid #f7f7f9;
`
const Body = styled.div`
padding-bottom: 0.5rem;
`
const MoodleExercise = (props) => {
return (
<Wrapper
id={normalizeExerciseId(`moodle-exercise-${props.name}`)}
style={{ "--color": "#528afc" }}
>
<Header>
<StyledIcon icon={icon} size="1x" />
Moodle-tehtävä: {props.name}
</Header>
<Body>{props.children}</Body>
</Wrapper>
)
}
export default withSimpleErrorBoundary(MoodleExercise)