Skip to content

Commit fb6ae72

Browse files
committed
Merge branch 'onboarding' of github.com:topcoder-platform/platform-ui into onboarding
2 parents 50b0600 + 9a8b7d4 commit fb6ae72

File tree

25 files changed

+712
-0
lines changed

25 files changed

+712
-0
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"vue.features.codeActions.enable": false
3+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { FC } from 'react'
2+
3+
import styles from './styles.module.scss'
4+
5+
interface ProgressBarProps {
6+
progress: number
7+
className?: string
8+
}
9+
10+
export const ProgressBar: FC<ProgressBarProps> = (props: ProgressBarProps) => {
11+
12+
const progressProps: React.CSSProperties & { '--progress': number } = {
13+
'--progress': props.progress,
14+
}
15+
16+
return (
17+
<div className={props.className}>
18+
<span>#/##</span>
19+
<div className={styles.wrap}>
20+
<div
21+
className='progress'
22+
style={progressProps}
23+
/>
24+
</div>
25+
</div>
26+
)
27+
}
28+
29+
export default ProgressBar
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@import '../../../../libs/ui/lib/styles/includes';
2+
3+
.wrap {
4+
background: $black-10;
5+
border-radius: $sp-1;
6+
height: 4px;
7+
width: 100%;
8+
display: flex;
9+
10+
:global(.progress) {
11+
background: gray;
12+
border-radius: inherit;
13+
width: calc(var(--progress, 0) * 100%);
14+
position: relative;
15+
16+
.percentage {
17+
position: absolute;
18+
top: 1px;
19+
font-family: $font-barlow;
20+
font-style: normal;
21+
font-weight: $font-weight-bold;
22+
font-size: 11px;
23+
line-height: 14px;
24+
color: $black-100;
25+
}
26+
}
27+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React, { FC } from 'react'
2+
import classNames from 'classnames'
3+
4+
import { Skill } from '~/apps/talent-search/src/lib/models'
5+
6+
import XIcon from '../../assets/images/x-icon.svg'
7+
8+
import styles from './styles.module.scss'
9+
10+
interface SkillTagProps {
11+
skill: Skill
12+
onDelete?: () => void
13+
}
14+
15+
const SkillTag: FC<SkillTagProps> = (props: SkillTagProps) => (
16+
<div className={classNames('d-flex align-items-center', styles.container)}>
17+
{props.skill.name}
18+
<button type='button' className={styles.btnDelete} onClick={props.onDelete}>
19+
<img width={7} height={7} src={XIcon} alt='' />
20+
</button>
21+
</div>
22+
)
23+
24+
export default SkillTag
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.container {
2+
background-color: gray;
3+
color: white;
4+
border-radius: 3px;
5+
padding: 0 10px;
6+
font-size: 14px;
7+
gap: 5px;
8+
}
9+
10+
.btnDelete {
11+
display: flex;
12+
align-items: center;
13+
justify-content: center;
14+
background-color: white;
15+
border-radius: 100%;
16+
flex-shrink: 0;
17+
width: 15px;
18+
height: 15px;
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const ACTIONS: {
2+
MEMBER: {
3+
GET_MEMBER: string;
4+
UPDATE_MEMBER_SKILLS: string;
5+
};
6+
} = {
7+
MEMBER: {
8+
GET_MEMBER: 'GET_MEMBER',
9+
UPDATE_MEMBER_SKILLS: 'UPDATE_MEMBER_SKILLS',
10+
},
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default interface SkillInfo {
2+
category: string;
3+
emsiId: string;
4+
name: string;
5+
skillSources?: string[];
6+
subCategory: string;
7+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { Navigate } from 'react-router-dom'
2+
3+
import { ToolTitle } from '~/config/constants'
4+
import { lazyLoad, LazyLoadedComponent, PlatformRoute } from '~/libs/core'
5+
6+
const PageOnboarding: LazyLoadedComponent = lazyLoad(() => import('./pages/onboarding/index'), 'OnboardingWrapper')
7+
const PageStart: LazyLoadedComponent = lazyLoad(() => import('./pages/start/index'), 'PageStart')
8+
const PageSkills: LazyLoadedComponent = lazyLoad(() => import('./pages/skills/index'), 'PageSkills')
9+
const toolTitle: string = ToolTitle.onboarding
10+
const onboardingRootRoute: string = '/onboarding'
11+
12+
export const onboardRouteId: string = `${toolTitle} Onbarding`
13+
14+
export const onboardingRoutes: ReadonlyArray<PlatformRoute> = [
15+
{
16+
authRequired: true,
17+
children: [
18+
{
19+
element: <Navigate to='./start' />,
20+
route: '/',
21+
},
22+
{
23+
element: <PageStart />,
24+
route: '/start',
25+
title: toolTitle,
26+
},
27+
{
28+
element: <PageSkills />,
29+
route: '/skills',
30+
title: toolTitle,
31+
},
32+
],
33+
element: <PageOnboarding />,
34+
id: onboardRouteId,
35+
route: onboardingRootRoute,
36+
title: toolTitle,
37+
},
38+
]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { FC, useContext, useEffect } from 'react'
2+
import { Outlet, Routes } from 'react-router-dom'
3+
import { connect, Provider } from 'react-redux'
4+
import classNames from 'classnames'
5+
6+
import { ContentLayout } from '~/libs/ui'
7+
import { routerContext, RouterContextData } from '~/libs/core'
8+
9+
import { onboardRouteId } from '../../onboarding.routes'
10+
import { fetchMemberInfo } from '../../redux/actions/member'
11+
import store from '../../redux/store'
12+
import '../../styles/global/_index.scss'
13+
14+
import styles from './styles.module.scss'
15+
16+
const OnboardingContent: FC<{ fetchMemberInfo: () => void }> = props => {
17+
const { getChildRoutes }: RouterContextData = useContext(routerContext)
18+
useEffect(() => {
19+
props.fetchMemberInfo()
20+
/* eslint-disable react-hooks/exhaustive-deps */
21+
}, [])
22+
23+
return (
24+
<div className={classNames('d-flex flex-column', styles.container)}>
25+
<Outlet />
26+
<Routes>
27+
{getChildRoutes(onboardRouteId)}
28+
</Routes>
29+
</div>
30+
)
31+
}
32+
33+
const mapDispatchToProps: any = {
34+
fetchMemberInfo,
35+
}
36+
const Onboarding: any = connect(undefined, mapDispatchToProps)(OnboardingContent)
37+
38+
export const OnboardingWrapper: FC<{}> = () => (
39+
<ContentLayout>
40+
<Provider store={store}>
41+
<Onboarding />
42+
</Provider>
43+
</ContentLayout>
44+
)
45+
46+
export default OnboardingWrapper

0 commit comments

Comments
 (0)