Skip to content

Commit 7386304

Browse files
authored
Merge pull request #83 from usingbrain/main
pull changes
2 parents 786df63 + a5b9f39 commit 7386304

15 files changed

Lines changed: 248 additions & 92 deletions

File tree

client/src/App.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,32 @@ function App() {
2828
return (
2929
<Provider value={client}>
3030
<BrowserRouter>
31-
<div className="App">
31+
<div className='App'>
3232
<Routes>
3333
<Route exact path="/" element={<Welcome />} />
3434
<Route path="/homepage" element={<Homepage />}>
35-
<Route
36-
path="/homepage/dashboard"
37-
element={<Instruction />}
38-
></Route>
3935
<Route path="/homepage/new-course" element={<AddForm />}></Route>
4036
<Route path="/homepage/classes/:courseId" element={<ClassView />}>
4137
<Route
42-
path="/homepage/classes/:courseId/history"
38+
path='/homepage/classes/:courseId/history'
4339
element={<Overview />}
4440
></Route>
4541
<Route
46-
path="/homepage/classes/:courseId/:sessionId"
42+
path='/homepage/classes/:courseId/:sessionId'
4743
element={<SessionHistory />}
4844
></Route>
4945
<Route
50-
path="/homepage/classes/:courseId/student/:studentId"
46+
path='/homepage/classes/:courseId/student/:studentId'
5147
element={<StudentHistory />}
5248
></Route>
5349
</Route>
5450
</Route>
5551
<Route>
56-
<Route path="/login" element={<Login />} />
57-
<Route path="/register" element={<Register />} />
52+
<Route path='/login' element={<Login />} />
53+
<Route path='/register' element={<Register />} />
5854
</Route>
59-
<Route path="/student" element={<StudentDashboard />}></Route>
60-
<Route path="/:type/:id" element={<QrView />}></Route>
55+
<Route path='/student' element={<StudentDashboard />}></Route>
56+
<Route path='/:type/:id' element={<QrView />}></Route>
6157
</Routes>
6258
</div>
6359
</BrowserRouter>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":10,"ip":0,"op":18,"w":1080,"h":1080,"nm":"animation-check","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"check-green","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[648.25,452.934,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-228.247,53.339],[-114.37,166.806],[228.162,-167.15]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.6392156862745098,0.5764705882352941,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":54,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":12,"s":[0]},{"t":16,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":12,"s":[0]},{"t":16,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":100,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"circle-green","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[535.795,535.568,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[98.386,98.386,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[729.85,729.85],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.6392156862745098,0.5764705882352941,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":54,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[3.718,3.742],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100.623,100.623],"ix":3},"r":{"a":0,"k":27.796,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":4,"s":[100]},{"t":10,"s":[15.2]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":4,"s":[100]},{"t":10,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":100,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"check-grey","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[647.852,452.832,0],"ix":2},"a":{"a":0,"k":[163,124.5,0],"ix":1},"s":{"a":0,"k":[158.358,158.358,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[6.56,6.716],[6.716,-6.56],[0,0],[0,0],[6.639,-6.639],[-6.639,-6.639],[0,0],[-6.66,6.506],[0,0]],"o":[[-6.561,-6.716],[0,0],[0,0],[-6.639,-6.639],[-6.639,6.639],[0,0],[6.584,6.584],[0,0],[6.716,-6.561]],"v":[[156.131,-117.352],[132.09,-117.634],[-71.89,81.625],[-132.01,21.506],[-156.051,21.506],[-156.051,45.548],[-84.051,117.548],[-60.152,117.688],[155.848,-93.312]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.902000038297,0.902000038297,0.902000038297,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[162.94,124.444],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":800,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"circle-grey","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[540,540,0],"ix":2},"a":{"a":0,"k":[245.5,245.5,0],"ix":1},"s":{"a":0,"k":[158.358,158.358,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[65.441,0],[46.274,46.275],[0,65.441],[-46.275,46.274],[-65.442,0],[-34.872,-18.345],[4.371,-8.309],[8.311,4.37],[34.158,0],[0,-116.346],[-116.346,0],[0,116.346],[1.122,8.839],[-9.314,1.183],[-1.182,-9.314],[0,-10.409],[46.275,-46.274]],"o":[[-65.442,0],[-46.275,-46.274],[0,-65.442],[46.274,-46.275],[39.651,0],[8.309,4.372],[-4.371,8.308],[-30.01,-15.787],[-116.346,0],[0,116.346],[116.346,0],[0,-8.982],[-1.183,-9.314],[9.31,-1.185],[1.303,10.255],[0,65.441],[-46.274,46.275]],"v":[[0,245],[-173.241,173.241],[-245,0],[-173.241,-173.241],[0,-245],[113.915,-216.959],[121.045,-193.999],[98.085,-186.868],[0,-211],[-211,0],[0,211],[211,0],[209.309,-26.858],[224.031,-45.865],[243.037,-31.142],[245,0],[173.241,173.241]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.902000038297,0.902000038297,0.902000038297,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0.902000038297,0.902000038297,0.902000038297,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[245.25,245.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":800,"st":0,"bm":0}],"markers":[]}

client/src/Assets/chekcbox-checked.svg

Lines changed: 4 additions & 4 deletions
Loading

client/src/Assets/chekcbox-cross.svg

Lines changed: 5 additions & 5 deletions
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":60,"w":1920,"h":1080,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":2,"ty":4,"nm":"forwardslash","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-45,"ix":10},"p":{"a":0,"k":[960,540,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.762,0.833],"y":[1,1.024,1]},"o":{"x":[0.167,0.238,0.167],"y":[0,1.592,0]},"t":0,"s":[100,0,100]},{"t":50,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-5.795,-236.25],[-5.795,233.182]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.2,0.2,0.2,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":28,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60.0600600600601,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"backslash","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":45,"ix":10},"p":{"a":0,"k":[960,540,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.762,0.833],"y":[1,1.024,1]},"o":{"x":[0.167,0.238,0.167],"y":[0,1.592,0]},"t":0,"s":[100,0,100]},{"t":50,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-5.795,-236.25],[-5.795,233.182]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.2,0.2,0.2,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":28,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":60.0600600600601,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"circle","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[951.989,529.261,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[708.75,708.75],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.2,0.2,0.2,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":28,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[8.011,10.739],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":55,"s":[100]}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":60.0600600600601,"st":0,"bm":0}],"markers":[]}

client/src/Components/ClassView/ClassDashboard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import StudentsList from './StudentsList';
33
import SessionBtn from './SessionBtn';
44
import RegisterBtn from './RegisterBtn';
5+
import DeleteBtn from './DeleteBtn';
56

67
const viewStyle = 'flex flex-row justify-around';
78
const listStyle = 'rounded-sm shadow-sm w-1/2';
@@ -12,11 +13,11 @@ const ClassDashboard: React.FC<{ courseId: number }> = ({ courseId }) => {
1213
<section className={listStyle}>
1314
<StudentsList courseId={courseId} />
1415
</section>
15-
<article className='w-2/6'>
16+
<article className="w-2/6">
1617
<SessionBtn courseId={courseId} />
1718
<RegisterBtn courseId={courseId} />
19+
<DeleteBtn courseId={courseId} />
1820
</article>
19-
{/* TODO: add DELETE COURSE BUTTON */}
2021
</div>
2122
);
2223
};

client/src/Components/ClassView/ClassView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ReactComponent as CloseBtn } from '../../Assets/window-close-regular.sv
77
import ClassDashboard from './ClassDashboard';
88
import Overview from '../Calendar/Overview';
99
import User from '../../Types/user';
10+
import DeleteBtn from './DeleteBtn';
1011

1112
const headerStyle =
1213
'bg-black text-white flex flex-row justify-between items-center content-center p-8 h-20 mb-4 text-3xl';
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import React, { useState, useEffect } from 'react';
2+
import { useSelector, useDispatch } from 'react-redux';
3+
import { useNavigate } from 'react-router';
4+
import { useDeleteCourseMutation } from '../../generated/graphql';
5+
import { setCourses } from '../../store/actions';
6+
import Course from '../../Types/course';
7+
8+
const btnStyle = {
9+
box: 'flex justify-center bg-green hover:bg-green-light py-4 rounded-sm text-lg mb-4 text-white h-16',
10+
button:
11+
'invisible md:visible w-0 md:w-full flex justify-center h-0 md:h-full',
12+
ptag: 'visible md:invisible md:w-0 md:h-0',
13+
};
14+
15+
const alertStyle =
16+
'text-white text-center flex flex-col items-center justify-evenly h-56 w-96 fixed top-2/3 inset-x-1/2 bg-black p-12';
17+
18+
const alertBtnStyle = 'hover:bg-white hover:text-black border-white p-4';
19+
20+
const DeleteBtn: React.FC<{ courseId: number }> = ({ courseId }) => {
21+
const navigate = useNavigate();
22+
const dispatch = useDispatch();
23+
let success = false;
24+
const [askIfSure, setAskIfSure] = useState(false);
25+
26+
const courses = useSelector(
27+
(state: { courses: Course[] | null }) => state.courses
28+
);
29+
30+
const [, deleteCourse] = useDeleteCourseMutation();
31+
32+
const handleDelete = async (courseId: number) => {
33+
const response = await deleteCourse({ courseId });
34+
if (response.error) {
35+
} // TODO: handle error
36+
if (response.data) {
37+
success = true;
38+
// filter the list, dispatch new one
39+
const coursesAfterDelete = courses?.filter(
40+
(course) => course.id !== courseId
41+
);
42+
// @ts-ignore
43+
dispatch(setCourses(coursesAfterDelete));
44+
setTimeout(() => navigate('/homepage'), 1000);
45+
}
46+
};
47+
48+
const handleClick = () => {
49+
// ask if sure!!!
50+
setAskIfSure(true);
51+
};
52+
53+
// TODO: success message??
54+
55+
return (
56+
<div className={btnStyle.box}>
57+
<button onClick={handleClick} className={btnStyle.button}>
58+
Delete course
59+
</button>
60+
{askIfSure && (
61+
<div className={alertStyle}>
62+
<h2>Are you sure you want to delete this course?</h2>
63+
<div className="flex flex-row justify-evenly w-full mt-4">
64+
<button
65+
onClick={() => handleDelete(courseId)}
66+
className={alertBtnStyle}
67+
>
68+
YES
69+
</button>
70+
<button
71+
onClick={() => setAskIfSure(false)}
72+
className={alertBtnStyle}
73+
>
74+
CANCEL
75+
</button>
76+
</div>
77+
</div>
78+
)}
79+
{success && (
80+
<div className={alertStyle}>
81+
<h2>Course successfully deleted</h2>
82+
</div>
83+
)}
84+
</div>
85+
);
86+
};
87+
88+
export default DeleteBtn;
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
import React from 'react';
22

3-
const registerStyle = 'flex justify-center bg-green hover:bg-green-light py-4 rounded-sm text-lg mb-8 text-white h-16';
3+
const registerStyle =
4+
'flex justify-center bg-green hover:bg-green-light py-4 rounded-sm text-lg mb-4 text-white h-16';
45

56
const RegisterBtn: React.FC<{ courseId: number }> = ({ courseId }) => {
67
function openQR() {
78
window.open(
89
window.location.origin + `/register/${courseId}`,
910
'_blank',
10-
'toolbar=0,location=0,menubar=0, resizable=yes, width=500, height=500',
11+
'toolbar=0,location=0,menubar=0, resizable=yes, width=500, height=500'
1112
);
1213
}
1314

14-
return <div className={registerStyle}>
15-
<button onClick={openQR} className="invisible md:visible w-0 md:w-full flex justify-center h-0 md:h-full">Register students</button>
16-
<p className="visible md:invisible md:w-0 md:h-0">Register</p>
17-
</div>;
15+
return (
16+
<div className={registerStyle}>
17+
<button
18+
onClick={openQR}
19+
className="invisible md:visible w-0 md:w-full flex justify-center h-0 md:h-full"
20+
>
21+
Register students
22+
</button>
23+
<p className="visible md:invisible md:w-0 md:h-0">Register</p>
24+
</div>
25+
);
1826
};
1927

2028
export default RegisterBtn;

0 commit comments

Comments
 (0)