From ae76364c174fe2edcd0608a56ec9d1764f1f1f45 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Mon, 14 Aug 2023 08:27:12 -0500 Subject: [PATCH] Create What's New storybook item (#20392) * Create What's New storybook item * Remove unnecessary button type attribute * Remove unneccessary provider from story --- .storybook/test-data.js | 9 +++++++++ .../app/whats-new-popup/whats-new-popup.js | 13 +++++++------ .../whats-new-popup/whats-new-popup.stories.js | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 ui/components/app/whats-new-popup/whats-new-popup.stories.js diff --git a/.storybook/test-data.js b/.storybook/test-data.js index a8bf65c9b..4b60d17c9 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -19,6 +19,15 @@ const state = { url: 'https://metamask.github.io/test-dapp/', }, metamask: { + announcements: { + 22: { + id: 22, + date: null, + image: { + src: 'images/global-menu-block-explorer.svg', + }, + } + }, tokenList: { '0x514910771af9ca656af840dff83e8264ecf986ca': { address: '0x514910771af9ca656af840dff83e8264ecf986ca', diff --git a/ui/components/app/whats-new-popup/whats-new-popup.js b/ui/components/app/whats-new-popup/whats-new-popup.js index 7b1b0cb4f..ad9786a9c 100644 --- a/ui/components/app/whats-new-popup/whats-new-popup.js +++ b/ui/components/app/whats-new-popup/whats-new-popup.js @@ -10,7 +10,7 @@ import { useEqualityCheck } from '../../../hooks/useEqualityCheck'; import Popover from '../../ui/popover'; import { Text, - Button, + ButtonPrimary, ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) IconName, ///: END:ONLY_INCLUDE_IN @@ -202,8 +202,7 @@ const renderFirstNotification = ({ {placeImageBelowDescription && imageComponent} {actionText && ( - + )} { ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) customButton && customButton.name === 'mmi-portfolio' && ( - + ) ///: END:ONLY_INCLUDE_IN } diff --git a/ui/components/app/whats-new-popup/whats-new-popup.stories.js b/ui/components/app/whats-new-popup/whats-new-popup.stories.js new file mode 100644 index 000000000..01760b891 --- /dev/null +++ b/ui/components/app/whats-new-popup/whats-new-popup.stories.js @@ -0,0 +1,16 @@ +import React from 'react'; +import WhatsNewPopup from '.'; + +export default { + title: 'Components/Multichain/WhatsNewPopup', + component: WhatsNewPopup, + argTypes: { + onClose: { + action: 'onClose', + }, + }, +}; + +export const DefaultStory = (args) => ; + +DefaultStory.storyName = 'Default';