33 TransactionContainerType ,
44 TransactionMeta ,
55} from '@metamask/transaction-controller' ;
6- import { useDispatch , useSelector } from 'react-redux' ;
6+ import { useSelector } from 'react-redux' ;
77import {
88 AlignItems ,
99 BackgroundColor ,
@@ -37,14 +37,8 @@ import { ConfirmMetamaskState } from '../../../types/confirm';
3737
3838export function SimulationSettingsModal ( { onClose } : { onClose ?: ( ) => void } ) {
3939 const t = useI18nContext ( ) ;
40- const dispatch = useDispatch ( ) ;
4140 const { currentConfirmation } = useConfirmContext < TransactionMeta > ( ) ;
42-
43- const {
44- containerTypes,
45- id : transactionId ,
46- txParamsOriginal,
47- } = currentConfirmation || { } ;
41+ const { containerTypes, id : transactionId } = currentConfirmation || { } ;
4842
4943 const isEnforcedSimulationsEnabled = useSelector (
5044 ( state : ConfirmMetamaskState ) =>
@@ -84,11 +78,11 @@ export function SimulationSettingsModal({ onClose }: { onClose?: () => void }) {
8478
8579 onClose ?.( ) ;
8680 } , [
87- dispatch ,
81+ containerTypes ,
8882 enabled ,
8983 isEnforcedSimulationApplied ,
84+ onClose ,
9085 transactionId ,
91- txParamsOriginal ,
9286 ] ) ;
9387
9488 return (
@@ -105,7 +99,9 @@ export function SimulationSettingsModal({ onClose }: { onClose?: () => void }) {
10599 >
106100 < ModalOverlay data-testid = "modal-overlay" />
107101 < ModalContent size = { ModalContentSize . Md } >
108- < ModalHeader onClose = { onClose } > Transaction settings</ ModalHeader >
102+ < ModalHeader onClose = { onClose } >
103+ { t ( 'simulationSettingsModalTitle' ) }
104+ </ ModalHeader >
109105 < ModalBody
110106 display = { Display . Flex }
111107 flexDirection = { FlexDirection . Column }
@@ -120,7 +116,7 @@ export function SimulationSettingsModal({ onClose }: { onClose?: () => void }) {
120116 style = { { marginRight : '-12px' } }
121117 >
122118 < Text variant = { TextVariant . bodyMdMedium } >
123- Enforce balance changes
119+ { t ( 'simulationSettingsModalEnforceToggle' ) }
124120 </ Text >
125121 < ToggleButton
126122 dataTestId = "simulation-settings-modal-enable-enforced"
@@ -132,8 +128,7 @@ export function SimulationSettingsModal({ onClose }: { onClose?: () => void }) {
132128 variant = { TextVariant . bodyMd }
133129 color = { TextColor . textAlternativeSoft }
134130 >
135- To protect your funds, this transaction will fail if the displayed
136- balance changes and slippage tolerance are not fulfilled.
131+ { t ( 'simulationSettingsModalEnforceToggleDescription' ) }
137132 </ Text >
138133 </ Section >
139134 < ButtonPrimary
0 commit comments