Skip to content

Commit 7544307

Browse files
author
vikasrohit
authored
Merge pull request #909 from maxceem/issue-900
feat: show link to Direct project
2 parents 995fee1 + b549332 commit 7544307

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

src/components/ChallengesComponent/ChallengesComponent.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
padding: 0 20px;
2525
}
2626

27+
.titleLinks {
28+
align-items: center;
29+
display: flex;
30+
31+
> a + a {
32+
margin-left: 20px;
33+
}
34+
}
35+
2736
.buttonLaunchNew {
2837
min-width: 135px;
2938
height: 40px;

src/components/ChallengesComponent/index.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types'
66
import Sticky from 'react-stickynode'
77
import { Helmet } from 'react-helmet'
88
import { Link } from 'react-router-dom'
9-
import { CONNECT_APP_URL } from '../../config/constants'
9+
import { CONNECT_APP_URL, DIRECT_PROJECT_URL } from '../../config/constants'
1010

1111
import { PrimaryButton } from '../Buttons'
1212
import ChallengeList from './ChallengeList'
@@ -32,17 +32,26 @@ const ChallengesComponent = ({
3232
<div>
3333
<Helmet title={activeProject ? activeProject.name : ''} />
3434
<div className={styles.titleContainer}>
35-
{(activeProject && activeProject.id) ? (
36-
<a
37-
className={styles.buttonLaunchNew}
38-
href={`${CONNECT_APP_URL}/projects/${activeProject.id}`}
39-
target={'_blank'}
40-
>
41-
<PrimaryButton text={'View Project in Connect'} type={'info'} />
42-
</a>
43-
) : (
44-
<span />
45-
)}
35+
<div className={styles.titleLinks}>
36+
{activeProject && activeProject.id && (
37+
<a
38+
className={styles.buttonLaunchNew}
39+
href={`${CONNECT_APP_URL}/projects/${activeProject.id}`}
40+
target={'_blank'}
41+
>
42+
<PrimaryButton text={'View Project in Connect'} type={'info'} />
43+
</a>
44+
)}
45+
{activeProject && activeProject.directProjectId && (
46+
<a
47+
className={styles.buttonLaunchNew}
48+
href={`${DIRECT_PROJECT_URL}/projectOverview?formData.projectId=${activeProject.directProjectId}`}
49+
target={'_blank'}
50+
>
51+
<PrimaryButton text={'View Project in Direct'} type={'info'} />
52+
</a>
53+
)}
54+
</div>
4655
<div
4756
className={styles.title}
4857
dangerouslySetInnerHTML={{

0 commit comments

Comments
 (0)