2023-08-01 15:31:53 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { StoryFn, Meta } from '@storybook/react';
|
|
|
|
import { useArgs } from '@storybook/client-api';
|
2023-08-28 23:42:00 +02:00
|
|
|
import { ButtonVariant, Button } from '../../../components/component-library';
|
2023-08-01 15:31:53 +02:00
|
|
|
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 (
|
|
|
|
<>
|
2023-08-28 23:42:00 +02:00
|
|
|
<Button variant={ButtonVariant.Primary} onClick={toggleModal}>
|
2023-08-01 15:31:53 +02:00
|
|
|
Open modal
|
|
|
|
</Button>
|
|
|
|
{isShowingModal && (
|
|
|
|
<SmartTransactionPopover
|
|
|
|
isOpen={isShowingModal}
|
|
|
|
onEnableSmartTransactionsClick={() => {
|
|
|
|
console.log('onEnableSmartTransactionsClick');
|
|
|
|
}}
|
|
|
|
onCloseSmartTransactionsOptInPopover={toggleModal}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
DefaultStory.storyName = 'Default';
|