Skip to content

Commit ba69264

Browse files
committed
Merge branch 'dev' into profiles-app
2 parents 8179aaa + cb442d0 commit ba69264

File tree

28 files changed

+484
-23
lines changed

28 files changed

+484
-23
lines changed

.storybook/main.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ const config: StorybookConfig = {
3232
};
3333
}
3434

35-
return config;
35+
return {
36+
...config,
37+
plugins: config.plugins?.filter(plugin => {
38+
if (plugin.constructor.name === 'ESLintWebpackPlugin') {
39+
return false
40+
}
41+
return true
42+
}),
43+
};
3644
}
3745
};
3846
export default config;

.vscode/components.code-snippets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"interface ${1:ComponentName}Props {",
2727
"}",
2828
"",
29-
"const ${1:ComponentName}: FC<${1:ComponentName}Props> = (props: ${1:ComponentName}Props) => {",
29+
"const ${1:ComponentName}: FC<${1:ComponentName}Props> = props => {",
3030
"",
3131
" return (",
3232
" <div className={styles['wrap']}>",

src/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = {
7171
parameter: true,
7272
memberVariableDeclaration: true,
7373
callSignature: true,
74-
variableDeclaration: true,
74+
variableDeclaration: false,
7575
arrayDestructuring: false,
7676
objectDestructuring: true,
7777
},
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@import "@libs/ui/styles/includes";
2+
3+
.wrap {
4+
flex: 1 1;
5+
width: 100%;
6+
height: 100%;
7+
8+
.warning {
9+
color: $red-100;
10+
}
11+
}
12+
13+
.publicContent {
14+
background: $black-10;
15+
border-radius: $sp-4;
16+
17+
display: flex;
18+
align-items: center;
19+
justify-content: center;
20+
flex-direction: column;
21+
22+
text-align: center;
23+
24+
gap: $sp-8;
25+
padding: $sp-15 $sp-11;
26+
27+
&:global(.m-lg) {
28+
padding: $sp-15 2*$sp-15;
29+
}
30+
31+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { FC, ReactNode } from 'react'
2+
import classNames from 'classnames'
3+
4+
import styles from './EmptySection.module.scss'
5+
6+
interface EmptySectionProps {
7+
children?: ReactNode
8+
className?: string
9+
isSelf?: boolean
10+
selfMessage?: string
11+
title?: string
12+
wide?: boolean
13+
}
14+
15+
const EmptySection: FC<EmptySectionProps> = props => (
16+
<div
17+
className={
18+
classNames(
19+
props.className,
20+
styles.wrap,
21+
!props.isSelf && props.children && styles.publicContent,
22+
props.wide && 'm-lg',
23+
)
24+
}
25+
>
26+
{props.isSelf
27+
? (
28+
<div className={classNames('body-main', styles.warning)}>
29+
{props.selfMessage}
30+
</div>
31+
)
32+
: (
33+
<>
34+
{props.title && (
35+
<div className='body-medium-bold'>{props.title}</div>
36+
)}
37+
{props.children}
38+
</>
39+
)}
40+
</div>
41+
)
42+
43+
export default EmptySection
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as EmptySection } from './EmptySection'

src/apps/profiles/src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export * from './LogoDesignDetailsModal'
1515
export * from './WebDesignDetailsModal'
1616
export * from './DesignF2FDetailsModal'
1717
export * from './EditMemberPropertyBtn'
18+
export * from './EmptySection'

src/apps/profiles/src/member-profile/about-me/AboutMe.module.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
align-items: center;
1818
justify-content: center;
1919
margin-bottom: $sp-10;
20+
&.emptyDesc {
21+
margin-bottom: 0;
22+
}
2023
}
21-
}
24+
}

src/apps/profiles/src/member-profile/about-me/AboutMe.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
1+
import { Dispatch, FC, SetStateAction, useEffect, useMemo, useState } from 'react'
22
import { useSearchParams } from 'react-router-dom'
33
import { KeyedMutator } from 'swr'
4+
import classNames from 'classnames'
45

56
import { useMemberTraits, UserProfile, UserTraitIds, UserTraits } from '~/libs/core'
67

7-
import { EditMemberPropertyBtn } from '../../components'
8+
import { EditMemberPropertyBtn, EmptySection } from '../../components'
89
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
910
import { 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
{

src/apps/profiles/src/member-profile/education-and-certifications/EducationAndCertifications.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
.educationContentWrap {
2323
display: flex;
2424
flex-direction: column;
25+
padding-bottom: $sp-8;
2526
}
2627
}

0 commit comments

Comments
 (0)