mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 03:20:23 +01:00
c716592fd1
* Clean up some code fencing around snaps * Fix code fencing * Fix more fencing issues
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
import { mapToTemplate } from '../../../../../components/app/snaps/snap-ui-renderer';
|
|
import { DelineatorType } from '../../../../../helpers/constants/snaps';
|
|
|
|
function getValues(pendingApproval, t, actions) {
|
|
const {
|
|
snapName,
|
|
requestData: { content },
|
|
} = pendingApproval;
|
|
const elementKeyIndex = { value: 0 };
|
|
|
|
return {
|
|
content: [
|
|
{
|
|
element: 'Box',
|
|
key: 'snap-dialog-content-wrapper',
|
|
props: {
|
|
marginLeft: 4,
|
|
marginRight: 4,
|
|
},
|
|
children: {
|
|
element: 'SnapDelineator',
|
|
key: 'snap-delineator',
|
|
props: {
|
|
type: DelineatorType.Content,
|
|
snapName,
|
|
},
|
|
// TODO: Replace with SnapUIRenderer when we don't need to inject the input manually.
|
|
children: mapToTemplate(content, elementKeyIndex),
|
|
},
|
|
},
|
|
],
|
|
cancelText: t('reject'),
|
|
submitText: t('approveButtonText'),
|
|
onSubmit: () => actions.resolvePendingApproval(pendingApproval.id, true),
|
|
onCancel: () => actions.resolvePendingApproval(pendingApproval.id, false),
|
|
};
|
|
}
|
|
|
|
const snapConfirmation = {
|
|
getValues,
|
|
};
|
|
|
|
export default snapConfirmation;
|