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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC, useContext } from 'react'

import { SETTINGS_TITLE } from '../../../../config'
import { profileContext, ProfileContextData } from '../../../../lib'
import '../../../../lib/styles/index.scss'

Expand All @@ -23,7 +24,7 @@ const ProfileSelector: FC<{}> = () => {
return (
<div className={styles['profile-selector']}>
{!isLoggedIn && <ProfileNotLoggedIn />}
{isLoggedIn && <ProfileLoggedIn />}
{isLoggedIn && <ProfileLoggedIn settingsTitle={SETTINGS_TITLE} />}
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import {
import { ProfilePanel } from './profile-panel'
import styles from './ProfileLoggedIn.module.scss'

const ProfileLoggedIn: FC<{}> = () => {
interface ProfileLoggedInProps {
settingsTitle: string
}

const ProfileLoggedIn: FC<ProfileLoggedInProps> = (props: ProfileLoggedInProps) => {

const { profile }: ProfileContextData = useContext(profileContext)
const [profilePanelOpen, setProfilePanelOpen]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
Expand Down Expand Up @@ -41,7 +45,12 @@ const ProfileLoggedIn: FC<{}> = () => {
</div>
)}
</div>
{profilePanelOpen && <ProfilePanel toggleProfilePanel={toggleProfilePanel} />}
{profilePanelOpen && (
<ProfilePanel
settingsTitle={props.settingsTitle}
toggleProfilePanel={toggleProfilePanel}
/>
)}
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FC, useContext } from 'react'
import { Link } from 'react-router-dom'

import { SETTINGS_TITLE } from '../../../../../../config'
import {
authUrlLogout,
profileContext,
Expand All @@ -13,6 +12,7 @@ import {
import styles from './ProfilePanel.module.scss'

interface ProfilePanelProps {
settingsTitle: string
toggleProfilePanel: () => void
}

Expand All @@ -34,9 +34,9 @@ const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
<Link
className={styles.profile}
onClick={() => props.toggleProfilePanel()}
to={getPath(SETTINGS_TITLE)}
to={getPath(props.settingsTitle)}
>
{SETTINGS_TITLE}
{props.settingsTitle}
</Link>
<a href={authUrlLogout} className={styles.logout}>
Log Out
Expand Down
2 changes: 0 additions & 2 deletions src/lib/content-layout/ContentLayout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@include content-height;
padding: 0;
display: grid;
background-color: $tc-white;
grid-template-columns: 1fr;
justify-content: center;

Expand All @@ -14,7 +13,6 @@

.content-inner {
flex: 1;
background-color: $tc-white;
max-width: $xl-max-content;
padding: 0;
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/content-layout/ContentLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import styles from './ContentLayout.module.scss'

export interface ContentLayoutProps {
children?: ReactNode
contentClass?: string
title: string
titleClass?: string
}

const ContentLayout: FC<ContentLayoutProps> = (props: ContentLayoutProps) => {

return (
<div className={classNames(styles.content)}>
<div className={classNames(styles.content, props.contentClass)}>

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

Expand Down
3 changes: 2 additions & 1 deletion src/lib/styles/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

.card-title {
@include font-weight-semi-bold;
@include font-barlow;
text-transform: uppercase;
}
}
}
6 changes: 5 additions & 1 deletion src/utils/settings/Settings.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.page-header {
.content {
background: url('./profile-settings-background.svg');
background-size: 100% 100%;
}

.page-header {
padding: 48px 180px;

h1 {
Expand Down
13 changes: 7 additions & 6 deletions src/utils/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Settings: FC<{}> = () => {

return (
<ContentLayout
contentClass={styles.content}
title={SETTINGS_TITLE}
titleClass={classNames('font-tc-white', styles['page-header'])}
>
Expand All @@ -51,15 +52,15 @@ const Settings: FC<{}> = () => {
<div className={styles['page-content']}>

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

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

</div>
Expand Down
37 changes: 14 additions & 23 deletions src/utils/settings/profile-settings-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.