+ <>
{
///: BEGIN:ONLY_INCLUDE_IN(snaps)
<>
@@ -210,7 +211,9 @@ export default class PermissionPageContainer extends Component {
allIdentitiesSelected={allIdentitiesSelected}
/>
-
+ {targetSubjectMetadata?.subjectType !== SubjectType.Snap && (
+
+ )}
this.onCancel()}
@@ -220,7 +223,7 @@ export default class PermissionPageContainer extends Component {
buttonSizeLarge={false}
/>
-
+ >
);
}
}
diff --git a/ui/components/app/permissions-connect-header/permissions-connect-header.component.js b/ui/components/app/permissions-connect-header/permissions-connect-header.component.js
index 5f3fc5366..725db0fc4 100644
--- a/ui/components/app/permissions-connect-header/permissions-connect-header.component.js
+++ b/ui/components/app/permissions-connect-header/permissions-connect-header.component.js
@@ -1,6 +1,9 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import classnames from 'classnames';
+///: BEGIN:ONLY_INCLUDE_IN(snaps)
+import { SubjectType } from '@metamask/subject-metadata-controller';
+///: END:ONLY_INCLUDE_IN
import SiteOrigin from '../../ui/site-origin';
import Box from '../../ui/box';
import {
@@ -19,6 +22,7 @@ export default class PermissionsConnectHeader extends Component {
headerText: PropTypes.string,
leftIcon: PropTypes.node,
rightIcon: PropTypes.node,
+ subjectType: PropTypes.string,
};
static defaultProps = {
@@ -29,7 +33,23 @@ export default class PermissionsConnectHeader extends Component {
};
renderHeaderIcon() {
- const { iconUrl, iconName, siteOrigin, leftIcon, rightIcon } = this.props;
+ const {
+ iconUrl,
+ iconName,
+ siteOrigin,
+ leftIcon,
+ rightIcon,
+ ///: BEGIN:ONLY_INCLUDE_IN(snaps)
+ subjectType,
+ ///: END:ONLY_INCLUDE_IN
+ } = this.props;
+
+ ///: BEGIN:ONLY_INCLUDE_IN(snaps)
+
+ if (subjectType === SubjectType.Snap) {
+ return null;
+ }
+ ///: END:ONLY_INCLUDE_IN
return (
diff --git a/ui/components/app/snaps/snap-authorship-header/snap-authorship-header.js b/ui/components/app/snaps/snap-authorship-header/snap-authorship-header.js
index 74bf2adab..4f99c2162 100644
--- a/ui/components/app/snaps/snap-authorship-header/snap-authorship-header.js
+++ b/ui/components/app/snaps/snap-authorship-header/snap-authorship-header.js
@@ -24,7 +24,11 @@ import { getTargetSubjectMetadata } from '../../../../selectors';
import SnapAvatar from '../snap-avatar';
import SnapVersion from '../snap-version/snap-version';
-const SnapAuthorshipHeader = ({ snapId, className }) => {
+const SnapAuthorshipHeader = ({
+ snapId,
+ className,
+ boxShadow = 'var(--shadow-size-lg) var(--color-shadow-default)',
+}) => {
// We're using optional chaining with snapId, because with the current implementation
// of snap update in the snap controller, we do not have reference to snapId when an
// update request is rejected because the reference comes from the request itself and not subject metadata
@@ -51,7 +55,7 @@ const SnapAuthorshipHeader = ({ snapId, className }) => {
display={DISPLAY.FLEX}
padding={4}
style={{
- boxShadow: 'var(--shadow-size-lg) var(--color-shadow-default)',
+ boxShadow,
}}
>
@@ -91,6 +95,7 @@ SnapAuthorshipHeader.propTypes = {
* The className of the SnapAuthorship
*/
className: PropTypes.string,
+ boxShadow: PropTypes.string,
};
export default SnapAuthorshipHeader;
diff --git a/ui/components/app/snaps/snap-permissions-list/snap-permissions-list.js b/ui/components/app/snaps/snap-permissions-list/snap-permissions-list.js
index 6dda11d04..27ab6e3d2 100644
--- a/ui/components/app/snaps/snap-permissions-list/snap-permissions-list.js
+++ b/ui/components/app/snaps/snap-permissions-list/snap-permissions-list.js
@@ -6,8 +6,10 @@ import PermissionCell from '../../permission-cell';
import Box from '../../../ui/box';
export default function SnapPermissionsList({
+ snapId,
permissions,
targetSubjectMetadata,
+ showOptions,
}) {
const t = useI18nContext();
@@ -17,12 +19,15 @@ export default function SnapPermissionsList({
(permission, index) => {
return (
);
},
@@ -32,6 +37,8 @@ export default function SnapPermissionsList({
}
SnapPermissionsList.propTypes = {
+ snapId: PropTypes.string.isRequired,
permissions: PropTypes.object.isRequired,
targetSubjectMetadata: PropTypes.object.isRequired,
+ showOptions: PropTypes.bool,
};
diff --git a/ui/components/app/snaps/snap-version/snap-version.js b/ui/components/app/snaps/snap-version/snap-version.js
index a04e9449f..f70653540 100644
--- a/ui/components/app/snaps/snap-version/snap-version.js
+++ b/ui/components/app/snaps/snap-version/snap-version.js
@@ -18,10 +18,8 @@ import {
Text,
} from '../../../component-library';
import Preloader from '../../../ui/icon/preloader/preloader-icon.component';
-import { useI18nContext } from '../../../../hooks/useI18nContext';
const SnapVersion = ({ version, url }) => {
- const t = useI18nContext();
return (