Skip to content

Commit

Permalink
fix: use proper loading translation for approval gas fee
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenfurniture committed Sep 19, 2024
1 parent cd8b23f commit ed932ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ export const SharedApprovalStep = ({
}, [tradeQuoteStep, transactionExecutionState, txHash, errorTranslation])

const renderDescription = useCallback(
(approvalNetworkFeeCryptoFormatted: string) => {
(approvalNetworkFeeCryptoFormatted: string | undefined) => {
return (
<SharedApprovalDescription
tradeQuoteStep={tradeQuoteStep}
isError={transactionExecutionState === TransactionExecutionState.Failed}
txHash={txHash}
approvalNetworkFeeCryptoFormatted={approvalNetworkFeeCryptoFormatted}
approvalNetworkFeeCryptoFormatted={approvalNetworkFeeCryptoFormatted ?? ''}
errorTranslation={errorTranslation}
gasFeeLoadingTranslation={gasFeeLoadingTranslation}
gasFeeTranslation={gasFeeTranslation}
isLoadingNetworkFee={!Boolean(approvalNetworkFeeCryptoFormatted)}
/>
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ type SharedApprovalDescriptionProps = {
approvalNetworkFeeCryptoFormatted: string
gasFeeLoadingTranslation: string
gasFeeTranslation: string
isAwaitingReset?: boolean
isLoadingNetworkFee?: boolean
isLoadingNetworkFee: boolean
} & ErrorMsgProps

export const SharedApprovalDescription = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type SharedApprovalStepPendingProps = {
transactionExecutionState: TransactionExecutionState
stepIndicator: JSX.Element
allowanceType: AllowanceType
renderDescription: (approvalNetworkFeeCryptoFormatted: string) => JSX.Element
renderDescription: (approvalNetworkFeeCryptoFormatted: string | undefined) => JSX.Element
renderContent: RenderAllowanceContentCallback
}

Expand Down Expand Up @@ -70,9 +70,7 @@ export const SharedApprovalStepPending = ({
feeAsset.symbol,
)
}

return translate('common.loadingText').toLowerCase()
}, [approvalNetworkFeeCryptoBaseUnit, feeAsset, toCrypto, translate])
}, [approvalNetworkFeeCryptoBaseUnit, feeAsset, toCrypto])

const content = useMemo(() => {
return renderContent({
Expand Down

0 comments on commit ed932ac

Please sign in to comment.