11import { SpinnerGap } from '@phosphor-icons/react' ;
2+ import clsx from 'clsx' ;
23import React , { type FC , useEffect , useState } from 'react' ;
34import { defineMessages } from 'react-intl' ;
45
@@ -69,7 +70,8 @@ const FinalizeStep: FC<FinalizeStepProps> = ({
6970 const isMotionFailed = actionData . motionData . motionStateHistory . hasFailed ;
7071 const isMotionAgreement =
7172 actionData . type === ColonyActionType . CreateDecisionMotion ;
72- const isMotionClaimable =
73+ const isMotionClaimable = isMotionFinalized && ! isClaimed ;
74+ const isAgreementClaimable =
7375 ( ( isMotionFinalized || isMotionFailedNotFinalizable ) &&
7476 ! isMotionFailed &&
7577 ! isMotionFailedNotFinalizable ) ||
@@ -237,7 +239,9 @@ const FinalizeStep: FC<FinalizeStepProps> = ({
237239 < >
238240 { ( isPolling || isSubmitting ) && ! isClaimed && (
239241 < IconButton
240- className = "w-full"
242+ className = { clsx ( 'w-full' , {
243+ 'mt-6' : items . length > 0 ,
244+ } ) }
241245 rounded = "s"
242246 text = { { id : 'button.pending' } }
243247 icon = {
@@ -255,7 +259,6 @@ const FinalizeStep: FC<FinalizeStepProps> = ({
255259 ! isMotionFinalized &&
256260 ! isMotionAgreement && (
257261 < Button
258- className = "mt-6"
259262 mode = "primarySolid"
260263 disabled = { ! isFinalizable || wrongMotionState }
261264 isFullSize
@@ -269,7 +272,8 @@ const FinalizeStep: FC<FinalizeStepProps> = ({
269272 ! isPolling &&
270273 ! isSubmitting &&
271274 ! isMotionFailedNotFinalizable &&
272- isMotionClaimable &&
275+ ( isMotionClaimable ||
276+ ( isMotionAgreement && isAgreementClaimable ) ) &&
273277 ! isClaimed &&
274278 canClaimStakes && (
275279 < Button
0 commit comments