mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +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:
parent
e02f5972be
commit
ae76364c17
@ -19,6 +19,15 @@ const state = {
|
|||||||
url: 'https://metamask.github.io/test-dapp/',
|
url: 'https://metamask.github.io/test-dapp/',
|
||||||
},
|
},
|
||||||
metamask: {
|
metamask: {
|
||||||
|
announcements: {
|
||||||
|
22: {
|
||||||
|
id: 22,
|
||||||
|
date: null,
|
||||||
|
image: {
|
||||||
|
src: 'images/global-menu-block-explorer.svg',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
tokenList: {
|
tokenList: {
|
||||||
'0x514910771af9ca656af840dff83e8264ecf986ca': {
|
'0x514910771af9ca656af840dff83e8264ecf986ca': {
|
||||||
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
||||||
|
@ -10,7 +10,7 @@ import { useEqualityCheck } from '../../../hooks/useEqualityCheck';
|
|||||||
import Popover from '../../ui/popover';
|
import Popover from '../../ui/popover';
|
||||||
import {
|
import {
|
||||||
Text,
|
Text,
|
||||||
Button,
|
ButtonPrimary,
|
||||||
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
|
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
|
||||||
IconName,
|
IconName,
|
||||||
///: END:ONLY_INCLUDE_IN
|
///: END:ONLY_INCLUDE_IN
|
||||||
@ -202,8 +202,7 @@ const renderFirstNotification = ({
|
|||||||
</div>
|
</div>
|
||||||
{placeImageBelowDescription && imageComponent}
|
{placeImageBelowDescription && imageComponent}
|
||||||
{actionText && (
|
{actionText && (
|
||||||
<Button
|
<ButtonPrimary
|
||||||
type="primary"
|
|
||||||
className="whats-new-popup__button"
|
className="whats-new-popup__button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
actionFunction();
|
actionFunction();
|
||||||
@ -212,14 +211,15 @@ const renderFirstNotification = ({
|
|||||||
event: MetaMetricsEventName.WhatsNewClicked,
|
event: MetaMetricsEventName.WhatsNewClicked,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
block
|
||||||
>
|
>
|
||||||
{actionText}
|
{actionText}
|
||||||
</Button>
|
</ButtonPrimary>
|
||||||
)}
|
)}
|
||||||
{
|
{
|
||||||
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
|
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
|
||||||
customButton && customButton.name === 'mmi-portfolio' && (
|
customButton && customButton.name === 'mmi-portfolio' && (
|
||||||
<Button
|
<ButtonPrimary
|
||||||
className="whats-new-popup__button"
|
className="whats-new-popup__button"
|
||||||
data-testid="view-mmi-portfolio"
|
data-testid="view-mmi-portfolio"
|
||||||
size={Size.SM}
|
size={Size.SM}
|
||||||
@ -229,9 +229,10 @@ const renderFirstNotification = ({
|
|||||||
onClose();
|
onClose();
|
||||||
window.open(mmiPortfolioUrl, '_blank');
|
window.open(mmiPortfolioUrl, '_blank');
|
||||||
}}
|
}}
|
||||||
|
block
|
||||||
>
|
>
|
||||||
{customButton.text}
|
{customButton.text}
|
||||||
</Button>
|
</ButtonPrimary>
|
||||||
)
|
)
|
||||||
///: END:ONLY_INCLUDE_IN
|
///: END:ONLY_INCLUDE_IN
|
||||||
}
|
}
|
||||||
|
16
ui/components/app/whats-new-popup/whats-new-popup.stories.js
Normal file
16
ui/components/app/whats-new-popup/whats-new-popup.stories.js
Normal 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';
|
Loading…
Reference in New Issue
Block a user