From e66f2f17f565085d7ccc4dad965d46213c169fef Mon Sep 17 00:00:00 2001 From: dat Date: Tue, 11 Jul 2023 16:19:26 +0700 Subject: [PATCH] Onboarding - mobile views --- .../src/components/FieldAvatar/index.tsx | 87 +++++++++-------- .../components/modal-add-education/index.tsx | 12 +-- .../modal-add-education/styles.module.scss | 4 + .../src/components/modal-add-work/index.tsx | 14 ++- .../modal-add-work/styles.module.scss | 33 ------- .../components/modal-upload-photo/index.tsx | 17 ++-- .../modal-upload-photo/styles.module.scss | 54 +++-------- .../onboarding-base-modal/index.tsx | 28 ++++++ .../onboarding-base-modal/styles.module.scss | 47 +++++++++ .../src/pages/account-details/index.tsx | 14 +-- .../onboarding/src/pages/educations/index.tsx | 5 +- .../src/pages/onboarding/styles.module.scss | 96 +++++++++++-------- .../src/pages/personalization/index.tsx | 65 ++++++------- src/apps/onboarding/src/pages/works/index.tsx | 5 +- .../onboarding/src/styles/global/_flex.scss | 16 ++++ .../onboarding/src/styles/global/_grid.scss | 12 +++ .../onboarding/src/styles/global/_index.scss | 6 ++ .../onboarding/src/styles/global/_layout.scss | 18 ++++ 18 files changed, 315 insertions(+), 218 deletions(-) create mode 100644 src/apps/onboarding/src/components/onboarding-base-modal/index.tsx create mode 100644 src/apps/onboarding/src/components/onboarding-base-modal/styles.module.scss diff --git a/src/apps/onboarding/src/components/FieldAvatar/index.tsx b/src/apps/onboarding/src/components/FieldAvatar/index.tsx index 8d9f86df7..60abda520 100644 --- a/src/apps/onboarding/src/components/FieldAvatar/index.tsx +++ b/src/apps/onboarding/src/components/FieldAvatar/index.tsx @@ -53,12 +53,51 @@ const FieldAvatar: FC = (props: FieldAvatarProps) => { setIsPhotoEditMode(true) } + const bottomButtons = imgUrl ? ( +
+ + +
+ ) : ( + + ) + return (

Photo

-
+
= (props: FieldAvatarProps) => { Make a great first impression to potential customers with a professional photo that represents your style. - {imgUrl ? ( -
- - -
- ) : ( - - )} +
+ {bottomButtons} +
+
+ {bottomButtons} +
{ isPhotoEditMode && props.memberInfo && ( diff --git a/src/apps/onboarding/src/components/modal-add-education/index.tsx b/src/apps/onboarding/src/components/modal-add-education/index.tsx index 5b7cc5bb2..7dd42b0c4 100644 --- a/src/apps/onboarding/src/components/modal-add-education/index.tsx +++ b/src/apps/onboarding/src/components/modal-add-education/index.tsx @@ -3,11 +3,12 @@ import _ from 'lodash' import classNames from 'classnames' import moment from 'moment' -import { BaseModal, Button, InputText } from '~/libs/ui' +import { Button, InputText } from '~/libs/ui' import DateInput from '../DateInput' import EducationInfo, { emptyEducationInfo } from '../../models/EducationInfo' import FormField from '../FormField' +import OnboardingBaseModal from '../onboarding-base-modal' import styles from './styles.module.scss' @@ -59,7 +60,7 @@ const ModalAddEducation: FC = (props: ModalAddEducationP }, [props.editingEducation]) return ( -
)} onClose={props.onClose || _.noop} - open - size='body' title={props.editingEducation ? 'Edit Education' : 'Add Education'} - classNames={{ modal: styles.infoModal }} > -
+
= (props: ModalAddEducationP
- + ) } diff --git a/src/apps/onboarding/src/components/modal-add-education/styles.module.scss b/src/apps/onboarding/src/components/modal-add-education/styles.module.scss index 070ddd645..32b5f54a0 100644 --- a/src/apps/onboarding/src/components/modal-add-education/styles.module.scss +++ b/src/apps/onboarding/src/components/modal-add-education/styles.module.scss @@ -4,6 +4,10 @@ padding: 35px 32px 32px 32px !important; max-width: 600px !important; + @include ltemd { + max-width: 375px !important; + } + :global(.react-responsive-modal-closeButton) { display: flex; right: 32px; diff --git a/src/apps/onboarding/src/components/modal-add-work/index.tsx b/src/apps/onboarding/src/components/modal-add-work/index.tsx index ba722e322..4bb0fa6c0 100644 --- a/src/apps/onboarding/src/components/modal-add-work/index.tsx +++ b/src/apps/onboarding/src/components/modal-add-work/index.tsx @@ -3,12 +3,13 @@ import _ from 'lodash' import classNames from 'classnames' import moment from 'moment' -import { BaseModal, Button, InputSelect, InputText } from '~/libs/ui' +import { Button, InputSelect, InputText } from '~/libs/ui' import { FormInputCheckbox } from '~/apps/self-service/src/components/form-elements' import { INDUSTRIES_OPTIONS } from '../../config' import DateInput from '../DateInput' import FormField from '../FormField' +import OnboardingBaseModal from '../onboarding-base-modal' import WorkInfo, { emptyWorkInfo } from '../../models/WorkInfo' import styles from './styles.module.scss' @@ -69,7 +70,7 @@ const ModalAddWork: FC = (props: ModalAddWorkProps) => { }, [props.editingWork]) return ( -
)} onClose={props.onClose || _.noop} - open - size='body' title={props.editingWork ? 'Edit Experience' : 'Add Experience'} - classNames={{ modal: styles.infoModal }} > -
+
= (props: ModalAddWorkProps) => {
-
+
= (props: ModalAddWorkProps) => { />
- + ) } diff --git a/src/apps/onboarding/src/components/modal-add-work/styles.module.scss b/src/apps/onboarding/src/components/modal-add-work/styles.module.scss index bc191d879..fced2c8eb 100644 --- a/src/apps/onboarding/src/components/modal-add-work/styles.module.scss +++ b/src/apps/onboarding/src/components/modal-add-work/styles.module.scss @@ -1,34 +1 @@ @import '@libs/ui/styles/includes'; - -.infoModal { - padding: 35px 32px 32px 32px !important; - max-width: 600px !important; - - :global(.react-responsive-modal-closeButton) { - display: flex; - right: 32px; - top: 46px !important; - - path { - color: $turq-160; - } - } - - hr { - margin-top: 30px; - } - - h3 { - font-family: $font-barlow; - color: $black-100; - font-size: 34px; - font-style: normal; - font-weight: 600; - line-height: 40px; - text-transform: none; - } - - .modalContent { - width: 100%; - } -} diff --git a/src/apps/onboarding/src/components/modal-upload-photo/index.tsx b/src/apps/onboarding/src/components/modal-upload-photo/index.tsx index 27494dbce..14205f886 100644 --- a/src/apps/onboarding/src/components/modal-upload-photo/index.tsx +++ b/src/apps/onboarding/src/components/modal-upload-photo/index.tsx @@ -3,10 +3,11 @@ import { DropzoneState, useDropzone } from 'react-dropzone' import _ from 'lodash' import classNames from 'classnames' -import { BaseModal, Button } from '~/libs/ui' +import { Button } from '~/libs/ui' import { updateMemberPhotoAsync } from '~/libs/core' import MemberInfo from '../../models/MemberInfo' +import OnboardingBaseModal from '../onboarding-base-modal' import styles from './styles.module.scss' @@ -63,7 +64,7 @@ const ModalUploadPhoto: FC = (props: ModalUploadPhotoProp } return ( -
)} onClose={props.onClose || _.noop} - open - size='body' title='Profile Photo' - classNames={{ modal: styles.infoModal }} > -
+
{(!isSaving && !imgUrl) ? (
@@ -128,7 +131,7 @@ const ModalUploadPhoto: FC = (props: ModalUploadPhotoProp
- + ) } diff --git a/src/apps/onboarding/src/components/modal-upload-photo/styles.module.scss b/src/apps/onboarding/src/components/modal-upload-photo/styles.module.scss index 70068533a..de697bdef 100644 --- a/src/apps/onboarding/src/components/modal-upload-photo/styles.module.scss +++ b/src/apps/onboarding/src/components/modal-upload-photo/styles.module.scss @@ -1,39 +1,7 @@ @import '@libs/ui/styles/includes'; -.infoModal { - padding: 35px 32px 32px 32px !important; - max-width: 600px !important; - - :global(.react-responsive-modal-closeButton) { - display: flex; - right: 32px; - top: 46px !important; - - path { - color: $turq-160; - } - } - - hr { - margin-top: 30px; - } - - h3 { - font-family: $font-barlow; - color: $black-100; - font-size: 34px; - font-style: normal; - font-weight: 600; - line-height: 40px; - text-transform: none; - } - - .modalContent { - width: 100%; - } -} - -.blockDropZone { +.blockDropZone, +.blockPhoto { width: 256px; height: 256px; margin-right: 24px; @@ -46,6 +14,13 @@ flex-direction: column; background-color: rgba(224, 250, 243, 0.30); + @include ltemd { + width: 100%; + height: 343px; + } +} + +.blockDropZone { .textDragAndDrop { font-size: 16px; font-style: normal; @@ -79,13 +54,6 @@ } .blockPhoto { - width: 256px; - height: 256px; - margin-right: 24px; - flex-shrink: 0; - border: 1px dashed $turq-160; - background-color: rgba(224, 250, 243, 0.30); - img { width: 100%; height: 100%; @@ -96,4 +64,8 @@ .listRequirements { list-style: disc; padding-left: 24px; + + @include ltemd { + margin-bottom: 21px; + } } diff --git a/src/apps/onboarding/src/components/onboarding-base-modal/index.tsx b/src/apps/onboarding/src/components/onboarding-base-modal/index.tsx new file mode 100644 index 000000000..642a908a2 --- /dev/null +++ b/src/apps/onboarding/src/components/onboarding-base-modal/index.tsx @@ -0,0 +1,28 @@ +import { FC, ReactNode } from 'react' +import _ from 'lodash' + +import { BaseModal } from '~/libs/ui' + +import styles from './styles.module.scss' + +interface OnboardingBaseModalProps { + onClose?: () => void + children: React.ReactNode + title?: string | ReactNode + buttons?: ReactNode +} + +const OnboardingBaseModal: FC = (props: OnboardingBaseModalProps) => ( + + {props.children} + +) + +export default OnboardingBaseModal diff --git a/src/apps/onboarding/src/components/onboarding-base-modal/styles.module.scss b/src/apps/onboarding/src/components/onboarding-base-modal/styles.module.scss new file mode 100644 index 000000000..4582fba49 --- /dev/null +++ b/src/apps/onboarding/src/components/onboarding-base-modal/styles.module.scss @@ -0,0 +1,47 @@ +@import '@libs/ui/styles/includes'; + +.infoModal { + padding: 35px 32px 32px 32px !important; + max-width: 600px !important; + + @include ltemd { + max-width: 375px !important; + padding: 40px 16px 32px 16px !important; + } + + :global(.react-responsive-modal-closeButton) { + display: flex; + right: 32px; + top: 46px !important; + + path { + color: $turq-160; + } + } + + hr { + margin-top: 30px; + + @include ltemd { + margin-top: 32px; + } + } + + h3 { + font-family: $font-barlow; + color: $black-100; + font-size: 34px; + font-style: normal; + font-weight: 600; + line-height: 40px; + text-transform: none; + + @include ltemd { + font-size: 28px; + } + } + + .modalContent { + width: 100%; + } +} diff --git a/src/apps/onboarding/src/pages/account-details/index.tsx b/src/apps/onboarding/src/pages/account-details/index.tsx index 7b3fcb2f9..36e17f2bb 100644 --- a/src/apps/onboarding/src/pages/account-details/index.tsx +++ b/src/apps/onboarding/src/pages/account-details/index.tsx @@ -187,7 +187,7 @@ const PageAccountDetailsContent: FC<{ name='streetAddr1' label='Address 1' value={memberAddress?.streetAddr1 || ''} - onChange={function (event?: string) { + onChange={function onChange(event?: string) { setMemberAddress({ ...(memberAddress || blankMemberAddress), streetAddr1: event || '', @@ -202,7 +202,7 @@ const PageAccountDetailsContent: FC<{ name='streetAddr2' label='Address 2' value={memberAddress?.streetAddr2 || ''} - onChange={function (event?: string) { + onChange={function onChange(event?: string) { setMemberAddress({ ...(memberAddress || blankMemberAddress), streetAddr2: event || '', @@ -221,7 +221,7 @@ const PageAccountDetailsContent: FC<{ name='city' label='City' value={memberAddress?.city || ''} - onChange={function (event?: string) { + onChange={function onChange(event?: string) { setMemberAddress({ ...(memberAddress || blankMemberAddress), city: event || '', @@ -240,7 +240,7 @@ const PageAccountDetailsContent: FC<{ name='stateCode' label='State / Province' value={memberAddress?.stateCode || ''} - onChange={function (event?: string) { + onChange={function onChange(event?: string) { setMemberAddress({ ...(memberAddress || blankMemberAddress), stateCode: event || '', @@ -260,7 +260,7 @@ const PageAccountDetailsContent: FC<{ name='zip' label='Zip / Postal Code' value={memberAddress?.zip || ''} - onChange={function (event?: string) { + onChange={function onChange(event?: string) { setMemberAddress({ ...(memberAddress || blankMemberAddress), zip: event || '', @@ -277,7 +277,7 @@ const PageAccountDetailsContent: FC<{ {(educations || []).length > 0 ? ( -
+
{(educations || []).map(education => ( -

Bio

+

Bio

This is where we can really get to know you. - - - +
+ + + +
{(works || []).length > 0 ? ( -
+
{(works || []).map(work => (