File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/components/LegacyLinks Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import React, { useCallback } from 'react'
55import PropTypes from 'prop-types'
66import cn from 'classnames'
77import 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
1011const 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 ) } >
You can’t perform that action at this time.
0 commit comments