From db32fe0f6780515dbc303701e01761e6e776aa1c Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Sun, 23 Oct 2022 17:07:08 +0800 Subject: [PATCH] [resumes][feat] remove resume title, clean up submit form (#415) * [resumes][refactor] clean up submit form * [resumes][feat] remove resume title * [resumes][feat] remove resume title --- .../components/resumes/ResumeReviewsTitle.tsx | 13 --- .../resumes/browse/ResumeListItem.tsx | 2 +- .../submit-form/SubmissionGuidelines.tsx | 11 +- apps/portal/src/pages/resumes/browse.tsx | 82 +++++++------- apps/portal/src/pages/resumes/submit.tsx | 104 +++++++++--------- 5 files changed, 95 insertions(+), 117 deletions(-) delete mode 100644 apps/portal/src/components/resumes/ResumeReviewsTitle.tsx diff --git a/apps/portal/src/components/resumes/ResumeReviewsTitle.tsx b/apps/portal/src/components/resumes/ResumeReviewsTitle.tsx deleted file mode 100644 index 34c18c0a..00000000 --- a/apps/portal/src/components/resumes/ResumeReviewsTitle.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Badge } from '@tih/ui'; - -export default function ResumeReviewsTitle() { - return ( -
-

Resume Reviews

- -
- ); -} diff --git a/apps/portal/src/components/resumes/browse/ResumeListItem.tsx b/apps/portal/src/components/resumes/browse/ResumeListItem.tsx index 5726badd..2190dfd8 100644 --- a/apps/portal/src/components/resumes/browse/ResumeListItem.tsx +++ b/apps/portal/src/components/resumes/browse/ResumeListItem.tsx @@ -65,7 +65,7 @@ export default function ResumeListItem({ href, resumeInfo }: Props) {
{resumeInfo.location}
- + ); diff --git a/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx b/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx index 9220adb7..96249537 100644 --- a/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx +++ b/apps/portal/src/components/resumes/submit-form/SubmissionGuidelines.tsx @@ -1,22 +1,21 @@ export default function SubmissionGuidelines() { return ( -
+

Submission Guidelines

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

- Ensure that you do not divulge any of your - personal particulars. + Ensure that you do not divulge any of your{' '} + personal particulars.

- Ensure that you do not divulge any + Ensure that you do not divulge any{' '} - {' '} company's proprietary and confidential information . diff --git a/apps/portal/src/pages/resumes/browse.tsx b/apps/portal/src/pages/resumes/browse.tsx index 488b0818..38e01f67 100644 --- a/apps/portal/src/pages/resumes/browse.tsx +++ b/apps/portal/src/pages/resumes/browse.tsx @@ -4,10 +4,10 @@ import { useSession } from 'next-auth/react'; import { Fragment, useEffect, useState } from 'react'; import { Dialog, Disclosure, Transition } from '@headlessui/react'; import { FunnelIcon, MinusIcon, PlusIcon } from '@heroicons/react/20/solid'; -import { XMarkIcon } from '@heroicons/react/24/outline'; import { MagnifyingGlassIcon, NewspaperIcon, + XMarkIcon, } from '@heroicons/react/24/outline'; import { CheckboxInput, @@ -36,7 +36,6 @@ import { SORT_OPTIONS, } from '~/components/resumes/browse/resumeFilters'; import ResumeListItems from '~/components/resumes/browse/ResumeListItems'; -import ResumeReviewsTitle from '~/components/resumes/ResumeReviewsTitle'; import ResumeSignInButton from '~/components/resumes/shared/ResumeSignInButton'; import useDebounceValue from '~/utils/resumes/useDebounceValue'; @@ -369,12 +368,8 @@ export default function ResumeHomePage() {

-
-
- -
- -
+
+

Shortcuts @@ -535,44 +530,41 @@ export default function ResumeHomePage() {

-
- {isFetchingResumes ? ( -
- {' '} - {' '} -
- ) : sessionData === null && - tabsValue !== BROWSE_TABS_VALUES.ALL ? ( - + {' '} + {' '} +
+ ) : sessionData === null && tabsValue !== BROWSE_TABS_VALUES.ALL ? ( + + ) : getTabResumes().length === 0 ? ( +
+ - ) : getTabResumes().length === 0 ? ( -
- - {getEmptyDataText(tabsValue, searchValue, userFilters)} -
- ) : ( - <> - - {getTabTotalPages() > 1 && ( -
- setCurrentPage(page)} - /> -
- )} - - )} -
+ {getEmptyDataText(tabsValue, searchValue, userFilters)} +
+ ) : ( + <> + + {getTabTotalPages() > 1 && ( +
+ setCurrentPage(page)} + /> +
+ )} + + )} diff --git a/apps/portal/src/pages/resumes/submit.tsx b/apps/portal/src/pages/resumes/submit.tsx index 2a04ca4e..06915a00 100644 --- a/apps/portal/src/pages/resumes/submit.tsx +++ b/apps/portal/src/pages/resumes/submit.tsx @@ -46,6 +46,8 @@ type IFormInput = { title: string; }; +type InputKeys = keyof IFormInput; + type InitFormDetails = { additionalInfo?: string; experience: string; @@ -218,6 +220,10 @@ export default function SubmitResumeForm({ } }, [errors?.file, invalidFileUploadError]); + const onValueChange = (section: InputKeys, value: string) => { + setValue(section, value.trim(), { shouldTouch: false }); + }; + return ( <> @@ -269,7 +275,7 @@ export default function SubmitResumeForm({ required={true} onChange={(val) => setValue('title', val)} /> -
+
- -
-

- PDF up to {FILE_SIZE_LIMIT_MB}MB +

+
+ {resumeFile == null ? ( + + ) : ( +

+ {resumeFile.name}

+ )} +
+
+

+ PDF up to {FILE_SIZE_LIMIT_MB}MB +

- {fileUploadError && ( -

{fileUploadError}

- )}
- + {fileUploadError && ( +

{fileUploadError}

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