mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 15:50:28 +01:00
66292330fe
* button to TS migration working demo style props broken mapping - need switch working types file working types fix dependent imports of Button variant mapping working types fix lint fix test fix ButtonSize issue on QuizContent box fix test if this works fix button being used on QuizContent fix button_variant import readme fix * fix button import * fix primary button as anchor hover * deprecated * button to TS migration fix lint fix test * fix rebase issue * fix rebase issue * lint fix
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { StoryFn, Meta } from '@storybook/react';
|
|
import { useArgs } from '@storybook/client-api';
|
|
import { ButtonVariant, Button } from '../../../components/component-library';
|
|
import SmartTransactionPopover from './smart-transactions-popover';
|
|
|
|
export default {
|
|
title: 'Pages/Swaps/SmartTransactionsPopover',
|
|
component: SmartTransactionPopover,
|
|
argTypes: {
|
|
isShowingModal: {
|
|
control: 'boolean',
|
|
},
|
|
},
|
|
} as Meta<typeof SmartTransactionPopover>;
|
|
|
|
export const DefaultStory: StoryFn<typeof SmartTransactionPopover> = () => {
|
|
const [{ isShowingModal }, updateArgs] = useArgs();
|
|
const toggleModal = () => updateArgs({ isShowingModal: !isShowingModal });
|
|
|
|
return (
|
|
<>
|
|
<Button variant={ButtonVariant.Primary} onClick={toggleModal}>
|
|
Open modal
|
|
</Button>
|
|
{isShowingModal && (
|
|
<SmartTransactionPopover
|
|
isOpen={isShowingModal}
|
|
onEnableSmartTransactionsClick={() => {
|
|
console.log('onEnableSmartTransactionsClick');
|
|
}}
|
|
onCloseSmartTransactionsOptInPopover={toggleModal}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
};
|
|
|
|
DefaultStory.storyName = 'Default';
|