Skip to content

Commit 99c4cc7

Browse files
committed
fix issue #1195 #1203 #1204
1 parent c3ebfa0 commit 99c4cc7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/LegacyLinks/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import React, { useCallback } from 'react'
55
import PropTypes from 'prop-types'
66
import cn from 'classnames'
77
import styles from './LegacyLinks.module.scss'
8-
import { ONLINE_REVIEW_URL } from '../../config/constants'
8+
import Tooltip from '../Tooltip'
9+
import { MESSAGE, ONLINE_REVIEW_URL } from '../../config/constants'
910

1011
const LegacyLinks = ({ challenge, challengeView }) => {
1112
const onClick = useCallback((e) => {
@@ -15,7 +16,12 @@ const LegacyLinks = ({ challenge, challengeView }) => {
1516
const orUrl = `${ONLINE_REVIEW_URL}/review/actions/ViewProjectDetails?pid=${challenge.legacyId}`
1617
return (
1718
<div className={styles.container}>
18-
( <a href={orUrl} target={'_blank'} onClick={onClick}>Online Review</a> )
19+
( {challenge.legacyId ? <a href={orUrl} target={'_blank'} onClick={onClick}>Online Review</a>
20+
: <Tooltip content={MESSAGE.NO_LEGACY_CHALLENGE}>
21+
{/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */}
22+
<a disabled>Online Review</a>
23+
</Tooltip>}
24+
)
1925
<div>
2026
{ challengeView && challenge.discussions && challenge.discussions.map(d => (
2127
<div key={d.id} className={cn(styles.row, styles.topRow)}>

0 commit comments

Comments
 (0)