1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00
metamask-extension/ui/pages/confirmation/templates/flask/snap-alert/snap-alert.js
Guillaume Roux 85f260c22d
[FLASK] Use custom UI for dialogs (#16973)
* update dialog templates to use custom UI

* add TODO comments

* Fix showDialog hook and destructuring

* Regen LavaMoat policies

* Re-add legacy snap confirmation for now

* Fix circular dependency issue

* Revert change to token-util

* Fix lint

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2022-12-20 11:44:22 +01:00

39 lines
882 B
JavaScript

import { mapToTemplate } from '../../../../../components/app/flask/snap-ui-renderer';
function getValues(pendingApproval, t, actions) {
const {
snapName,
requestData: { content },
} = pendingApproval;
return {
content: [
{
element: 'Box',
key: 'snap-dialog-content-wrapper',
props: {
marginLeft: 4,
marginRight: 4,
},
children: {
element: 'SnapDelineator',
key: 'snap-delineator',
props: {
snapName,
},
// TODO: Replace with SnapUIRenderer when we don't need to inject the input manually.
children: mapToTemplate(content),
},
},
],
submitText: t('ok'),
onSubmit: () => actions.resolvePendingApproval(pendingApproval.id, null),
};
}
const snapAlert = {
getValues,
};
export default snapAlert;