@@ -86,6 +86,10 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
8686 ( ) => ( props . tab || '' ) . toLowerCase ( ) === 'submission' ,
8787 [ props . tab ] ,
8888 )
89+ const isAppealsTab = useMemo (
90+ ( ) => ( props . tab || '' ) . toLowerCase ( ) === 'appeals' ,
91+ [ props . tab ] ,
92+ )
8993 const challengeStatus = challengeInfo ?. status ?. toUpperCase ( )
9094 const isChallengeCompleted = challengeStatus === 'COMPLETED'
9195
@@ -216,11 +220,11 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
216220 [ challengeInfo ] ,
217221 )
218222
219- const shouldShowAppealsColumn = useMemo ( ( ) => {
220- const tabName = ( props . tab || '' ) . toLowerCase ( )
221- // Only show Appeals columns on the "Appeals" tab for submitters
222- return allowsAppeals && tabName === 'appeals'
223- } , [ allowsAppeals , props . tab ] )
223+ // Only show Appeals columns on the "Appeals" tab for submitters
224+ const shouldShowAppealsColumn = useMemo (
225+ ( ) => allowsAppeals && isAppealsTab ,
226+ [ allowsAppeals , isAppealsTab ] ,
227+ )
224228
225229 const aggregatedRows = useMemo (
226230 ( ) => aggregateSubmissionReviews ( {
@@ -434,7 +438,7 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
434438 }
435439
436440 // On Appeals tab, make the average score clickable to a review page
437- if ( ( props . tab || '' ) . toLowerCase ( ) === 'appeals' ) {
441+ if ( isAppealsTab ) {
438442 const reviewDetail = data . aggregated ?. reviews ?. [ 0 ]
439443 const reviewId = reviewDetail ?. reviewInfo ?. id || reviewDetail ?. reviewId
440444 if ( reviewId ) {
@@ -553,7 +557,6 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
553557 }
554558
555559 const totalAppeals = reviewDetail ?. totalAppeals ?? 0
556- const unresolvedAppeals = reviewDetail ?. unresolvedAppeals ?? 0
557560
558561 if ( ! totalAppeals && ( reviewInfo . status ?? '' ) . toUpperCase ( ) !== 'COMPLETED' ) {
559562 return (
@@ -571,15 +574,7 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
571574 ) }
572575 to = { `./../review/${ reviewId } ` }
573576 >
574- [
575- { ' ' }
576- < span className = { styles . textBlue } > { unresolvedAppeals } </ span >
577- { ' ' }
578- /
579- { ' ' }
580577 < span className = { styles . textBlue } > { totalAppeals } </ span >
581- { ' ' }
582- ]
583578 </ Link >
584579 )
585580 }
@@ -623,9 +618,7 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
623618 }
624619 }
625620
626- const shouldShowAppealAction = ( props . tab || '' ) . toLowerCase ( ) === 'appeals'
627- && isAppealsPhase ( challengeInfo )
628- const shouldRenderActionsColumn = shouldShowAppealAction || hasHistoryEntries
621+ const shouldRenderActionsColumn = ! isAppealsTab && hasHistoryEntries
629622
630623 if ( shouldRenderActionsColumn ) {
631624 aggregatedColumns . push ( {
@@ -635,25 +628,6 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
635628 renderer : ( data : SubmissionRow ) => {
636629 const actionEntries : Array < { key : string ; element : JSX . Element } > = [ ]
637630
638- if ( shouldShowAppealAction ) {
639- const reviewDetail = ( data . aggregated ?. reviews || [ ] ) . find ( r => r . reviewInfo ?. id )
640- const reviewId = reviewDetail ?. reviewInfo ?. id || reviewDetail ?. reviewId
641-
642- if ( reviewId ) {
643- actionEntries . push ( {
644- element : (
645- < Link
646- to = { `./../review/${ reviewId } ` }
647- className = { classNames ( styles . textBlue , 'last-element' ) }
648- >
649- Appeal
650- </ Link >
651- ) ,
652- key : 'appeal-action' ,
653- } )
654- }
655- }
656-
657631 const historyKeyForRow = getSubmissionHistoryKey ( data . memberId , data . id )
658632 const rowHistory = historyByMember . get ( historyKeyForRow ) ?? [ ]
659633 if ( isSubmissionTab && rowHistory . length > 0 ) {
@@ -714,7 +688,7 @@ export const TableReviewAppealsForSubmitter: FC<Props> = (props: Props) => {
714688 restrictionMessage ,
715689 challengeInfo ,
716690 isSubmissionTab ,
717- props . tab ,
691+ isAppealsTab ,
718692 ] )
719693
720694 const columnsMobile = useMemo < MobileTableColumn < SubmissionRow > [ ] [ ] > (
0 commit comments