Skip to content

Commit cbdf21c

Browse files
Merge pull request #73 from topcoder-platform/PROD-1075_header-layout
PROD-1075 profile settings - dev
2 parents da8b51a + 7af74ba commit cbdf21c

File tree

9 files changed

+62
-35
lines changed

9 files changed

+62
-35
lines changed

src/config/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const SETTINGS_TITLE: string = 'Profile Settings'

src/config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './constants'
12
export * from './environments'

src/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/profile-panel/ProfilePanel.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FC, useContext } from 'react'
22
import { Link } from 'react-router-dom'
33

4+
import { SETTINGS_TITLE } from '../../../../../../config'
45
import {
56
authUrlLogout,
67
profileContext,
@@ -18,15 +19,13 @@ interface ProfilePanelProps {
1819
const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
1920

2021
const { profile }: ProfileContextData = useContext(profileContext)
21-
const { getPath }: RouteContextData = useContext(routeContext)
22+
const { getPath }: RouteContextData = useContext(routeContext)
2223

2324
if (!profile) {
2425
// this should never happen
2526
return <></>
2627
}
2728

28-
const settingsTitle: string = 'Settings'
29-
3029
return (
3130
<div className={styles['profile-panel']}>
3231
<div className={styles.handle}>
@@ -35,9 +34,9 @@ const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
3534
<Link
3635
className={styles.profile}
3736
onClick={() => props.toggleProfilePanel()}
38-
to={getPath(settingsTitle)}
37+
to={getPath(SETTINGS_TITLE)}
3938
>
40-
{settingsTitle}
39+
{SETTINGS_TITLE}
4140
</Link>
4241
<a href={authUrlLogout} className={styles.logout}>
4342
Log Out

src/lib/styles/_cards.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@import './palette';
2+
@import './typography';
3+
4+
.card {
5+
padding: 16px 16px 32px 16px;
6+
border: solid 1px $black-10;
7+
box-shadow: 0px 8px 15px 0px rgba(0, 0, 0, 0.05);
8+
border-radius: 8px;
9+
10+
.card-title {
11+
@include font-weight-semi-bold;
12+
text-transform: uppercase;
13+
}
14+
}

src/lib/styles/_typography.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ h4 {
2020
text-transform: uppercase;
2121
margin: 0;
2222
letter-spacing: 0;
23-
padding: 24px;
23+
padding: 24px 0;
2424
}
2525

2626
h1 {

src/lib/styles/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
@import 'breakpoints';
44
@import 'buttons';
5+
@import 'cards';
56
@import 'fonts';
67
@import 'icons';
78
@import 'layout';

src/utils/settings/Settings.module.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@
1010
.avatar-container {
1111
margin: -108px 32px;
1212
}
13+
14+
.page-container {
15+
margin-top: 120px;
16+
17+
.page-content {
18+
display: grid;
19+
grid-template-columns: repeat(2, 1fr);
20+
column-gap: 24px;
21+
}
22+
}

src/utils/settings/Settings.tsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import classNames from 'classnames'
22
import { FC, useContext } from 'react'
33

4+
import { SETTINGS_TITLE } from '../../config'
45
import {
56
authUrlLogin,
67
Avatar,
@@ -13,8 +14,6 @@ import '../../lib/styles/index.scss'
1314

1415
import styles from './Settings.module.scss'
1516

16-
export const utilTitle: string = 'Settings'
17-
1817
const Settings: FC<{}> = () => {
1918

2019
const profileContextData: ProfileContextData = useContext(profileContext)
@@ -32,9 +31,10 @@ const Settings: FC<{}> = () => {
3231

3332
return (
3433
<ContentLayout
35-
title={utilTitle}
34+
title={SETTINGS_TITLE}
3635
titleClass={classNames('font-tc-white', styles['page-header'])}
3736
>
37+
3838
<Avatar
3939
containerClass={styles['avatar-container']}
4040
firstName={profile.firstName}
@@ -43,6 +43,28 @@ const Settings: FC<{}> = () => {
4343
photoUrl={profile.photoURL}
4444
size='xl'
4545
/>
46+
47+
<div className={styles['page-container']}>
48+
49+
<h2>Edit your Personal Information and Security</h2>
50+
51+
<div className={styles['page-content']}>
52+
53+
<div className='card'>
54+
<span className='card-title'>
55+
Basic Information
56+
</span>
57+
</div>
58+
59+
<div className='card'>
60+
<span className='card-title'>
61+
Reset Password
62+
</span>
63+
</div>
64+
65+
</div>
66+
</div>
67+
4668
</ContentLayout>
4769
)
4870
}
Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
1+
import { SETTINGS_TITLE } from '../../config'
12
import { PlatformRoute } from '../../lib'
23

3-
import { passwordFormTitle, PasswordReset } from './password-reset'
4-
import { profileFormTitle, ProfileUpdate } from './profile-update'
5-
import Settings, { utilTitle } from './Settings'
6-
7-
export enum SettingsPath {
8-
password = 'password',
9-
settings = '/settings',
10-
}
4+
import Settings from './Settings'
115

126
export const settingsRoutes: Array<PlatformRoute> = [
137
{
14-
children: [
15-
{
16-
children: [],
17-
element: <ProfileUpdate passwordPath={SettingsPath.password} />,
18-
enabled: true,
19-
route: '',
20-
title: profileFormTitle,
21-
},
22-
{
23-
children: [],
24-
element: <PasswordReset profilePath={SettingsPath.settings} />,
25-
enabled: true,
26-
route: SettingsPath.password,
27-
title: passwordFormTitle,
28-
},
29-
],
8+
children: [],
309
element: <Settings />,
3110
enabled: true,
32-
route: SettingsPath.settings,
33-
title: utilTitle,
11+
route: '/settings',
12+
title: SETTINGS_TITLE,
3413
},
3514
]

0 commit comments

Comments
 (0)