Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7d2cb07

Browse files
feat: add privacy policy (#670)
* feat: add privacy policy * Update layout/SignUp/components/SignUpForm/index.tsx Co-authored-by: João Lobo <[email protected]> --------- Co-authored-by: João Lobo <[email protected]>
1 parent b8b77fa commit 7d2cb07

File tree

5 files changed

+42
-19
lines changed

5 files changed

+42
-19
lines changed

components/Checkbox/index.tsx

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default function Checkbox({ onChange, selected, children }) {
2+
return (
3+
<div>
4+
<label className="rounded-sm bg-quinary">
5+
<input className="hidden" type="checkbox" onChange={onChange}></input>
6+
<span
7+
className={`text-sm text-white ${
8+
selected ? "bg-quinary" : "bg-white"
9+
} select-none border-2 border-quinary px-1 font-ibold`}
10+
>
11+
{" "}
12+
&#10003;
13+
</span>
14+
</label>
15+
<label className="text-md ml-2 select-none text-white">{children}</label>
16+
</div>
17+
);
18+
}

layout/SignUp/SignUp.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Signup() {
3131
<Title text="Sign up" />
3232
<SignUpForm courses={courses} />
3333
<Text text="Already have an account?" link="Login here" href="/login" />
34-
<div className="absolute bottom-0 right-60 hidden lg:block">
34+
<div className="fixed bottom-0 right-60 hidden lg:block">
3535
<Motion.div
3636
initial={{ y: 30, opacity: 0 }}
3737
animate={{ y: 0, opacity: 1 }}

layout/SignUp/components/SignUpForm/index.tsx

+20-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import Select from "@components/Select";
99
import PasswordInput from "@components/PasswordInput";
1010

1111
import BarebonesQRScanner from "@components/QRScanner/BarebonesQRScanner";
12+
import Checkbox from "@components/Checkbox";
13+
import Link from "next/link";
1214

1315
interface Course {
1416
id: any;
@@ -29,14 +31,16 @@ export default function SignUpForm({ courses }) {
2931
const [local_error, updateError] = useState("");
3032
const [scanned, updateScanned] = useState(false);
3133
const [scanning, updateScanning] = useState(false);
34+
const [termsAccepted, setTermsAccepted] = useState(false);
35+
3236
const pauseRef = useRef(false);
3337
pauseRef.current = false;
3438

3539
const validateNickname = (nickname) => {
3640
return (
3741
nickname.length >= 2 &&
3842
nickname.length <= 15 &&
39-
nickname.match(/^[a-zA-Z0-9]+([a-zA-Z0-9](_|-)[a-zA-Z0-9])*[a-zA-Z0-9]+$/)
43+
nickname.match(/^[\w\d-_]{3,15}$/)
4044
);
4145
};
4246

@@ -57,6 +61,8 @@ export default function SignUpForm({ courses }) {
5761
);
5862
} else if (!validatePassword(password)) {
5963
updateError("Your password must be at least 8 characters long");
64+
} else if (!termsAccepted) {
65+
updateError("You must accept the privacy policy and general regulation");
6066
} else {
6167
updateError("");
6268

@@ -137,6 +143,19 @@ export default function SignUpForm({ courses }) {
137143
updateScanning(!scanning);
138144
}}
139145
/>
146+
<Checkbox
147+
selected={termsAccepted}
148+
onChange={(e) => setTermsAccepted(!termsAccepted)}
149+
>
150+
I have read and understood the &nbsp;
151+
<Link href="/docs/privacy_policy.pdf" target="_blank" className="text-quinary">
152+
privacy policy
153+
</Link>{" "}
154+
and the &nbsp;
155+
<Link href="/docs/regulation.pdf" target="_blank" className="text-quinary">
156+
general regulation
157+
</Link>
158+
</Checkbox>
140159
{scanned && (
141160
<p className="mt-3 font-iregular text-lg text-quinary">
142161
QR Code scanned successfully: {uuid}

layout/Staff/UploadCV/components/UploadSection.tsx

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from "react";
22
import { UploadIcon, CheckCircleIcon } from "@heroicons/react/solid";
3+
import Checkbox from "@components/Checkbox";
34

45
export default function UploadSection({ cv, onSubmit }) {
56
const [uploading, setUploading] = useState<boolean>(cv == null);
@@ -92,25 +93,10 @@ export default function UploadSection({ cv, onSubmit }) {
9293
</div>
9394
</label>
9495
<div className="mt-4 block">
95-
<label className="rounded-sm bg-quinary">
96-
<input
97-
className="hidden"
98-
type="checkbox"
99-
onChange={handleConsentChange}
100-
></input>
101-
<span
102-
className={`text-sm text-white ${
103-
consent ? "bg-quinary" : "bg-white"
104-
} select-none border-2 border-quinary px-1 font-ibold`}
105-
>
106-
{" "}
107-
&#10003;
108-
</span>
109-
</label>
110-
<label className="ml-2 select-none text-sm">
96+
<Checkbox selected={consent} onChange={handleConsentChange}>
11197
By submitting your CV you are consenting to it being shared with
11298
the companies present in the event.
113-
</label>
99+
</Checkbox>
114100
</div>
115101

116102
<input

public/docs/privacy_policy.pdf

61.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)