Skip to content

Commit 10cbbc9

Browse files
Merge pull request #401 from topcoder-platform/dev-qa
Merge qa into develop
2 parents b592878 + 33b40d3 commit 10cbbc9

File tree

291 files changed

+5996
-5269
lines changed

Some content is hidden

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

291 files changed

+5996
-5269
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.22.1
1+
16.15.0

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
"@babel/preset-react": "^7.7.4",
2424
"@babel/preset-typescript": "^7.16.7",
2525
"@babel/runtime": "^7.8.7",
26-
"@stripe/react-stripe-js": "1.3.0",
27-
"@stripe/stripe-js": "1.3.0",
26+
"@stripe/react-stripe-js": "1.7.2",
27+
"@stripe/stripe-js": "1.29.0",
2828
"@testing-library/jest-dom": "^5.5.0",
2929
"@testing-library/react": "^9.4.0",
3030
"@types/jest": "^25.2.3",
31+
"@types/lodash": "^4.14.182",
3132
"@types/node": "^17.0.24",
3233
"@types/reach__router": "^1.3.10",
3334
"@types/react": "^18.0.5",

src-ts/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Routes } from 'react-router-dom'
33
import { toast, ToastContainer } from 'react-toastify'
44

55
import { Header } from './header'
6-
import { ProfileProvider, routeContext, RouteContextData } from './lib'
6+
import { routeContext, RouteContextData } from './lib'
77

88
const App: FC<{}> = () => {
99

@@ -13,7 +13,7 @@ const App: FC<{}> = () => {
1313
.map(route => getRouteElement(route))
1414

1515
return (
16-
<ProfileProvider>
16+
<>
1717
<Header />
1818
<Routes>
1919
{routeElements}
@@ -29,7 +29,7 @@ const App: FC<{}> = () => {
2929
draggable
3030
pauseOnHover
3131
/>
32-
</ProfileProvider>
32+
</>
3333
)
3434
}
3535

src-ts/config/constants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ export enum ToolTitle {
22
settings = 'Account Settings',
33
work = 'Work',
44
}
5+
6+
export enum FooterSocialConfig {
7+
facebook = 'https://www.facebook.com/topcoder',
8+
youtube = 'https://www.youtube.com/channel/UCFv29ANLT2FQmtvS9DRixNA',
9+
linkedin = 'https://www.linkedin.com/company/topcoder',
10+
twitter = 'https://twitter.com/topcoder',
11+
instagram = 'https://www.instagram.com/topcoder',
12+
}

src-ts/header/Header.module.scss

Lines changed: 6 additions & 6 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;
@@ -16,12 +16,12 @@
1616
grid-template-columns: 78px 1fr auto;
1717

1818
@include ltemd {
19-
height: $header-height-md;
2019
grid-template-columns: $header-height 1fr $header-height;
2120
align-items: center;
2221
}
22+
}
2323

24-
@include ltesm {
25-
height: $header-height-sm;
26-
}
27-
}
24+
.subheader {
25+
width: 100%;
26+
position: relative;
27+
}

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/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 & 9 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-selectors-narrow {
44
display: none;
@@ -22,17 +22,10 @@
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;
2829
padding: $pad-xxl;
29-
30-
@include ltemd {
31-
top: $header-height-md;
32-
}
33-
34-
@include ltesm {
35-
top: $header-height-sm;
36-
}
3730
}
3831
}

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

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

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

34
$arrowTipIconHeight: 9px;
45

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/header/utility-selectors/UtilitySelector/ProfileSelector/profile-not-logged-in/ProfileNotLoggedIn.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
@include ltemd {
44
.login,

src-ts/header/utility-selectors/UtilitySelectors.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
.utility-selectors {
44
display: flex;

src-ts/index.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
export { default as AppNextGen } from './App'
22
export { EnvironmentConfig } from './config'
3-
export { logInitialize, ProfileProvider, RouteProvider } from './lib'
3+
export {
4+
Breadcrumb,
5+
ChallengeMetadataName,
6+
ContactSupportModal,
7+
logInitialize,
8+
OrderContractModal,
9+
PageFooter,
10+
PrivacyPolicyModal,
11+
ProfileProvider,
12+
RouteProvider,
13+
TabsNavbar,
14+
TermsModal,
15+
workContext,
16+
WorkStatusItem,
17+
} from './lib'
418
export * from './utils'
519
export * from './tools'

src-ts/lib/avatar/Avatar.module.scss

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

34
$avatar-size-sm: 32px;
45
$border-size-sm: $border;
@@ -49,7 +50,7 @@ $border-size-xl: $pad-xs;
4950
align-items: center;
5051
color: $tc-white;
5152
background-color: $blue-100;
52-
@include font-weight-medium;
53+
font-weight: $font-weight-medium;
5354

5455
&.sm {
5556
@extend .medium-subtitle;

0 commit comments

Comments
 (0)