Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/components/ChallengeEditor/ChallengeView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const ChallengeView = ({
<Helmet title='View Details' />
{!isTask && (
<div className={cn(styles.actionButtons, styles.button, styles.actionButtonsLeft)}>
<LegacyLinks challenge={challenge} />
<LegacyLinks challenge={challenge} challengeView />
</div>
)}
<div className={styles.title}>View Details</div>
Expand Down Expand Up @@ -230,15 +230,6 @@ const ChallengeView = ({
readOnly
/>
)}
<div>
{ challenge.discussions && challenge.discussions.map(d => (
<div key={d.id} className={cn(styles.row, styles.topRow)}>
<div className={styles.col}>
<span><span className={styles.fieldTitle}>Forum:</span> <a href={d.url} target='_blank' rel='noopener noreferrer'>{d.name}</a></span>
</div>
</div>
))}
</div>
</div>
<div className={styles.group}>
<div className={styles.title}>Public specification <span>*</span></div>
Expand Down
25 changes: 25 additions & 0 deletions src/components/LegacyLinks/LegacyLinks.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.container {
display: flex;
margin-top: auto;
align-items: center;

button:not(:first-child),
a:not(:first-child) {
Expand All @@ -13,4 +14,28 @@
outline: none;
white-space: nowrap;
}

.row {
margin-bottom: 0;

&.topRow {
flex-wrap: wrap;
}
}

.col {
margin-right: 20px;
display: flex;
align-items: center;

.fieldTitle {
@include roboto-bold();

font-size: 16px;
line-height: 19px;
font-weight: 500;
color: $tc-gray-80;
margin-right: 10px;
}
}
}
15 changes: 13 additions & 2 deletions src/components/LegacyLinks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
*/
import React, { useCallback } from 'react'
import PropTypes from 'prop-types'
import cn from 'classnames'
import styles from './LegacyLinks.module.scss'
import { DIRECT_PROJECT_URL, MESSAGE, ONLINE_REVIEW_URL } from '../../config/constants'
import PrimaryButton from '../Buttons/PrimaryButton'
import Tooltip from '../Tooltip'

const LegacyLinks = ({ challenge }) => {
const LegacyLinks = ({ challenge, challengeView }) => {
const onClick = useCallback((e) => {
e.stopPropagation()
}, [])
Expand Down Expand Up @@ -38,12 +39,22 @@ const LegacyLinks = ({ challenge }) => {
</Tooltip>
</>
)}
<div>
{ challengeView && challenge.discussions && challenge.discussions.map(d => (
<div key={d.id} className={cn(styles.row, styles.topRow)}>
<div className={styles.col} >
<span><span className={styles.fieldTitle}>Forum:</span> <a href={d.url} target='_blank' rel='noopener noreferrer'>{d.name}</a></span>
</div>
</div>
))}
</div>
</div>
)
}

LegacyLinks.propTypes = {
challenge: PropTypes.object
challenge: PropTypes.object,
challengeView: PropTypes.bool
}

export default LegacyLinks