Skip to content

Commit 21f1704

Browse files
committed
MP-216 init
1 parent 1e7cddf commit 21f1704

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed

src/apps/accounts/src/settings/tabs/account/AccountTab.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { UserProfile, UserTraits } from '~/libs/core'
55
import { AccountRole } from './account-role'
66
import { SecuritySection } from './security'
77
import { UserAndPassword } from './user-and-pass'
8+
import { MemberAddress } from './address'
89
import styles from './AccountTab.module.scss'
910

1011
interface AccountTabProps {
@@ -20,6 +21,8 @@ const AccountTab: FC<AccountTabProps> = (props: AccountTabProps) => (
2021

2122
<UserAndPassword profile={props.profile} memberTraits={props.memberTraits} />
2223

24+
<MemberAddress profile={props.profile} />
25+
2326
<SecuritySection profile={props.profile} />
2427
</div>
2528
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@import '@libs/ui/styles/includes';
2+
3+
.container {
4+
margin: $sp-8 0;
5+
6+
.content {
7+
display: grid;
8+
grid-template-columns: repeat(2, 1fr);
9+
margin-bottom: 0;
10+
11+
@include ltelg {
12+
grid-template-columns: 1fr;
13+
}
14+
15+
>p {
16+
max-width: 380px;
17+
}
18+
}
19+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { Dispatch, FC, useCallback, useEffect, useMemo, useState } from 'react'
2+
import { toast } from 'react-toastify'
3+
4+
import {
5+
Collapsible,
6+
} from '~/libs/ui'
7+
import {
8+
UserProfile,
9+
} from '~/libs/core'
10+
11+
import styles from './MemberAddress.module.scss'
12+
13+
interface MemberAddressProps {
14+
profile: UserProfile
15+
}
16+
17+
const MemberAddress: FC<MemberAddressProps> = (props: MemberAddressProps) => {
18+
const [formValues, setFormValues]: [any, Dispatch<any>] = useState({
19+
country: props.profile.homeCountryCode || props.profile.competitionCountryCode,
20+
...props.profile.addresses ? props.profile.addresses[0] : {},
21+
})
22+
23+
console.log('formValues', formValues)
24+
25+
return (
26+
<Collapsible
27+
header={<h3>Address</h3>}
28+
containerClass={styles.container}
29+
contentClass={styles.content}
30+
>
31+
<p>
32+
By keeping this information up to date we may surprise you with a cool T-shirt.
33+
Sharing your contact details will never result in robocalls about health insurance plans or junk mail.
34+
</p>
35+
36+
<div className={styles.formWrap}>
37+
38+
</div>
39+
</Collapsible>
40+
)
41+
}
42+
43+
export default MemberAddress
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as MemberAddress } from './MemberAddress'

src/libs/core/lib/profile/user-profile.model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
export type TC_TRACKS = 'DEVELOP' | 'DESIGN' | 'DATA_SCIENCE'
22

33
export interface UserProfile {
4+
addresses?: Array<{
5+
city?: string
6+
stateCode?: string
7+
streetAddr1?: string
8+
streetAddr2?: string
9+
zip?: string
10+
}>
411
competitionCountryCode: string
512
createdAt: number
613
description: string

0 commit comments

Comments
 (0)