Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Integrate JSX into snap notifications #27407

Merged
merged 109 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 102 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
2968d94
make adjustments to show notification call
hmalik88 Sep 12, 2024
39f7d1b
Bump Snaps packages
Mrtenz Sep 24, 2024
652a6c3
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Sep 25, 2024
bdd1935
Bump dependencies again
Mrtenz Sep 27, 2024
0e30d3a
update notification controller, update raw snap notification type
hmalik88 Sep 30, 2024
4597ba1
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Sep 30, 2024
5689fe5
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Sep 30, 2024
3d5a9c4
add snap notification modal
hmalik88 Sep 30, 2024
1dfa869
Merge branch 'develop' into mrtenz/bump-snaps-packages
hmalik88 Sep 30, 2024
306d898
feat(snaps): Connect `getCurrencyRate` hook to `multichainRateControl…
GuillaumeRx Oct 2, 2024
f375215
feat: Integrate MetaMask links into Snaps `Link` component (#27377)
hmalik88 Oct 4, 2024
a6b6016
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 4, 2024
8377776
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 4, 2024
aad36db
integrate snaps expanded view into notification system
hmalik88 Oct 8, 2024
bd96aef
update yarn lock
hmalik88 Oct 8, 2024
f1e5e52
update lavamoat policies
hmalik88 Oct 8, 2024
f26bbb4
lint fixes
hmalik88 Oct 8, 2024
e60733e
another lint fix
hmalik88 Oct 8, 2024
8e96b0e
more lint fixes
hmalik88 Oct 8, 2024
ea99b02
fix type issues
hmalik88 Oct 8, 2024
f7168be
fix export
hmalik88 Oct 8, 2024
be72bb6
possible fix
hmalik88 Oct 8, 2024
c74c866
use literal instead of enum
hmalik88 Oct 8, 2024
2f49777
update notification detail button test
hmalik88 Oct 8, 2024
48f2567
fix notification detail block explorer button test
hmalik88 Oct 8, 2024
391663e
update snap-utils
hmalik88 Oct 8, 2024
174295b
dedupe
hmalik88 Oct 8, 2024
e31f656
Merge branch 'develop' into mrtenz/bump-snaps-packages
hmalik88 Oct 8, 2024
e14230f
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 8, 2024
6d03046
update yarn.lock
hmalik88 Oct 8, 2024
d50fdc2
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 8, 2024
cbfc9e4
update yarn.lock
hmalik88 Oct 8, 2024
d16283f
dedupe
hmalik88 Oct 8, 2024
0fb7067
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 8, 2024
6fc9fc7
regenerate lock file
hmalik88 Oct 8, 2024
6a0038a
update policy
hmalik88 Oct 8, 2024
43fc317
update policy
hmalik88 Oct 8, 2024
27f06b2
possible fix
hmalik88 Oct 8, 2024
7de27e9
revert changes
hmalik88 Oct 8, 2024
090d973
update policy final time?
hmalik88 Oct 8, 2024
4e994b4
Bump dependencies again again
Mrtenz Oct 9, 2024
350fde4
Bump execution environment URL
Mrtenz Oct 9, 2024
426140d
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 9, 2024
dbe384e
changes per PR comments
hmalik88 Oct 9, 2024
a7b0b4c
regenerate yarn.lock
hmalik88 Oct 9, 2024
5b34018
make change per comment
hmalik88 Oct 10, 2024
ddef404
fix
hmalik88 Oct 10, 2024
29b116b
lint fix
hmalik88 Oct 10, 2024
ec9a418
possible import fix
hmalik88 Oct 10, 2024
4573c85
another possible fix
hmalik88 Oct 10, 2024
76ccce6
Fix circular dependency issues
FrederikBolding Oct 11, 2024
afe7809
Fix another circular dependency
FrederikBolding Oct 11, 2024
7c18e47
Merge branch 'develop' into mrtenz/bump-snaps-packages
Mrtenz Oct 11, 2024
fbe1ca7
feat(snaps): Add `size` prop to `Heading` (#27721)
GuillaumeRx Oct 11, 2024
7de9c14
lint fix
hmalik88 Oct 11, 2024
3b6141e
import fix
hmalik88 Oct 11, 2024
74aa414
another fix
hmalik88 Oct 11, 2024
bc47345
Merge branch 'mrtenz/bump-snaps-packages' into hm/integrate-jsx-notif…
hmalik88 Oct 11, 2024
0ff9ab2
add missing section
hmalik88 Oct 11, 2024
efed42e
lint fix
hmalik88 Oct 11, 2024
75174e2
lint fix
hmalik88 Oct 11, 2024
ea3cac7
fix undefined error
hmalik88 Oct 13, 2024
67c23d3
fix bug and make style changes
hmalik88 Oct 14, 2024
cc5a9e2
fix styling
hmalik88 Oct 15, 2024
c5a2982
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Oct 23, 2024
6ca3c8a
regenerate yarn lock
hmalik88 Oct 24, 2024
f9dcbf2
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Nov 13, 2024
ffc2c9e
Revert "Merge branch 'develop' into hm/integrate-jsx-notifications"
hmalik88 Nov 13, 2024
73f32b9
Revert "Revert "Merge branch 'develop' into hm/integrate-jsx-notifica…
hmalik88 Nov 13, 2024
05e8d0e
undo
hmalik88 Nov 27, 2024
a5dc289
fix
hmalik88 Nov 27, 2024
73e0ba5
Revert "undo"
hmalik88 Nov 27, 2024
14ce024
fix yarn lock
hmalik88 Nov 27, 2024
6290f92
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Nov 27, 2024
14d6ab0
lint fix
hmalik88 Nov 27, 2024
4091c0a
fix read action in notification list item
hmalik88 Nov 27, 2024
374f5fd
remove extra hook
hmalik88 Nov 27, 2024
1b9b48e
fix notification-details
hmalik88 Nov 27, 2024
e844105
lint fix
hmalik88 Nov 27, 2024
f05912d
revert change to actions
hmalik88 Nov 27, 2024
fbf0de6
update components
hmalik88 Nov 28, 2024
bad7f15
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Nov 28, 2024
fe6cb7e
lint fix
hmalik88 Nov 28, 2024
b55f393
lint fix
hmalik88 Nov 28, 2024
ecdf8ea
another lint fix
hmalik88 Nov 28, 2024
2194a13
fixes
hmalik88 Nov 29, 2024
566f4c3
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Nov 29, 2024
9de4276
fix storybook
hmalik88 Nov 29, 2024
a650335
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Nov 29, 2024
1365918
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Nov 29, 2024
b7f667b
update logic to delete notification on detail view dismount
hmalik88 Dec 1, 2024
a81ea0f
Merge branch 'develop' into hm/integrate-jsx-notifications
hmalik88 Dec 1, 2024
36d3052
lint fix
hmalik88 Dec 3, 2024
0c90660
Merge branch 'main' into hm/integrate-jsx-notifications
hmalik88 Dec 5, 2024
e6c83ec
ensure snap notification timeout hook runs on dismount
hmalik88 Dec 5, 2024
38ad522
Merge branch 'main' into hm/integrate-jsx-notifications
hmalik88 Dec 5, 2024
fbd3ea3
revert footer change
hmalik88 Dec 5, 2024
90b20d3
use isExternal to determine if link is external in notification detai…
hmalik88 Dec 5, 2024
ad4be8f
remove unnecessary else case
hmalik88 Dec 5, 2024
b015142
return snap_notify response
hmalik88 Dec 5, 2024
4ec8491
address PR comments
hmalik88 Dec 5, 2024
73c82ee
Merge branch 'main' into hm/integrate-jsx-notifications
hmalik88 Dec 5, 2024
8dc2243
remove export
hmalik88 Dec 5, 2024
84bf09c
prevent modal rendering if not snap notification
hmalik88 Dec 5, 2024
caa3a17
Merge branch 'main' into hm/integrate-jsx-notifications
hmalik88 Dec 5, 2024
921c0e8
make sure footer link displays warning modal
hmalik88 Dec 5, 2024
7f2c175
Merge branch 'main' into hm/integrate-jsx-notifications
hmalik88 Dec 5, 2024
e365317
make sure modal and external link is not shown for metamask links in …
hmalik88 Dec 5, 2024
461939e
Merge branch 'main' into hm/integrate-jsx-notifications
hmalik88 Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,12 +1481,19 @@ export default class MetamaskController extends EventEmitter {
},
showInAppNotification: {
method: (origin, args) => {
const { message } = args;
const { message, title, footerLink, interfaceId } = args;

const detailedView = {
title,
...(footerLink ? { footerLink } : {}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
...(footerLink ? { footerLink } : {}),
footerLink,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the object clean without undefined. The performance difference of creating the intermediate object is neglible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a performance worry, but it adds additional complexity that makes it harder to reason about the code.

I'm not necessarily against it, but why do we need undefined to not be present here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it's not type correct if footerLink or detailedView is present on the notification object, also I have to do more type-fu to access the detailedView property instead of using hasProperty as I'm currently doing in some of the components.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Frederik that it would be better to pass undefined and do a stricter property check when trying to use it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll consider this as a nit that we can fix after if we really want. This would just improve code readability :)

interfaceId,
};

const notification = {
data: {
message,
origin,
...(interfaceId ? { detailedView } : {}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
...(interfaceId ? { detailedView } : {}),
detailedView: interfaceId ? detailedView : undefined,

Do we need to be strict about removing the property here or can we do something like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

},
type: TRIGGER_TYPES.SNAP,
readDate: null,
Expand Down Expand Up @@ -2923,14 +2930,22 @@ export default class MetamaskController extends EventEmitter {
origin,
args.message,
),
showInAppNotification: (origin, args) =>
this.controllerMessenger.call(
showInAppNotification: (origin, args) => {
const { message, title, footerLink } = args;
const notificationArgs = {
interfaceId: args.content,
message,
title,
footerLink,
};
return this.controllerMessenger.call(
'RateLimitController:call',
origin,
'showInAppNotification',
origin,
args,
),
notificationArgs,
);
},
updateSnapState: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:updateSnapState',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
TextVariant,
} from '../../../helpers/constants/design-system';
import Tooltip from '../../ui/tooltip';
import { AvatarGroup } from '../../multichain';
import { AvatarGroup } from '../../multichain/avatar-group';
import { AvatarType } from '../../multichain/avatar-group/avatar-group.types';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { formatDate } from '../../../helpers/utils/util';
Expand Down
11 changes: 9 additions & 2 deletions ui/components/app/snaps/snap-ui-markdown/snap-ui-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../../../component-library';
import SnapLinkWarning from '../snap-link-warning';

const Paragraph = (props) => (
export const Paragraph = (props) => (
hmalik88 marked this conversation as resolved.
Show resolved Hide resolved
<Text
{...props}
variant={TextVariant.bodyMd}
Expand Down Expand Up @@ -69,7 +69,14 @@ export const SnapUIMarkdown = ({ children, markdown }) => {
components={{
p: Paragraph,
a: ({ children: value, href }) => (
<Link onClick={() => handleLinkClick(href)}>{value ?? href}</Link>
<Link
onClick={(e) => {
e.stopPropagation();
handleLinkClick(href);
}}
>
{value ?? href}
</Link>
),
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from '../../../store/actions';
import { TextVariant } from '../../../helpers/constants/design-system';
import { formatAccountType } from '../../../helpers/utils/metrics';
import { AccountDetailsMenuItem, ViewExplorerMenuItem } from '..';
import { AccountDetailsMenuItem, ViewExplorerMenuItem } from '../menu-items';

const METRICS_LOCATION = 'Account Options';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { useSelector } from 'react-redux';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { shortenAddress } from '../../../helpers/utils/util';

import { AccountListItemMenu, AvatarGroup } from '..';
import { AccountListItemMenu } from '../account-list-item-menu';
import { AvatarGroup } from '../avatar-group';
import { ConnectedAccountsMenu } from '../connected-accounts-menu';
import {
AvatarAccount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ import {
import { ModalContent } from '../../component-library/modal-content/deprecated';
import { ModalHeader } from '../../component-library/modal-header';
import { TextFieldSearch } from '../../component-library/text-field-search/deprecated';
import {
AccountListItem,
AccountListItemMenuTypes,
CreateEthAccount,
ImportAccount,
} from '..';
import { AccountListItem } from '../account-list-item';
import { AccountListItemMenuTypes } from '../account-list-item/account-list-item.types';

import {
AlignItems,
BlockSize,
Expand Down Expand Up @@ -130,6 +127,8 @@ import {
ACCOUNT_OVERVIEW_TAB_KEY_TO_TRACE_NAME_MAP,
AccountOverviewTabKey,
} from '../../../../shared/constants/app-state';
import { CreateEthAccount } from '../create-eth-account';
import { ImportAccount } from '../import-account';
///: BEGIN:ONLY_INCLUDE_IF(solana)
import {
SOLANA_WALLET_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ import {
IconSize,
Text,
} from '../../component-library';
import { AccountListItem } from '../account-list-item';
import { AccountListItemMenuTypes } from '..';
import {
AccountListItem,
AccountListItemMenuTypes,
} from '../account-list-item';
import { mergeAccounts } from './account-list-menu';

export const HiddenAccountList = ({ onClose }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
setAccountLabel,
getNextAvailableAccountName as getNextAvailableAccountNameFromController,
} from '../../../store/actions';
import { CreateAccount } from '..';
import { CreateAccount } from '../create-account';
GuillaumeRx marked this conversation as resolved.
Show resolved Hide resolved

export const CreateEthAccount = ({ onActionComplete }) => {
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ const mockNotification = {
type: 'ERC20_RECEIVED',
};

jest.mock('react-router-dom', () => {
const original = jest.requireActual('react-router-dom');
return {
...original,
useHistory: () => ({
push: jest.fn(),
}),
};
});

describe('NotificationDetailBlockExplorerButton', () => {
it('renders correctly with a valid block explorer URL', () => {
render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ const { TRIGGER_TYPES } = NotificationServicesController.Constants;

type Notification = NotificationServicesController.Types.INotification;

jest.mock('react-router-dom', () => {
const original = jest.requireActual('react-router-dom');
return {
...original,
useHistory: () => ({
push: jest.fn(),
}),
};
});

describe('NotificationDetailButton', () => {
const defaultProps = {
variant: ButtonVariant.Primary,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useContext } from 'react';
import { NotificationServicesController } from '@metamask/notification-services-controller';
import React, { useContext, useState } from 'react';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import {
MetaMetricsEventCategory,
Expand All @@ -12,8 +11,10 @@ import {
IconName,
} from '../../component-library';
import { BlockSize } from '../../../helpers/constants/design-system';

type Notification = NotificationServicesController.Types.INotification;
import { TRIGGER_TYPES } from '../../../pages/notifications/notification-components';
import useSnapNavigation from '../../../hooks/snaps/useSnapNavigation';
import { type Notification } from '../../../pages/notifications/notification-components/types/notifications/notifications';
import SnapLinkWarning from '../../app/snaps/snap-link-warning';

type NotificationDetailButtonProps = {
notification: Notification;
Expand All @@ -35,6 +36,21 @@ export const NotificationDetailButton = ({
endIconName = true,
}: NotificationDetailButtonProps) => {
const trackEvent = useContext(MetaMetricsContext);
const { navigate } = useSnapNavigation();
const isMetaMaskUrl = href.startsWith('metamask:');
const [isOpen, setIsOpen] = useState(false);

const handleModalClose = () => {
setIsOpen(false);
};

// this logic can be expanded once this detail button is used outside of the current use cases
const getClickedItem = () => {
if (notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT) {
return 'block_explorer';
}
return isExternal ? 'external_link' : 'internal_link';
};

const onClick = () => {
trackEvent({
Expand All @@ -46,23 +62,34 @@ export const NotificationDetailButton = ({
...('chain_id' in notification && {
chain_id: notification.chain_id,
}),
clicked_item: 'block_explorer',
clicked_item: getClickedItem(),
},
});

if (notification.type === TRIGGER_TYPES.SNAP) {
if (isMetaMaskUrl) {
navigate(href);
} else {
setIsOpen(true);
}
}
};

return (
<Button
key={id}
href={href}
variant={variant}
externalLink={isExternal}
size={ButtonSize.Lg}
width={BlockSize.Full}
endIconName={endIconName ? IconName.Arrow2UpRight : undefined}
onClick={onClick}
>
{text}
</Button>
<>
<SnapLinkWarning isOpen={isOpen} onClose={handleModalClose} url={href} />
<Button
key={id}
href={!isMetaMaskUrl && href ? href : undefined}
variant={variant}
externalLink={isExternal || !isMetaMaskUrl}
size={ButtonSize.Lg}
width={BlockSize.Full}
endIconName={endIconName ? IconName.Arrow2UpRight : undefined}
onClick={onClick}
>
{text}
</Button>
</>
);
};
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { createContext, useContext, useEffect, useMemo } from 'react';
import { useSelector } from 'react-redux';
import type { NotificationServicesController } from '@metamask/notification-services-controller';
import { useListNotifications } from '../../hooks/metamask-notifications/useNotifications';
import { useAccountSyncingEffect } from '../../hooks/identity/useProfileSyncing';
import { selectIsProfileSyncingEnabled } from '../../selectors/identity/profile-syncing';
import { selectIsMetamaskNotificationsEnabled } from '../../selectors/metamask-notifications/metamask-notifications';
import { getUseExternalServices } from '../../selectors';
import { getIsUnlocked } from '../../ducks/metamask/metamask';

type Notification = NotificationServicesController.Types.INotification;
import { type Notification } from '../../pages/notifications/notification-components/types/notifications/notifications';

type MetamaskNotificationsContextType = {
listNotifications: () => void;
Expand Down
7 changes: 2 additions & 5 deletions ui/hooks/metamask-notifications/useNotifications.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import { useState, useCallback } from 'react';
import { useDispatch } from 'react-redux';
import type { InternalAccount } from '@metamask/keyring-api';
import type { NotificationServicesController } from '@metamask/notification-services-controller';
import log from 'loglevel';

import { type MarkAsReadNotificationsParam } from '@metamask/notification-services-controller/notification-services';
import {
createOnChainTriggers,
fetchAndUpdateMetamaskNotifications,
markMetamaskNotificationsAsRead,
enableMetamaskNotifications,
disableMetamaskNotifications,
} from '../../store/actions';

type Notification = NotificationServicesController.Types.INotification;
type MarkAsReadNotificationsParam =
NotificationServicesController.Types.MarkAsReadNotificationsParam;
import { type Notification } from '../../pages/notifications/notification-components/types/notifications/notifications';

// Define KeyringType interface
type KeyringType = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { Text } from '../../../../components/component-library';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import { SnapAccountCard } from '../../../remove-snap-account';
import { SnapAccountCard } from '../../../remove-snap-account/snap-account-card';

const SnapAccountSuccessMessage = ({
message,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import type { NotificationServicesController } from '@metamask/notification-services-controller';
import { Box } from '../../../components/component-library';
import {
Display,
FlexDirection,
} from '../../../helpers/constants/design-system';
import type { NotificationComponent } from '../../notifications/notification-components/types/notifications/notifications';

type Notification = NotificationServicesController.Types.INotification;
import {
Notification,
NotificationComponentType,
type NotificationComponent,
} from '../../notifications/notification-components/types/notifications/notifications';

type NotificationDetailsBodyProps = {
body: NotificationComponent['details']['body'];
Expand All @@ -24,13 +25,13 @@ export const NotificationDetailsBody = ({
flexDirection={FlexDirection.Column}
padding={0}
>
{body.type === 'body_feature_announcement' && (
{body.type === NotificationComponentType.AnnouncementBody && (
<>
<body.Image notification={notification} />
<body.Description notification={notification} />
</>
)}
{body.type === 'body_onchain_notification' && (
{body.type === NotificationComponentType.OnChainBody && (
<>
{body.Image && <body.Image notification={notification} />}
{body.From && <body.From notification={notification} />}
Expand All @@ -47,6 +48,9 @@ export const NotificationDetailsBody = ({
{body.NetworkFee && <body.NetworkFee notification={notification} />}
</>
)}
{body.type === NotificationComponentType.SnapBody && (
<body.Content notification={notification} />
)}
</Box>
);
};
Loading
Loading