Skip to content

Commit de01c40

Browse files
committed
issue 1170 fix
1 parent afcfa2f commit de01c40

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

src/components/ChallengeEditor/ChallengeView/index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const ChallengeView = ({
8989
<Helmet title='View Details' />
9090
{!isTask && (
9191
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsLeft)}>
92-
<LegacyLinks challenge={challenge} />
92+
<LegacyLinks challenge={challenge} challengeView />
9393
</div>
9494
)}
9595
<div className={styles.title}>View Details</div>
@@ -230,15 +230,6 @@ const ChallengeView = ({
230230
readOnly
231231
/>
232232
)}
233-
<div>
234-
{ challenge.discussions && challenge.discussions.map(d => (
235-
<div key={d.id} className={cn(styles.row, styles.topRow)}>
236-
<div className={styles.col}>
237-
<span><span className={styles.fieldTitle}>Forum:</span> <a href={d.url} target='_blank' rel='noopener noreferrer'>{d.name}</a></span>
238-
</div>
239-
</div>
240-
))}
241-
</div>
242233
</div>
243234
<div className={styles.group}>
244235
<div className={styles.title}>Public specification <span>*</span></div>

src/components/LegacyLinks/LegacyLinks.module.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.container {
33
display: flex;
44
margin-top: auto;
5+
align-items: center;
56

67
button:not(:first-child),
78
a:not(:first-child) {
@@ -13,4 +14,28 @@
1314
outline: none;
1415
white-space: nowrap;
1516
}
17+
18+
.row {
19+
margin-bottom: 0;
20+
21+
&.topRow {
22+
flex-wrap: wrap;
23+
}
24+
}
25+
26+
.col {
27+
margin-right: 20px;
28+
display: flex;
29+
align-items: center;
30+
31+
.fieldTitle {
32+
@include roboto-bold();
33+
34+
font-size: 16px;
35+
line-height: 19px;
36+
font-weight: 500;
37+
color: $tc-gray-80;
38+
margin-right: 10px;
39+
}
40+
}
1641
}

src/components/LegacyLinks/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
*/
44
import React, { useCallback } from 'react'
55
import PropTypes from 'prop-types'
6+
import cn from 'classnames'
67
import styles from './LegacyLinks.module.scss'
78
import { DIRECT_PROJECT_URL, MESSAGE, ONLINE_REVIEW_URL } from '../../config/constants'
89
import PrimaryButton from '../Buttons/PrimaryButton'
910
import Tooltip from '../Tooltip'
1011

11-
const LegacyLinks = ({ challenge }) => {
12+
const LegacyLinks = ({ challenge, challengeView }) => {
1213
const onClick = useCallback((e) => {
1314
e.stopPropagation()
1415
}, [])
@@ -38,12 +39,22 @@ const LegacyLinks = ({ challenge }) => {
3839
</Tooltip>
3940
</>
4041
)}
42+
<div>
43+
{ challengeView && challenge.discussions && challenge.discussions.map(d => (
44+
<div key={d.id} className={cn(styles.row, styles.topRow)}>
45+
<div className={styles.col} >
46+
<span><span className={styles.fieldTitle}>Forum:</span> <a href={d.url} target='_blank' rel='noopener noreferrer'>{d.name}</a></span>
47+
</div>
48+
</div>
49+
))}
50+
</div>
4151
</div>
4252
)
4353
}
4454

4555
LegacyLinks.propTypes = {
46-
challenge: PropTypes.object
56+
challenge: PropTypes.object,
57+
challengeView: PropTypes.bool
4758
}
4859

4960
export default LegacyLinks

0 commit comments

Comments
 (0)