Skip to content

Commit 72f153b

Browse files
PLAT-825 profile and form fields - dev (#49)
1 parent 2edf93a commit 72f153b

37 files changed

+526
-74
lines changed

src/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.module.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
}
1010

1111
svg {
12-
height: $pad-xxl;
13-
width: $pad-xxl;
12+
@include icon-xxl;
1413
fill: none;
1514

1615
path {
@@ -25,8 +24,8 @@
2524
left: 0;
2625
width: calc(100% - calc(2 * $pad-xxl));
2726
z-index: 100;
28-
height: $content-height;
2927
background-color: $black-100;
3028
padding: $pad-xxl;
29+
@include content-height;
3130
}
3231
}

src/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.module.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
.tool-selector-narrow-link {
1010
display: flex;
1111
justify-content: space-between;
12+
align-items: center;
1213
border-top: 1px solid $black-60;
1314
padding: $pad-lg 0;
1415
color: $tc-white;
15-
font-size: 16px;
16-
@include font-bold;
16+
@include font-weight-medium;
1717
background-color: $black-100;
1818

1919
svg {
20-
width: $pad-lg;
21-
height: $pad-lg;
20+
@include icon-lg;
2221
fill: $tc-white;
2322

2423
path {

src/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/ProfileLoggedIn.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
$overlaySquare: calc($pad-xxxxl + 2 * $border);
44

5-
a {
5+
.profile-avater,
6+
.overlay {
67
cursor: pointer;
78
}
89

@@ -21,7 +22,6 @@ a {
2122
svg {
2223
stroke: $turq-160;
2324
stroke-width: $border;
24-
height: $pad-xxl;
25-
width: $pad-xxl;
25+
@include icon-xxl;
2626
}
2727
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const ProfileLoggedIn: FC<{}> = () => {
2222

2323
return (
2424
<>
25-
<div onClick={() => toggleProfilePanel()} >
25+
<div className={styles['profile-avater']} onClick={() => toggleProfilePanel()} >
2626
<Avatar
2727
firstName={profile.firstName}
2828
lastName={profile.lastName}
@@ -35,7 +35,7 @@ const ProfileLoggedIn: FC<{}> = () => {
3535
</div>
3636
)}
3737
</div>
38-
{profilePanelOpen && <ProfilePanel />}
38+
{profilePanelOpen && <ProfilePanel toggleProfilePanel={toggleProfilePanel} />}
3939
</>
4040
)
4141
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
@import '../../../../../../lib/styles';
22

33
.profile-panel {
4+
@extend .body-small;
45
position: absolute;
56
z-index: 1000;
67
top: calc($pad-xxxxl * 2);
78
right: calc($pad-sm + 2px);
89
width: 168px;
910
display: flex;
1011
flex-direction: column;
11-
font-size: 14px;
1212
background: url('./profile-panel-header.png') no-repeat top center;
1313
filter: drop-shadow(0px 1px 5px rgba(0, 0, 0, 0.2));
1414

1515
.handle {
1616
padding: $pad-xl $pad-xl calc($pad-lg - 1px) $pad-xl;
1717
color: $tc-white;
18-
line-height: 22px;
1918
}
2019

2120
.logout,

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FC, useContext } from 'react'
2+
import { Link } from 'react-router-dom'
23

34
import {
45
AuthenticationUrlConfig,
@@ -9,7 +10,11 @@ import {
910

1011
import styles from './ProfilePanel.module.scss'
1112

12-
const ProfilePanel: FC<{}> = () => {
13+
interface ProfilePanelProps {
14+
toggleProfilePanel: () => void
15+
}
16+
17+
const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
1318

1419
const { profile }: ProfileContextData = useContext(ProfileContext)
1520

@@ -23,9 +28,13 @@ const ProfilePanel: FC<{}> = () => {
2328
<div className={styles.handle}>
2429
{profile.handle}
2530
</div>
26-
<a href={ProfileRouteConfig.profile} className={styles.profile}>
31+
<Link
32+
className={styles.profile}
33+
onClick={() => props.toggleProfilePanel()}
34+
to={ProfileRouteConfig.profile}
35+
>
2736
My Profile
28-
</a>
37+
</Link>
2938
<a href={AuthenticationUrlConfig.logout} className={styles.logout}>
3039
Log Out
3140
</a>

src/lib/avatar/Avatar.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $avatar-size: 32px;
2323
align-items: center;
2424
color: $tc-white;
2525
background-color: $blue-100;
26-
@include font-bold;
26+
@include font-weight-medium;
2727
@extend .medium-subtitle;
2828
}
2929
}
Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,57 @@
11
@import '../styles/';
22

33
.content {
4-
height: $content-height;
5-
padding: $pad-xxl $pad-xxl $pad-xxl 0;
6-
4+
@include content-height;
5+
padding: $pad-xxxxl $pad-content-lg;
76
display: grid;
8-
@include font-roboto;
7+
background-color: $black-10;
8+
grid-template-columns: 1fr;
9+
justify-content: center;
910

1011
.sections {
11-
display: grid;
12+
display: none;
1213
height: 200px;
13-
}
14-
15-
.sections {
1614
background-color: $tc-white;
1715
}
1816

19-
&.hide-sections {
20-
grid-template-columns: 1fr;
21-
justify-content: center;
22-
padding-left: $pad-xxl;
17+
&.show-sections {
18+
padding-left: 0;
2319

2420
.sections {
25-
display: none;
26-
}
27-
}
21+
display: grid;
22+
}
2823

29-
@include ltemd {
30-
grid-template-columns: 1fr;
31-
justify-content: center;
32-
padding-left: $pad-xxl;
24+
@include md {
25+
padding-left: $pad-xxl;
26+
}
3327

34-
.sections {
35-
display: none;
28+
@include lg {
29+
grid-template-columns: $left-col-width-lg 1fr;
3630
}
31+
32+
@include xl {
33+
grid-template-columns: $left-col-width-xl 1fr;
34+
}
35+
}
36+
37+
@include md {
38+
padding: $pad-xxl;
3739
}
3840

39-
@include lg {
40-
grid-template-columns: $left-col-width-lg 1fr;
41+
@include ltesm {
42+
padding: 0;
4143
}
4244

43-
@include xl {
44-
grid-template-columns: $left-col-width-xl 1fr;
45+
.content-outer {
46+
display: flex;
47+
justify-content: center;
48+
49+
.content-inner {
50+
flex: 1;
51+
background-color: $tc-white;
52+
border-radius: $pad-sm;
53+
max-width: $xl-max-content;
54+
padding: $pad-xxl;
55+
}
4556
}
4657
}

src/lib/content-layout/ContentLayout.tsx

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

4-
import { ProfileContext, ProfileContextData } from '../profile-provider'
54
import { PlatformRoute, RouteContextData } from '../route-provider'
65
import RouteContext from '../route-provider/route.context' // cannot be imported from index file
76
import '../styles/index.scss'
@@ -18,7 +17,6 @@ export interface ContentLayoutProps {
1817

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

21-
const { profile }: ProfileContextData = useContext(ProfileContext)
2220
const { toolsRoutes, utilsRoutes }: RouteContextData = useContext(RouteContext)
2321

2422
const rootRoute: PlatformRoute | undefined = [
@@ -34,19 +32,26 @@ const ContentLayout: FC<ContentLayoutProps> = (props: ContentLayoutProps) => {
3432
toolRoute: rootRoute.route,
3533
}))
3634
|| []
37-
const hideSectionsClass: string = !!sections.length ? '' : styles['hide-sections']
35+
const hideSectionsClass: string = !sections.length ? '' : styles['show-sections']
3836

3937
return (
4038
<>
4139
<div className={classNames(styles.content, props.classNames, hideSectionsClass)}>
40+
4241
<Sections sections={sections}></Sections>
43-
<div>
44-
<h1>{props.title}</h1>
45-
{props.children}
46-
<div>
47-
Logged in as: {profile?.handle || 'Not Logged In'}
42+
43+
<div className={styles['content-outer']}>
44+
45+
<div className={styles['content-inner']}>
46+
47+
<h1>{props.title}</h1>
48+
49+
{props.children}
50+
4851
</div>
52+
4953
</div>
54+
5055
</div>
5156
</>
5257
)

src/lib/content-layout/sections/Sections.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import '../../styles/';
22

33
.sections {
4-
height: $content-height;
4+
@include content-height;
55

66
@include ltemd {
77
display: none;

0 commit comments

Comments
 (0)