diff --git a/packages/atlas/src/components/ChangeNowModal/ChangeNowModal.tsx b/packages/atlas/src/components/ChangeNowModal/ChangeNowModal.tsx index 24d4e9171b..225aafdca5 100644 --- a/packages/atlas/src/components/ChangeNowModal/ChangeNowModal.tsx +++ b/packages/atlas/src/components/ChangeNowModal/ChangeNowModal.tsx @@ -72,6 +72,7 @@ export const ChangeNowModal = ({ type, onClose }: ChangeNowModalProps) => { if (primaryButtonProps) { return { text: 'Go to dashboard', + onClick: () => onClose(), to: absoluteRoutes.viewer.portfolio(), } } diff --git a/packages/atlas/src/components/ChangeNowModal/steps/ProgressStep.tsx b/packages/atlas/src/components/ChangeNowModal/steps/ProgressStep.tsx index a351bd3642..2c12f0da6e 100644 --- a/packages/atlas/src/components/ChangeNowModal/steps/ProgressStep.tsx +++ b/packages/atlas/src/components/ChangeNowModal/steps/ProgressStep.tsx @@ -50,7 +50,13 @@ type ProgressStepProps = { transactionData: TransactionData } & CommonProps -export const ProgressStep = ({ transactionData, type, setPrimaryButtonProps, goToStep }: ProgressStepProps) => { +export const ProgressStep = ({ + transactionData, + type, + setPrimaryButtonProps, + goToStep, + onClose, +}: ProgressStepProps) => { const [retry, setRetry] = useState(true) const isSellingJoy = type === 'sell' const steps = isSellingJoy ? sellSteps : buySteps @@ -118,13 +124,13 @@ export const ProgressStep = ({ transactionData, type, setPrimaryButtonProps, goT setRetry(false) setPrimaryButtonProps({ text: 'Close', - onClick: () => undefined, + onClick: () => onClose(), }) step = steps.length extraContent = successText } return [step, steps[step]?.[1], extraContent] - }, [data, isSellingJoy, setPrimaryButtonProps, steps, transactionData.hasAutomaticTransactionSucceeded]) + }, [data, isSellingJoy, onClose, setPrimaryButtonProps, steps, transactionData.hasAutomaticTransactionSucceeded]) return (