11import React , { useState , useEffect } from 'react'
22import _ from 'lodash'
3- import { Helmet } from 'react-helmet'
43import PropTypes from 'prop-types'
54import cn from 'classnames'
65import { withRouter } from 'react-router-dom'
76import styles from './ChallengeView.module.scss'
87import xss from 'xss'
9- import { PrimaryButton } from '../../Buttons'
108import Track from '../../Track'
119import NDAField from '../NDAField'
1210import UseSchedulingAPIField from '../UseSchedulingAPIField'
@@ -19,13 +17,11 @@ import CopilotFeeField from '../CopilotFee-Field'
1917import ChallengeTotalField from '../ChallengeTotal-Field'
2018import Loader from '../../Loader'
2119import PhaseInput from '../../PhaseInput'
22- import LegacyLinks from '../../LegacyLinks'
2320import AssignedMemberField from '../AssignedMember-Field'
2421import { getResourceRoleByName } from '../../../util/tc'
2522import { isBetaMode } from '../../../util/cookie'
2623import { loadGroupDetails } from '../../../actions/challenges'
27- import Tooltip from '../../Tooltip'
28- import { MESSAGE , REVIEW_TYPES } from '../../../config/constants'
24+ import { REVIEW_TYPES } from '../../../config/constants'
2925
3026const ChallengeView = ( {
3127 projectDetail,
@@ -86,47 +82,6 @@ const ChallengeView = ({
8682 const isTask = _ . get ( challenge , 'task.isTask' , false )
8783 return (
8884 < div className = { styles . wrapper } >
89- < Helmet title = 'View Details' />
90- { ! isTask && (
91- < div className = { cn ( styles . actionButtons , styles . button , styles . actionButtonsLeft ) } >
92- < LegacyLinks challenge = { challenge } challengeView />
93- </ div >
94- ) }
95- < div className = { styles . title } > View Details</ div >
96- < div className = { cn ( styles . actionButtons , styles . button , styles . actionButtonsRight ) } >
97- {
98- challenge . status === 'Draft' && (
99- < div className = { styles . button } >
100- { ( challenge . legacyId || isTask ) ? (
101- < PrimaryButton text = { 'Launch' } type = { 'info' } onClick = { onLaunchChallenge } />
102- ) : (
103- < Tooltip content = { MESSAGE . NO_LEGACY_CHALLENGE } >
104- { /* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */ }
105- < PrimaryButton text = { 'Launch' } type = { 'disabled' } />
106- </ Tooltip >
107- ) }
108- </ div >
109- )
110- }
111- {
112- isTask && challenge . status === 'Active' && (
113- < div className = { styles . button } >
114- { assignedMemberDetails ? (
115- < Tooltip content = { MESSAGE . MARK_COMPLETE } >
116- < PrimaryButton text = { 'Mark Complete' } type = { 'success' } onClick = { onCloseTask } />
117- </ Tooltip >
118- ) : (
119- < Tooltip content = { MESSAGE . NO_TASK_ASSIGNEE } >
120- { /* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */ }
121- < PrimaryButton text = { 'Mark Complete' } type = { 'disabled' } />
122- </ Tooltip >
123- ) }
124- </ div >
125- )
126- }
127- { enableEdit && < PrimaryButton text = { 'Edit' } type = { 'info' } submit link = { `./edit` } /> }
128- < PrimaryButton text = { 'Back' } type = { 'info' } submit link = { `..` } />
129- </ div >
13085 < div className = { styles . container } >
13186 < div className = { styles . formContainer } >
13287 < div className = { styles . group } >
0 commit comments