Skip to content

Commit ac26825

Browse files
committed
Use node 16 and legacy-peer-deps for build and deploy
1 parent a63eb1d commit ac26825

File tree

6 files changed

+259
-110
lines changed

6 files changed

+259
-110
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
steps:
1111
- name: Checkout 🛎️
1212
uses: actions/[email protected]
13-
- name: Use Node 14
13+
- name: Use Node 16
1414
uses: actions/setup-node@v3
1515
with:
16-
node-version: '14.x'
16+
node-version: '16.x'
1717
- name: Install and Build
1818
run: |
19-
npm ci
19+
npm ci --legacy-peer-deps
2020
npm run build
2121
- name: Deploy 🚀
2222
uses: JamesIves/[email protected]

package-lock.json

+148
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"node": "16.x"
55
},
66
"dependencies": {
7+
"@apollo/client": "^3.7.15",
78
"@fortawesome/fontawesome-free": "^6.2.1",
89
"@fortawesome/fontawesome-svg-core": "^6.2.1",
910
"@fortawesome/free-brands-svg-icons": "^6.2.1",

src/partials/Points/PointsImpl.js

+68-68
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
// import React from "react"
2-
// import withSimpleErrorBoundary from "../../util/withSimpleErrorBoundary"
3-
// import CourseSettings from "../../../course-settings"
1+
import React from "react"
2+
import withSimpleErrorBoundary from "../../util/withSimpleErrorBoundary"
3+
import CourseSettings from "../../../course-settings"
44

5-
// import { useQuery } from "@apollo/client/react"
6-
// import { gql } from "apollo-boost"
7-
// import { Button } from "@material-ui/core"
8-
// import OverallPoints from "./OverallPoints"
5+
import { useQuery } from "@apollo/client"
6+
import { gql } from "apollo-boost"
7+
import { Button } from "@material-ui/core"
8+
import OverallPoints from "./OverallPoints"
99

10-
// const PROGRESS = gql`
11-
// {
12-
// currentUser {
13-
// email
14-
// progress(course_id: "59314cb4-a9ca-43c9-b9a7-58c19325b44c") {
15-
// course {
16-
// id
17-
// name
18-
// }
19-
// user_course_progress {
20-
// id
21-
// progress
22-
// }
23-
// user_course_service_progresses {
24-
// id
25-
// progress
26-
// service {
27-
// id
28-
// name
29-
// }
30-
// }
31-
// }
32-
// }
33-
// }
34-
// `
10+
const PROGRESS = gql`
11+
{
12+
currentUser {
13+
email
14+
progress(course_id: "59314cb4-a9ca-43c9-b9a7-58c19325b44c") {
15+
course {
16+
id
17+
name
18+
}
19+
user_course_progress {
20+
id
21+
progress
22+
}
23+
user_course_service_progresses {
24+
id
25+
progress
26+
service {
27+
id
28+
name
29+
}
30+
}
31+
}
32+
}
33+
}
34+
`
3535

36-
// const Points = (props) => {
37-
// const course = props.course || CourseSettings.default.slug
38-
// const { data, loading, error, refetch } = useQuery(PROGRESS)
36+
const Points = (props) => {
37+
const course = props.course || CourseSettings.default.slug
38+
const { data, loading, error, refetch } = useQuery(PROGRESS)
3939

40-
// if (loading) {
41-
// return <>Loading...</>
42-
// }
40+
if (loading) {
41+
return <>Loading...</>
42+
}
4343

44-
// if (error) {
45-
// return <>Error while fetching progress: {error}</>
46-
// }
44+
if (error) {
45+
return <>Error while fetching progress: {error}</>
46+
}
4747

48-
// if (!data || !data.currentUser) {
49-
// return (
50-
// <>
51-
// <Button
52-
// onClick={() => {
53-
// refetch()
54-
// }}
55-
// >
56-
// Refresh
57-
// </Button>
58-
// <p>Please log in to see your points.</p>
59-
// </>
60-
// )
61-
// }
48+
if (!data || !data.currentUser) {
49+
return (
50+
<>
51+
<Button
52+
onClick={() => {
53+
refetch()
54+
}}
55+
>
56+
Refresh
57+
</Button>
58+
<p>Please log in to see your points.</p>
59+
</>
60+
)
61+
}
6262

63-
// const points = data.currentUser.progress.user_course_progress.progress[0]
64-
// const courseName = data.currentUser.progress.course.name
65-
// return (
66-
// <>
67-
// <OverallPoints
68-
// refetch={refetch}
69-
// courseName={courseName}
70-
// progress={data.currentUser.progress}
71-
// />
72-
// </>
73-
// )
74-
// }
63+
const points = data.currentUser.progress.user_course_progress.progress[0]
64+
const courseName = data.currentUser.progress.course.name
65+
return (
66+
<>
67+
<OverallPoints
68+
refetch={refetch}
69+
courseName={courseName}
70+
progress={data.currentUser.progress}
71+
/>
72+
</>
73+
)
74+
}
7575

76-
// export default withSimpleErrorBoundary(Points)
76+
export default withSimpleErrorBoundary(Points)

0 commit comments

Comments
 (0)