forked from rage/java-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmissing-info.js
More file actions
42 lines (37 loc) · 982 Bytes
/
missing-info.js
File metadata and controls
42 lines (37 loc) · 982 Bytes
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
import React from "react"
import Layout from "../templates/Layout"
import CourseOptionsEditor from "../components/user/CourseOptionsEditor"
import { navigate } from "gatsby"
import LoginStateContext, {
withLoginStateContext,
} from "../contexes/LoginStateContext"
import Container from "../components/Container"
class MissingInfo extends React.Component {
static contextType = LoginStateContext
onStepComplete = () => {
if (typeof window !== "undefined") {
window.history.back()
return
}
navigate("/")
}
render() {
if (!this.context.loggedIn) {
if (typeof window !== "undefined") {
navigate("/sign-in")
}
return <div>Redirecting...</div>
}
return (
<Layout>
<Container>
<CourseOptionsEditor
courseVariant="nodl"
onComplete={this.onStepComplete}
/>
</Container>
</Layout>
)
}
}
export default withLoginStateContext(MissingInfo)