1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/pages/confirmation/components/confirmation-footer/confirmation-footer.js
Frederik Bolding 789779f4d5
[FLASK] Rework Snaps headers and footers (#19442)
* Add new snap header and footer to snap install

* Add new snap header and footer to snap result and snap update

* Fix loading state

* Fix lint

* Add required scrolling

* Adjust avatar component

* Apply new headers and footers to snaps confirmations

* Rename previous SnapAuthorship component to SnapAuthorshipExpanded

* Fix lint

* Fix font weight

* Fix fencing

* Fix a test

* Fix lint after rebase

* Fix E2E

* Fix locale lint

* Fix another E2E

* Fix test ID

* Address PR comments

* Better scroll button centering

* Address design comments

* Fix unit test

* Fix E2Es
2023-06-07 15:18:49 +02:00

55 lines
1.3 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Button from '../../../../components/ui/button';
export default function ConfirmationFooter({
onSubmit,
onCancel,
submitText,
cancelText,
loadingText,
alerts,
loading,
submitAlerts,
actionsStyle,
style,
}) {
return (
<div className="confirmation-footer" style={style}>
{alerts}
{submitAlerts}
<div className="confirmation-footer__actions" style={actionsStyle}>
{onCancel ? (
<Button type="secondary" onClick={onCancel}>
{cancelText}
</Button>
) : null}
<Button
disabled={Boolean(loading)}
type="primary"
onClick={onSubmit}
className={classnames({
centered: !onCancel,
})}
>
{loading ? loadingText : submitText}
</Button>
</div>
</div>
);
}
ConfirmationFooter.propTypes = {
alerts: PropTypes.node,
onCancel: PropTypes.func,
cancelText: PropTypes.string,
onSubmit: PropTypes.func.isRequired,
submitText: PropTypes.string.isRequired,
loadingText: PropTypes.string,
loading: PropTypes.bool,
submitAlerts: PropTypes.node,
style: PropTypes.object,
actionsStyle: PropTypes.object,
};