Skip to content

Commit 5393081

Browse files
Merge pull request #385 from topcoder-platform/PROD-1561_details-summary
PROD-1561 details summary -> qa
2 parents d5f928c + d98d1a5 commit 5393081

File tree

120 files changed

+1760
-780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1760
-780
lines changed

src-ts/header/Header.module.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@
2424
@include ltesm {
2525
height: $header-height-sm;
2626
}
27-
}
27+
}
28+
29+
.subheader {
30+
width: 100%;
31+
position: relative;
32+
}

src-ts/header/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const Header: FC<{}> = () => {
1414
<ToolSelectors isWide={true} />
1515
<UtilitySelectors />
1616
</header>
17+
<div id='page-subheader-portal-el' className={styles.subheader}></div>
1718
</div>
1819
)
1920
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import classNames from 'classnames'
2-
import { FC, MutableRefObject, useContext } from 'react'
3-
import { Link, NavigateFunction, useNavigate } from 'react-router-dom'
2+
import { FC, useContext } from 'react'
3+
import { NavigateFunction, useNavigate } from 'react-router-dom'
44

55
import {
66
authUrlLogout,
@@ -37,9 +37,7 @@ const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
3737
const name: string = `${profile.firstName} ${profile.lastName?.substring(0, 1)}${!!profile.lastName ? '.' : undefined}`
3838

3939
return (
40-
<div
41-
className={styles['profile-panel']}
42-
>
40+
<div className={styles['profile-panel']}>
4341
<div className={styles['arrow-tip']}>
4442
<TooltipArrowIcon />
4543
</div>

src-ts/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
export { default as AppNextGen } from './App'
22
export { EnvironmentConfig } from './config'
3-
export { logInitialize, ProfileProvider, RouteProvider } from './lib'
3+
export {
4+
ChallengeMetadataName,
5+
Breadcrumb,
6+
logInitialize,
7+
ProfileProvider,
8+
RouteProvider,
9+
TabsNavbar,
10+
workContext,
11+
WorkStatusItem,
12+
} from './lib'
413
export * from './utils'
514
export * from './tools'

src/components/Breadcrumb/style.scss renamed to src-ts/lib/breadcrumb/Breadcrumb.module.scss

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,55 @@
1-
@import "styles/include";
1+
@import '../styles';
2+
3+
.breadcrumb-wrap {
4+
width: 100%;
5+
background: $black-5;
6+
}
27

38
.breadcrumb {
4-
padding: 12px 24px;
5-
background: $grey-bg;
9+
padding: $pad-md 0;
10+
max-width: $xxl-min;
11+
margin: 0 auto;
12+
@include pagePaddings;
13+
614
ol {
715
display: flex;
16+
817
> li {
918
display: inline-flex;
1019
align-items: center;
1120
padding: 0;
21+
1222
a {
1323
@extend .overline;
1424
display: block;
15-
padding: 12px;
16-
color: $gray-80;
25+
padding: $pad-md;
26+
color: $black-80;
1727
cursor: pointer;
1828
}
29+
30+
&:first-child a {
31+
padding-left: 0;
32+
}
33+
1934
&:not(:last-child)::after {
2035
content: '';
21-
display:inline-block;
22-
width: 8px;
23-
height: 8px;
36+
display: inline-block;
37+
width: $pad-sm;
38+
height: $pad-sm;
2439
border-style: solid;
25-
border-width: 1px 1px 0 0;
40+
border-width: $border-xs $border-xs 0 0;
2641
border-color: $black-60;
27-
transform:rotate(45deg)
42+
transform: rotate(45deg)
2843
}
44+
2945
&:last-child a:last-child {
3046
pointer-events: none;
3147
}
48+
3249
&:last-child,
3350
&:hover {
3451
a {
35-
color: $grey-text;
52+
color: $black-100;
3653
}
3754
}
3855
}

src-ts/lib/breadcrumb/Breadcrumb.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { FC } from 'react'
2+
import { createPortal } from 'react-dom'
3+
4+
import { BreadcrumbItem, BreadcrumbItemModel } from './breadcrumb-item'
5+
import styles from './Breadcrumb.module.scss'
6+
7+
interface BreadcrumbProps {
8+
items: Array<BreadcrumbItemModel>
9+
}
10+
11+
const Breadcrumb: FC<BreadcrumbProps> = (props: BreadcrumbProps) => {
12+
const portalRootEl: HTMLElement|null = document.getElementById('page-subheader-portal-el')
13+
14+
if (!portalRootEl) {
15+
return <></>
16+
}
17+
18+
return createPortal((
19+
<div className={styles['breadcrumb-wrap']}>
20+
<nav className={styles.breadcrumb}>
21+
<ol>
22+
{props.items.map((item, index) =>
23+
<BreadcrumbItem
24+
index={index + 1}
25+
item={item}
26+
key={index}
27+
/>
28+
)}
29+
</ol>
30+
</nav>
31+
</div>
32+
), portalRootEl)
33+
}
34+
35+
export default Breadcrumb
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Link } from '@reach/router'
2+
import { FC } from 'react'
3+
4+
import { BreadcrumbItemModel } from './breadcrumb-item.model'
5+
6+
interface BreadcrumbItemProps {
7+
index: number
8+
item: BreadcrumbItemModel
9+
}
10+
11+
const BreadcrumbItem: FC<BreadcrumbItemProps> = (props: BreadcrumbItemProps) => {
12+
return (
13+
<li key={props.index}>
14+
<Link to={props.item.url}>
15+
{props.item.name}
16+
</Link>
17+
</li>
18+
)
19+
}
20+
21+
export default BreadcrumbItem
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface BreadcrumbItemModel {
2+
name: string
3+
url: string
4+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './breadcrumb-item.model'
2+
export { default as BreadcrumbItem } from './BreadcrumbItem'

src-ts/lib/breadcrumb/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Breadcrumb } from './Breadcrumb'

0 commit comments

Comments
 (0)