Skip to content

Commit 0ede0a4

Browse files
Merge pull request #389 from topcoder-platform/PROD-1516_work-filter
PROD-1516 work filter -> qa
2 parents 9e620ef + 5814a4a commit 0ede0a4

File tree

106 files changed

+1353
-997
lines changed

Some content is hidden

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

106 files changed

+1353
-997
lines changed

src-ts/header/Header.module.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../lib/styles';
1+
@import '../lib/styles/includes';
22

33
.header-wrap {
44
display: block;
@@ -19,10 +19,6 @@
1919
grid-template-columns: $header-height 1fr $header-height;
2020
align-items: center;
2121
}
22-
23-
@include ltesm {
24-
height: $header-height;
25-
}
2622
}
2723

2824
.subheader {

src-ts/header/logo/Logo.module.scss

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

33
.logo-no-link,
44
.logo-link {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../lib/styles';
1+
@import '../../../lib/styles/includes';
22

33
.tool-selectors-narrow {
44
display: none;
@@ -22,6 +22,7 @@
2222
top: $header-height;
2323
left: 0;
2424
bottom: 0;
25+
height: $content-height;
2526
width: calc(100% - calc(2 * $pad-xxl));
2627
z-index: 100;
2728
background-color: $black-100;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../../lib/styles';
1+
@import '../../../../lib/styles/includes';
22

33
.tool-selector-narrow {
44

@@ -13,7 +13,7 @@
1313
border-top: 1px solid $black-60;
1414
padding: $pad-lg 0;
1515
color: $tc-white;
16-
@include font-weight-medium;
16+
font-weight: $font-weight-medium;
1717
background-color: $black-100;
1818

1919
svg {

src-ts/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
import classNames from 'classnames'
2-
import { FC } from 'react'
2+
import { FC, useContext } from 'react'
33
import { Link, useLocation } from 'react-router-dom'
44

5-
import { IconOutline, PlatformRoute, routeIsActive } from '../../../../lib'
5+
import { IconOutline, PlatformRoute, routeContext, RouteContextData, routeIsActive } from '../../../../lib'
66

77
import styles from './ToolSelectorNarrow.module.scss'
88

99
interface ToolSelectorNarrowProps {
1010
route: PlatformRoute
1111
}
1212

13+
const isParamRoute: (route: string) => boolean = (route: string) => !!route.match(/^:[^/]+$/)
14+
1315
const ToolSelectorNarrow: FC<ToolSelectorNarrowProps> = (props: ToolSelectorNarrowProps) => {
1416

15-
const route: PlatformRoute = props.route
16-
const path: string = props.route.route
17+
const { getPathFromRoute }: RouteContextData = useContext(routeContext)
18+
const toolRoute: PlatformRoute = props.route
19+
const toolPath: string = getPathFromRoute(toolRoute)
1720

1821
const baseClass: string = 'tool-selector-narrow'
19-
const isActive: boolean = routeIsActive(useLocation().pathname, path)
22+
const isActive: boolean = routeIsActive(useLocation().pathname, toolPath)
2023
const activeIndicaterClass: string = `${baseClass}-${isActive ? '' : 'in'}active`
21-
const hasChildren: boolean = !!route.children.some(child => !!child.route)
24+
const hasChildren: boolean = !!toolRoute.children.some(child => !!child.route && !isParamRoute(child.route))
2225

2326
return (
2427
<div className={styles[baseClass]}>
2528
<Link
2629
className={classNames(styles[`${baseClass}-link`], styles[activeIndicaterClass])}
27-
key={path}
28-
to={path}
30+
key={toolPath}
31+
to={toolPath}
2932
>
30-
{route.title}
33+
{toolRoute.title}
3134
{hasChildren && <IconOutline.ChevronRightIcon />}
3235
</Link>
3336
</div>

src-ts/header/tool-selectors/tool-selectors-wide/ToolSelectorsWide.module.scss

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

33
.tool-selectors-wide {
44
display: flex;

src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.module.scss

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

33
.tool-selector-wide {
44
padding-right: 0;

src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ import classNames from 'classnames'
22
import { FC, useContext } from 'react'
33
import { Link, useLocation } from 'react-router-dom'
44

5-
import { ToolTitle } from '../../../../config'
6-
import { PlatformRoute, routeContext, RouteContextData, routeIsActive, routeIsHome } from '../../../../lib'
5+
import {
6+
PlatformRoute,
7+
routeContext,
8+
RouteContextData,
9+
routeIsActive,
10+
routeIsHome,
11+
} from '../../../../lib'
712
import '../../../../lib/styles/index.scss'
813

914
import styles from './ToolSelectorWide.module.scss'
@@ -14,15 +19,17 @@ interface ToolSelectorWideProps {
1419

1520
const ToolSelectorWide: FC<ToolSelectorWideProps> = (props: ToolSelectorWideProps) => {
1621

17-
const { getPath, getPathFromRoute }: RouteContextData = useContext(routeContext)
18-
const currentPath: string = useLocation().pathname
22+
const { getPathFromRoute }: RouteContextData = useContext(routeContext)
23+
const activePath: string = useLocation().pathname
24+
const toolRoute: PlatformRoute = props.route
25+
const toolPath: string = getPathFromRoute(toolRoute)
26+
27+
const isActive: boolean = routeIsActive(activePath, toolPath)
1928

20-
// for now, the work tool should be active for all pages except the account
21-
const isActive: boolean = !routeIsActive(currentPath, getPath(ToolTitle.settings))
2229
const activeIndicatorClass: string = `tool-selector-wide-${isActive ? '' : 'in'}active`
2330

2431
// the tool link should be usable for all active routes except the home page
25-
const isLink: boolean = isActive && !routeIsHome(currentPath)
32+
const isLink: boolean = isActive && !routeIsHome(activePath)
2633

2734
return (
2835
<div className={classNames(
@@ -33,9 +40,9 @@ const ToolSelectorWide: FC<ToolSelectorWideProps> = (props: ToolSelectorWideProp
3340
<Link
3441
className='large-tab'
3542
tabIndex={-1}
36-
to={getPathFromRoute(props.route)}
43+
to={toolPath}
3744
>
38-
{props.route.title}
45+
{toolRoute.title}
3946
</Link>
4047
<div className={styles['active-indicator']}></div>
4148
</div>

src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/ProfileSelector.module.scss

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

33
.profile-selector {
44
display: flex;

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

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

33
$overlaySquare: $pad-xxxxl;
44

0 commit comments

Comments
 (0)