Skip to content

Commit

Permalink
chore: Remove Snaps insight dead code (#30130)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Removes dead Snaps code following the removal of the old confirmation
screens.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/30130?quickstart=1)

## **Manual testing steps**

N/A
  • Loading branch information
FrederikBolding authored Feb 5, 2025
1 parent 8f78340 commit 7fc280d
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 422 deletions.
1 change: 0 additions & 1 deletion ui/components/app/app-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@
@import 'name/index';
@import 'name/name-details/index';
@import 'confirm/info/row/index';
@import 'snaps/snap-insight/index';
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const SnapHomeRenderer = ({ snapId }) => {
snapId={snapId}
interfaceId={interfaceId}
isLoading={loading}
useDelineator={false}
useFooter
/>
);
Expand Down
1 change: 0 additions & 1 deletion ui/components/app/snaps/snap-insight/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions ui/components/app/snaps/snap-insight/index.scss

This file was deleted.

114 changes: 0 additions & 114 deletions ui/components/app/snaps/snap-insight/snap-insight.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const SnapSettingsRenderer: FunctionComponent<
snapId={snapId}
interfaceId={interfaceId}
isLoading={loading}
useDelineator={false}
contentBackgroundColor={BackgroundColor.backgroundDefault}
/>
)}
Expand Down
43 changes: 2 additions & 41 deletions ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { Container } from '@metamask/snaps-sdk/jsx';

import { isEqual } from 'lodash';
import MetaMaskTemplateRenderer from '../../metamask-template-renderer/metamask-template-renderer';
import { SnapDelineator } from '../snap-delineator';
import { getSnapMetadata, getMemoizedInterface } from '../../../../selectors';
import { getMemoizedInterface } from '../../../../selectors';
import { Box } from '../../../component-library';
import { DelineatorType } from '../../../../helpers/constants/snaps';

import { SnapInterfaceContextProvider } from '../../../../contexts/snaps';
import PulseLoader from '../../../ui/pulse-loader';
Expand All @@ -25,29 +23,19 @@ import { mapToExtensionCompatibleColor, mapToTemplate } from './utils';
// Component that maps Snaps UI JSON format to MetaMask Template Renderer format
const SnapUIRendererComponent = ({
snapId,
delineatorType = DelineatorType.Content,
isCollapsable = false,
isCollapsed = false,
isLoading = false,
// This is a workaround while we have the prompt dialog type since we can't inject the SnapUIRenderer in the template renderer.
isPrompt = false,
inputValue,
onInputChange,
placeholder,
onClick,
boxProps,
interfaceId,
useDelineator = true,
useFooter = false,
onCancel,
contentBackgroundColor,
}) => {
const t = useI18nContext();

const { name: snapName } = useSelector((state) =>
getSnapMetadata(state, snapId),
);

const interfaceState = useSelector(
(state) => getMemoizedInterface(state, interfaceId),
// We only want to update the state if the content has changed.
Expand Down Expand Up @@ -110,28 +98,7 @@ const SnapUIRendererComponent = ({
// or if the footer component has been used.
const hasFooter = onCancel || content?.props?.children?.[1] !== undefined;

return useDelineator ? (
<SnapDelineator
snapName={snapName}
type={delineatorType}
isCollapsable={isCollapsable}
isCollapsed={isCollapsed}
onClick={onClick}
boxProps={boxProps}
disablePadding
>
<Box className="snap-ui-renderer__content">
<SnapInterfaceContextProvider
snapId={snapId}
interfaceId={interfaceId}
initialState={initialState}
context={context}
>
<MetaMaskTemplateRenderer sections={sections} />
</SnapInterfaceContextProvider>
</Box>
</SnapDelineator>
) : (
return (
<SnapInterfaceContextProvider
snapId={snapId}
interfaceId={interfaceId}
Expand Down Expand Up @@ -161,18 +128,12 @@ export const SnapUIRenderer = memo(

SnapUIRendererComponent.propTypes = {
snapId: PropTypes.string,
delineatorType: PropTypes.string,
isCollapsable: PropTypes.bool,
isCollapsed: PropTypes.bool,
isLoading: PropTypes.bool,
isPrompt: PropTypes.bool,
inputValue: PropTypes.string,
onInputChange: PropTypes.func,
placeholder: PropTypes.string,
onClick: PropTypes.func,
boxProps: PropTypes.object,
interfaceId: PropTypes.string,
useDelineator: PropTypes.bool,
useFooter: PropTypes.bool,
onCancel: PropTypes.func,
contentBackgroundColor: PropTypes.string,
Expand Down
127 changes: 0 additions & 127 deletions ui/components/ui/tabs/snaps/dropdown-tab/dropdown-tab.js

This file was deleted.

Loading

0 comments on commit 7fc280d

Please sign in to comment.