mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
added extension changes from snaps branch (#13433)
This commit is contained in:
parent
3eb99babf2
commit
2825b74a55
@ -7,7 +7,7 @@
|
|||||||
&__text {
|
&__text {
|
||||||
@include H7;
|
@include H7;
|
||||||
|
|
||||||
color: #6a737d;
|
color: var(--ui-4);
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
|
@ -10,17 +10,15 @@ import { useHistory } from 'react-router-dom';
|
|||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
import { produce } from 'immer';
|
import { produce } from 'immer';
|
||||||
import Box from '../../components/ui/box';
|
import Box from '../../components/ui/box';
|
||||||
import Chip from '../../components/ui/chip';
|
|
||||||
import MetaMaskTemplateRenderer from '../../components/app/metamask-template-renderer';
|
import MetaMaskTemplateRenderer from '../../components/app/metamask-template-renderer';
|
||||||
import SiteIcon from '../../components/ui/site-icon';
|
|
||||||
import { DEFAULT_ROUTE } from '../../helpers/constants/routes';
|
import { DEFAULT_ROUTE } from '../../helpers/constants/routes';
|
||||||
import { stripHttpsScheme } from '../../helpers/utils/util';
|
|
||||||
import { useI18nContext } from '../../hooks/useI18nContext';
|
import { useI18nContext } from '../../hooks/useI18nContext';
|
||||||
import { useOriginMetadata } from '../../hooks/useOriginMetadata';
|
import { useOriginMetadata } from '../../hooks/useOriginMetadata';
|
||||||
import { getUnapprovedTemplatedConfirmations } from '../../selectors';
|
import { getUnapprovedTemplatedConfirmations } from '../../selectors';
|
||||||
import NetworkDisplay from '../../components/app/network-display/network-display';
|
import NetworkDisplay from '../../components/app/network-display/network-display';
|
||||||
import { COLORS, SIZES } from '../../helpers/constants/design-system';
|
import { COLORS, SIZES } from '../../helpers/constants/design-system';
|
||||||
import Callout from '../../components/ui/callout';
|
import Callout from '../../components/ui/callout';
|
||||||
|
import SiteOrigin from '../../components/ui/site-origin';
|
||||||
import ConfirmationFooter from './components/confirmation-footer';
|
import ConfirmationFooter from './components/confirmation-footer';
|
||||||
import { getTemplateValues, getTemplateAlerts } from './templates';
|
import { getTemplateValues, getTemplateAlerts } from './templates';
|
||||||
|
|
||||||
@ -124,7 +122,7 @@ export default function ConfirmationPage() {
|
|||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
const pendingConfirmation = pendingConfirmations[currentPendingConfirmation];
|
const pendingConfirmation = pendingConfirmations[currentPendingConfirmation];
|
||||||
const originMetadata = useOriginMetadata(pendingConfirmation?.origin);
|
const originMetadata = useOriginMetadata(pendingConfirmation?.origin) || {};
|
||||||
const [alertState, dismissAlert] = useAlertState(pendingConfirmation);
|
const [alertState, dismissAlert] = useAlertState(pendingConfirmation);
|
||||||
|
|
||||||
// Generating templatedValues is potentially expensive, and if done on every render
|
// Generating templatedValues is potentially expensive, and if done on every render
|
||||||
@ -185,23 +183,20 @@ export default function ConfirmationPage() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="confirmation-page__content">
|
<div className="confirmation-page__content">
|
||||||
<Box justifyContent="center">
|
{templatedValues.networkDisplay ? (
|
||||||
<NetworkDisplay
|
<Box justifyContent="center">
|
||||||
colored={false}
|
<NetworkDisplay
|
||||||
indicatorSize={SIZES.XS}
|
colored={false}
|
||||||
labelProps={{ color: COLORS.BLACK }}
|
indicatorSize={SIZES.XS}
|
||||||
/>
|
labelProps={{ color: COLORS.BLACK }}
|
||||||
</Box>
|
/>
|
||||||
<Box justifyContent="center" padding={[1, 4, 4]}>
|
</Box>
|
||||||
<Chip
|
) : null}
|
||||||
label={stripHttpsScheme(originMetadata.origin)}
|
<Box justifyContent="center" padding={[4, 4, 4]}>
|
||||||
leftIcon={
|
<SiteOrigin
|
||||||
<SiteIcon
|
siteOrigin={originMetadata.origin}
|
||||||
icon={originMetadata.iconUrl}
|
iconSrc={originMetadata.iconUrl}
|
||||||
name={originMetadata.hostname}
|
iconName={originMetadata.hostname}
|
||||||
size={32}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<MetaMaskTemplateRenderer sections={templatedValues.content} />
|
<MetaMaskTemplateRenderer sections={templatedValues.content} />
|
||||||
|
@ -22,6 +22,7 @@ const ALLOWED_TEMPLATE_KEYS = [
|
|||||||
'cancelText',
|
'cancelText',
|
||||||
'onApprove',
|
'onApprove',
|
||||||
'onCancel',
|
'onCancel',
|
||||||
|
'networkDisplay',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user