mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-10-24 04:13:27 +02:00
d9924ca771
* Update fee card designs to show savings and MM fee
css touch up
More semantic html and remove unnecessary container wrapper
Update message for case when there are no savings, in new swaps fee card designs
Improve display of tilde in savings designs
* Ensure terms of service is shown when insufficient eth warning is shown on view-quote screen
* Logic simplification in fee-card.js
* Better center info tooltip icons in fee-card
* Add comment about use of \!important in fee card css
* Use container class property on info tooltip in fee card
* Remove function call that was made redundant with 980b14089
but not removed during rebase
71 lines
1.9 KiB
JavaScript
71 lines
1.9 KiB
JavaScript
import React, { useContext } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import classnames from 'classnames'
|
|
import { I18nContext } from '../../../contexts/i18n'
|
|
|
|
import PageContainerFooter from '../../../components/ui/page-container/page-container-footer'
|
|
|
|
export default function SwapsFooter({
|
|
onCancel,
|
|
hideCancel,
|
|
onSubmit,
|
|
submitText,
|
|
disabled,
|
|
showTermsOfService,
|
|
showTopBorder,
|
|
className,
|
|
}) {
|
|
const t = useContext(I18nContext)
|
|
|
|
return (
|
|
<div className="swaps-footer">
|
|
<div
|
|
className={classnames('swaps-footer__buttons', {
|
|
'swaps-footer__buttons--border': showTopBorder,
|
|
})}
|
|
>
|
|
<PageContainerFooter
|
|
onCancel={onCancel}
|
|
hideCancel={hideCancel}
|
|
cancelText={t('back')}
|
|
onSubmit={onSubmit}
|
|
submitText={submitText}
|
|
submitButtonType="confirm"
|
|
footerClassName={classnames(
|
|
'swaps-footer__custom-page-container-footer-class',
|
|
className,
|
|
)}
|
|
footerButtonClassName={classnames(
|
|
'swaps-footer__custom-page-container-footer-button-class',
|
|
{
|
|
'swaps-footer__custom-page-container-footer-button-class--single': hideCancel,
|
|
},
|
|
)}
|
|
disabled={disabled}
|
|
/>
|
|
</div>
|
|
{showTermsOfService && (
|
|
<div
|
|
className="swaps-footer__bottom-text"
|
|
onClick={() =>
|
|
global.platform.openTab({ url: 'https://metamask.io/terms.html' })
|
|
}
|
|
>
|
|
{t('termsOfService')}
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
SwapsFooter.propTypes = {
|
|
onCancel: PropTypes.func,
|
|
hideCancel: PropTypes.bool,
|
|
onSubmit: PropTypes.func.isRequired,
|
|
submitText: PropTypes.string,
|
|
disabled: PropTypes.bool,
|
|
showTermsOfService: PropTypes.bool,
|
|
showTopBorder: PropTypes.bool,
|
|
className: PropTypes.string,
|
|
}
|