|
|
@ -9,7 +9,7 @@ import ErrorMessage from '../../../ui/error-message'; |
|
|
|
import { INSUFFICIENT_FUNDS_ERROR_KEY } from '../../../../helpers/constants/error-keys'; |
|
|
|
import { INSUFFICIENT_FUNDS_ERROR_KEY } from '../../../../helpers/constants/error-keys'; |
|
|
|
import Typography from '../../../ui/typography'; |
|
|
|
import Typography from '../../../ui/typography'; |
|
|
|
import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; |
|
|
|
import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; |
|
|
|
import { TRANSACTION_TYPES } from '../../../../../shared/constants/transaction'; |
|
|
|
import DepositPopover from '../../deposit-popover/deposit-popover'; |
|
|
|
|
|
|
|
|
|
|
|
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'; |
|
|
|
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'; |
|
|
|
|
|
|
|
|
|
|
@ -50,15 +50,17 @@ export default class ConfirmPageContainerContent extends Component { |
|
|
|
hideTitle: PropTypes.bool, |
|
|
|
hideTitle: PropTypes.bool, |
|
|
|
supportsEIP1559V2: PropTypes.bool, |
|
|
|
supportsEIP1559V2: PropTypes.bool, |
|
|
|
hasTopBorder: PropTypes.bool, |
|
|
|
hasTopBorder: PropTypes.bool, |
|
|
|
currentTransaction: PropTypes.object, |
|
|
|
|
|
|
|
nativeCurrency: PropTypes.string, |
|
|
|
nativeCurrency: PropTypes.string, |
|
|
|
networkName: PropTypes.string, |
|
|
|
networkName: PropTypes.string, |
|
|
|
showBuyModal: PropTypes.func, |
|
|
|
|
|
|
|
toAddress: PropTypes.string, |
|
|
|
toAddress: PropTypes.string, |
|
|
|
transactionType: PropTypes.string, |
|
|
|
transactionType: PropTypes.string, |
|
|
|
isBuyableChain: PropTypes.bool, |
|
|
|
isBuyableChain: PropTypes.bool, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state = { |
|
|
|
|
|
|
|
setShowDepositPopover: false, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
renderContent() { |
|
|
|
renderContent() { |
|
|
|
const { detailsComponent, dataComponent } = this.props; |
|
|
|
const { detailsComponent, dataComponent } = this.props; |
|
|
|
|
|
|
|
|
|
|
@ -153,10 +155,8 @@ export default class ConfirmPageContainerContent extends Component { |
|
|
|
hideTitle, |
|
|
|
hideTitle, |
|
|
|
supportsEIP1559V2, |
|
|
|
supportsEIP1559V2, |
|
|
|
hasTopBorder, |
|
|
|
hasTopBorder, |
|
|
|
currentTransaction, |
|
|
|
|
|
|
|
nativeCurrency, |
|
|
|
nativeCurrency, |
|
|
|
networkName, |
|
|
|
networkName, |
|
|
|
showBuyModal, |
|
|
|
|
|
|
|
toAddress, |
|
|
|
toAddress, |
|
|
|
transactionType, |
|
|
|
transactionType, |
|
|
|
isBuyableChain, |
|
|
|
isBuyableChain, |
|
|
@ -169,6 +169,8 @@ export default class ConfirmPageContainerContent extends Component { |
|
|
|
(errorKey || errorMessage) && |
|
|
|
(errorKey || errorMessage) && |
|
|
|
errorKey === INSUFFICIENT_FUNDS_ERROR_KEY; |
|
|
|
errorKey === INSUFFICIENT_FUNDS_ERROR_KEY; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { setShowDepositPopover } = this.state; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
className={classnames('confirm-page-container-content', { |
|
|
|
className={classnames('confirm-page-container-content', { |
|
|
@ -198,13 +200,11 @@ export default class ConfirmPageContainerContent extends Component { |
|
|
|
transactionType={transactionType} |
|
|
|
transactionType={transactionType} |
|
|
|
/> |
|
|
|
/> |
|
|
|
{this.renderContent()} |
|
|
|
{this.renderContent()} |
|
|
|
{!supportsEIP1559V2 && |
|
|
|
{!supportsEIP1559V2 && (errorKey || errorMessage) && ( |
|
|
|
(errorKey || errorMessage) && |
|
|
|
<div className="confirm-page-container-content__error-container"> |
|
|
|
currentTransaction.type !== TRANSACTION_TYPES.SIMPLE_SEND && ( |
|
|
|
<ErrorMessage errorMessage={errorMessage} errorKey={errorKey} /> |
|
|
|
<div className="confirm-page-container-content__error-container"> |
|
|
|
</div> |
|
|
|
<ErrorMessage errorMessage={errorMessage} errorKey={errorKey} /> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
{showInsuffienctFundsError && ( |
|
|
|
{showInsuffienctFundsError && ( |
|
|
|
<div className="confirm-page-container-content__error-container"> |
|
|
|
<div className="confirm-page-container-content__error-container"> |
|
|
|
<ActionableMessage |
|
|
|
<ActionableMessage |
|
|
@ -219,7 +219,9 @@ export default class ConfirmPageContainerContent extends Component { |
|
|
|
<Button |
|
|
|
<Button |
|
|
|
type="inline" |
|
|
|
type="inline" |
|
|
|
className="confirm-page-container-content__link" |
|
|
|
className="confirm-page-container-content__link" |
|
|
|
onClick={showBuyModal} |
|
|
|
onClick={() => |
|
|
|
|
|
|
|
this.setState({ setShowDepositPopover: true }) |
|
|
|
|
|
|
|
} |
|
|
|
key={`${nativeCurrency}-buy-button`} |
|
|
|
key={`${nativeCurrency}-buy-button`} |
|
|
|
> |
|
|
|
> |
|
|
|
{t('buyAsset', [nativeCurrency])} |
|
|
|
{t('buyAsset', [nativeCurrency])} |
|
|
@ -241,7 +243,11 @@ export default class ConfirmPageContainerContent extends Component { |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
{setShowDepositPopover && ( |
|
|
|
|
|
|
|
<DepositPopover |
|
|
|
|
|
|
|
onClose={() => this.setState({ setShowDepositPopover: false })} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
<PageContainerFooter |
|
|
|
<PageContainerFooter |
|
|
|
onCancel={onCancel} |
|
|
|
onCancel={onCancel} |
|
|
|
cancelText={cancelText} |
|
|
|
cancelText={cancelText} |
|
|
|