1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-03 14:44:27 +01:00
metamask-extension/ui/components/app/modals/contract-details-modal/contract-details-modal.stories.js
Adnan Sahovic 69b5505a1c
Created a new contract details modal (#15549)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2022-08-24 12:12:52 -05:00

58 lines
1.2 KiB
JavaScript

import React, { useState } from 'react';
import Button from '../../../ui/button';
import ContractDetailsModal from './contract-details-modal';
export default {
title: 'Components/App/Modals/ContractDetailsModal',
id: __filename,
argTypes: {
onClosePopover: {
action: 'Close Contract Details',
},
onOpenPopover: {
action: 'Open Contract Details',
},
tokenName: {
control: {
type: 'text',
},
},
address: {
control: {
type: 'text',
},
},
},
args: {
tokenName: 'DAI',
address: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
},
};
export const DefaultStory = (args) => {
const [showContractDetails, setshowContractDetails] = useState(false);
return (
<>
<Button
onClick={() => {
args.onOpenPopover();
setshowContractDetails(true);
}}
>
Verify contract details
</Button>
{showContractDetails && (
<ContractDetailsModal
onClose={() => {
args.onClosePopover();
setshowContractDetails(false);
}}
{...args}
/>
)}
</>
);
};
DefaultStory.storyName = 'Default';