Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SETTINGS_TITLE: string = 'Profile Settings'
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './constants'
export * from './environments'
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FC, useContext } from 'react'
import { Link } from 'react-router-dom'

import { SETTINGS_TITLE } from '../../../../../../config'
import {
authUrlLogout,
profileContext,
Expand All @@ -18,15 +19,13 @@ interface ProfilePanelProps {
const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {

const { profile }: ProfileContextData = useContext(profileContext)
const { getPath }: RouteContextData = useContext(routeContext)
const { getPath }: RouteContextData = useContext(routeContext)

if (!profile) {
// this should never happen
return <></>
}

const settingsTitle: string = 'Settings'

return (
<div className={styles['profile-panel']}>
<div className={styles.handle}>
Expand All @@ -35,9 +34,9 @@ const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
<Link
className={styles.profile}
onClick={() => props.toggleProfilePanel()}
to={getPath(settingsTitle)}
to={getPath(SETTINGS_TITLE)}
>
{settingsTitle}
{SETTINGS_TITLE}
</Link>
<a href={authUrlLogout} className={styles.logout}>
Log Out
Expand Down
14 changes: 14 additions & 0 deletions src/lib/styles/_cards.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import './palette';
@import './typography';

.card {
padding: 16px 16px 32px 16px;
border: solid 1px $black-10;
box-shadow: 0px 8px 15px 0px rgba(0, 0, 0, 0.05);
border-radius: 8px;

.card-title {
@include font-weight-semi-bold;
text-transform: uppercase;
}
}
2 changes: 1 addition & 1 deletion src/lib/styles/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ h4 {
text-transform: uppercase;
margin: 0;
letter-spacing: 0;
padding: 24px;
padding: 24px 0;
}

h1 {
Expand Down
1 change: 1 addition & 0 deletions src/lib/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@import 'breakpoints';
@import 'buttons';
@import 'cards';
@import 'fonts';
@import 'icons';
@import 'layout';
Expand Down
10 changes: 10 additions & 0 deletions src/utils/settings/Settings.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@
.avatar-container {
margin: -108px 32px;
}

.page-container {
margin-top: 120px;

.page-content {
display: grid;
grid-template-columns: repeat(2, 1fr);
column-gap: 24px;
}
}
28 changes: 25 additions & 3 deletions src/utils/settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import classNames from 'classnames'
import { FC, useContext } from 'react'

import { SETTINGS_TITLE } from '../../config'
import {
authUrlLogin,
Avatar,
Expand All @@ -13,8 +14,6 @@ import '../../lib/styles/index.scss'

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

export const utilTitle: string = 'Settings'

const Settings: FC<{}> = () => {

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

return (
<ContentLayout
title={utilTitle}
title={SETTINGS_TITLE}
titleClass={classNames('font-tc-white', styles['page-header'])}
>

<Avatar
containerClass={styles['avatar-container']}
firstName={profile.firstName}
Expand All @@ -43,6 +43,28 @@ const Settings: FC<{}> = () => {
photoUrl={profile.photoURL}
size='xl'
/>

<div className={styles['page-container']}>

<h2>Edit your Personal Information and Security</h2>

<div className={styles['page-content']}>

<div className='card'>
<span className='card-title'>
Basic Information
</span>
</div>

<div className='card'>
<span className='card-title'>
Reset Password
</span>
</div>

</div>
</div>

</ContentLayout>
)
}
Expand Down
31 changes: 5 additions & 26 deletions src/utils/settings/settings.routes.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
import { SETTINGS_TITLE } from '../../config'
import { PlatformRoute } from '../../lib'

import { passwordFormTitle, PasswordReset } from './password-reset'
import { profileFormTitle, ProfileUpdate } from './profile-update'
import Settings, { utilTitle } from './Settings'

export enum SettingsPath {
password = 'password',
settings = '/settings',
}
import Settings from './Settings'

export const settingsRoutes: Array<PlatformRoute> = [
{
children: [
{
children: [],
element: <ProfileUpdate passwordPath={SettingsPath.password} />,
enabled: true,
route: '',
title: profileFormTitle,
},
{
children: [],
element: <PasswordReset profilePath={SettingsPath.settings} />,
enabled: true,
route: SettingsPath.password,
title: passwordFormTitle,
},
],
children: [],
element: <Settings />,
enabled: true,
route: SettingsPath.settings,
title: utilTitle,
route: '/settings',
title: SETTINGS_TITLE,
},
]