1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00

Create What's New storybook item (#20392)

* Create What's New storybook item

* Remove unnecessary button type attribute

* Remove unneccessary provider from story
This commit is contained in:
David Walsh 2023-08-14 08:27:12 -05:00 committed by GitHub
parent e02f5972be
commit ae76364c17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 6 deletions

View File

@ -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',

View File

@ -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 = ({
</div>
{placeImageBelowDescription && imageComponent}
{actionText && (
<Button
type="primary"
<ButtonPrimary
className="whats-new-popup__button"
onClick={() => {
actionFunction();
@ -212,14 +211,15 @@ const renderFirstNotification = ({
event: MetaMetricsEventName.WhatsNewClicked,
});
}}
block
>
{actionText}
</Button>
</ButtonPrimary>
)}
{
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
customButton && customButton.name === 'mmi-portfolio' && (
<Button
<ButtonPrimary
className="whats-new-popup__button"
data-testid="view-mmi-portfolio"
size={Size.SM}
@ -229,9 +229,10 @@ const renderFirstNotification = ({
onClose();
window.open(mmiPortfolioUrl, '_blank');
}}
block
>
{customButton.text}
</Button>
</ButtonPrimary>
)
///: END:ONLY_INCLUDE_IN
}

View File

@ -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) => <WhatsNewPopup {...args} />;
DefaultStory.storyName = 'Default';