From 426ff749714df23a83e269011916a2b52dcf00a8 Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Fri, 14 Oct 2022 19:02:24 +0800 Subject: [PATCH] [resumes][refactor] clean up submit form --- .../submit-form/SubmissionGuidelines.tsx | 30 +++++ apps/portal/src/pages/resumes/submit.tsx | 106 +++++++----------- 2 files changed, 69 insertions(+), 67 deletions(-) create mode 100644 apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx diff --git a/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx b/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx new file mode 100644 index 00000000..9220adb7 --- /dev/null +++ b/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx @@ -0,0 +1,30 @@ +export default function SubmissionGuidelines() { + return ( +
+

Submission Guidelines

+

+ Before you submit, please review and acknolwedge our + submission guidelines + stated below. +

+

+ + Ensure that you do not divulge any of your + personal particulars. +

+

+ + Ensure that you do not divulge any + + {' '} + company's proprietary and confidential information + + . +

+

+ + Proof-read your resumes to look for grammatical/spelling errors. +

+
+ ); +} diff --git a/apps/portal/src/pages/resumes/submit.tsx b/apps/portal/src/pages/resumes/submit.tsx index 0c1e3e01..d3d90c43 100644 --- a/apps/portal/src/pages/resumes/submit.tsx +++ b/apps/portal/src/pages/resumes/submit.tsx @@ -18,11 +18,13 @@ import { TextInput, } from '@tih/ui'; +import type { FilterOption } from '~/components/resumes/browse/resumeConstants'; import { EXPERIENCE, LOCATION, ROLE, } from '~/components/resumes/browse/resumeConstants'; +import SubmissionGuidelines from '~/components/resumes/submit-form/SubmissionGuidelines'; import { RESUME_STORAGE_KEY } from '~/constants/file-storage-keys'; import { trpc } from '~/utils/trpc'; @@ -45,6 +47,19 @@ type IFormInput = { title: string; }; +type SelectorType = 'experience' | 'location' | 'role'; +type SelectorOptions = { + key: SelectorType; + label: string; + options: Array; +}; + +const selectors: Array = [ + { key: 'role', label: 'Role', options: ROLE }, + { key: 'experience', label: 'Experience Level', options: EXPERIENCE }, + { key: 'location', label: 'Location', options: LOCATION }, +]; + export default function SubmitResumeForm() { const { data: session, status } = useSession(); const router = useRouter(); @@ -125,13 +140,13 @@ export default function SubmitResumeForm() { url, }, { - onError: (error) => { + onError(error) { console.error(error); }, - onSettled: () => { + onSettled() { setIsLoading(false); }, - onSuccess: () => { + onSuccess() { router.push('/resumes/browse'); }, }, @@ -191,6 +206,7 @@ export default function SubmitResumeForm() {
+ {/* Reset Dialog component */}

Upload a resume

+ {/* Title Section */}
setValue('title', val)} />
-
- setValue('experience', val)} - /> -
-
- setValue(item.key, val)} + /> +
+ ))} + {/* Upload Resume Section */}

Upload resume (PDF format)

+ {/* Upload Resume Box */}
{fileUploadError}

)}
+ {/* Additional Info Section */}