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/',
|
||||
},
|
||||
metamask: {
|
||||
announcements: {
|
||||
22: {
|
||||
id: 22,
|
||||
date: null,
|
||||
image: {
|
||||
src: 'images/global-menu-block-explorer.svg',
|
||||
},
|
||||
}
|
||||
},
|
||||
tokenList: {
|
||||
'0x514910771af9ca656af840dff83e8264ecf986ca': {
|
||||
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
||||
|
@ -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
|
||||
}
|
||||
|
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