1- import { Dispatch , FC , SetStateAction , useEffect , useState } from 'react'
1+ import { Dispatch , FC , SetStateAction , useEffect , useMemo , useState } from 'react'
22import { useSearchParams } from 'react-router-dom'
33import { KeyedMutator } from 'swr'
4+ import classNames from 'classnames'
45
56import { useMemberTraits , UserProfile , UserTraitIds , UserTraits } from '~/libs/core'
67
7- import { EditMemberPropertyBtn } from '../../components'
8+ import { EditMemberPropertyBtn , EmptySection } from '../../components'
89import { EDIT_MODE_QUERY_PARAM , profileEditModes } from '../../config'
910import { notifyUniNavi } from '../../lib'
1011
@@ -33,6 +34,10 @@ const AboutMe: FC<AboutMeProps> = (props: AboutMeProps) => {
3334 const memberTitleTrait : any
3435 = memberPersonalizationTraits ?. [ 0 ] ?. traits ?. data ?. find ( ( trait : any ) => trait . profileSelfTitle )
3536
37+ const hasEmptyDescription = useMemo ( ( ) => (
38+ props . profile && ! props . profile . description
39+ ) , [ props . profile ] )
40+
3641 useEffect ( ( ) => {
3742 if ( props . authProfile && editMode === profileEditModes . aboutMe ) {
3843 setIsEditMode ( true )
@@ -68,7 +73,7 @@ const AboutMe: FC<AboutMeProps> = (props: AboutMeProps) => {
6873 { ' ' }
6974 { props . profile ?. firstName || props . profile ?. handle }
7075 </ p >
71- < div className = { styles . wizzardWrap } >
76+ < div className = { classNames ( styles . wizzardWrap , hasEmptyDescription && styles . emptyDesc ) } >
7277 < p className = 'body-large' > { memberTitleTrait ?. profileSelfTitle } </ p >
7378 {
7479 canEdit && (
@@ -78,6 +83,16 @@ const AboutMe: FC<AboutMeProps> = (props: AboutMeProps) => {
7883 )
7984 }
8085 </ div >
86+ { hasEmptyDescription && (
87+ < EmptySection
88+ className = { styles . empty }
89+ selfMessage = { `
90+ Your bio is an opportunity to share your personality
91+ and interests with the community and customers.
92+ ` }
93+ isSelf = { canEdit }
94+ />
95+ ) }
8196 < p > { props . profile ?. description } </ p >
8297
8398 {
0 commit comments