@@ -2,6 +2,7 @@ import { Button, Card, Classes, Collapse, Elevation, Icon, Pre, Tooltip } from '
22import { IconNames } from '@blueprintjs/icons' ;
33import classNames from 'classnames' ;
44import React , { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
5+ import { useTranslation } from 'react-i18next' ;
56
67import { ContestEntry } from '../../assessment/AssessmentTypes' ;
78
@@ -34,6 +35,7 @@ const SideContentContestVoting: React.FC<SideContentContestVotingProps> = ({
3435 handleContestEntryClick,
3536 handleVotingSubmissionChange
3637} ) => {
38+ const { t } = useTranslation ( 'sideContent' , { keyPrefix : 'contestVoting' } ) ;
3739 const [ showContestEntries , setShowContestEntries ] = useState ( true ) ;
3840 const [ currentDraggedItem , setCurrentDraggedItem ] = useState < HTMLElement | null > ( null ) ;
3941 const [ hoveredTier , setHoveredTier ] = useState < string | null > ( null ) ;
@@ -166,21 +168,22 @@ const SideContentContestVoting: React.FC<SideContentContestVotingProps> = ({
166168 </ div >
167169 </ div >
168170 ) : (
169- < div className = "noResults" > There are no eligible entries for voting found. </ div >
171+ < div className = "noResults" > { t ( 'noEntries' ) } </ div >
170172 ) }
171173 </ div >
172174 ) ,
173175 [
174- isValid ,
175- canSave ,
176+ tierBoard ,
176177 sortedContestEntries ,
177- handleContestEntryClick ,
178- handleDragEnd ,
179- handleDragEnter ,
180- handleDragLeave ,
181178 handleDragOver ,
179+ handleDragLeave ,
180+ handleDragEnter ,
182181 handleDrop ,
183- tierBoard
182+ t ,
183+ isValid ,
184+ canSave ,
185+ handleDragEnd ,
186+ handleContestEntryClick
184187 ]
185188 ) ;
186189
@@ -209,15 +212,11 @@ const SideContentContestVoting: React.FC<SideContentContestVotingProps> = ({
209212 < Button
210213 className = "collapse-button"
211214 icon = { showContestEntries ? IconNames . CARET_DOWN : IconNames . CARET_RIGHT }
212- minimal = { true }
215+ variant = "minimal"
213216 onClick = { ( ) => setShowContestEntries ( ! showContestEntries ) }
214217 >
215- < span > Contest Voting</ span >
216- < Tooltip
217- content = {
218- < span > Rank your favourite contest entries from tiers D (worst) to S (best)!</ span >
219- }
220- >
218+ < span > { t ( 'title' ) } </ span >
219+ < Tooltip content = { < span > { t ( 'tooltip' ) } </ span > } >
221220 < Icon icon = { IconNames . HELP } />
222221 </ Tooltip >
223222 </ Button >
0 commit comments