Skip to content

Commit

Permalink
make sure footer link displays warning modal
Browse files Browse the repository at this point in the history
  • Loading branch information
hmalik88 committed Dec 5, 2024
1 parent caa3a17 commit 921c0e8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export const NotificationDetailButton = ({
const isMetaMaskUrl = href.startsWith('metamask:');
const [isOpen, setIsOpen] = useState(false);

const isSnapNotification = notification.type === TRIGGER_TYPES.SNAP;

const handleModalClose = () => {
setIsOpen(false);
};
Expand All @@ -66,7 +68,7 @@ export const NotificationDetailButton = ({
},
});

if (notification.type === TRIGGER_TYPES.SNAP) {
if (isSnapNotification) {
if (isMetaMaskUrl) {
navigate(href);
} else {
Expand All @@ -77,7 +79,7 @@ export const NotificationDetailButton = ({

return (
<>
{notification.type === TRIGGER_TYPES.SNAP && (
{isSnapNotification && (
<SnapLinkWarning
isOpen={isOpen}
onClose={handleModalClose}
Expand All @@ -86,7 +88,7 @@ export const NotificationDetailButton = ({
)}
<Button
key={id}
href={!isMetaMaskUrl && href ? href : undefined}
href={!isSnapNotification && href ? href : undefined}
variant={variant}
externalLink={isExternal || !isMetaMaskUrl}
size={ButtonSize.Lg}
Expand Down

0 comments on commit 921c0e8

Please sign in to comment.