mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-12 20:57:12 +01:00
69b5505a1c
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
58 lines
1.2 KiB
JavaScript
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';
|