2021-02-08 17:49:49 +01:00
|
|
|
import React from 'react';
|
2021-04-28 21:53:59 +02:00
|
|
|
import testData from '../../../../.storybook/test-data';
|
2021-12-08 21:32:59 +01:00
|
|
|
import README from './README.mdx';
|
2021-02-08 17:49:49 +01:00
|
|
|
import SignatureRequest from './signature-request.component';
|
|
|
|
|
2022-05-17 00:24:08 +02:00
|
|
|
const [MOCK_PRIMARY_IDENTITY] = Object.values(testData.metamask.identities);
|
2021-02-08 17:49:49 +01:00
|
|
|
|
|
|
|
export default {
|
2021-12-01 20:27:57 +01:00
|
|
|
title: 'Components/App/SignatureRequest',
|
2023-01-20 20:27:46 +01:00
|
|
|
|
2021-12-08 21:32:59 +01:00
|
|
|
component: SignatureRequest,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
txData: { control: 'object' },
|
|
|
|
fromAccount: {
|
|
|
|
table: {
|
|
|
|
address: { control: 'text' },
|
|
|
|
balance: { control: 'text' },
|
|
|
|
name: { control: 'text' },
|
|
|
|
},
|
|
|
|
},
|
2022-05-17 00:24:08 +02:00
|
|
|
hardwareWalletRequiresConnection: { control: 'boolean' },
|
2021-12-08 21:32:59 +01:00
|
|
|
isLedgerWallet: { control: 'boolean' },
|
|
|
|
clearConfirmTransaction: { action: 'Clean Confirm' },
|
|
|
|
cancel: { action: 'Cancel' },
|
|
|
|
sign: { action: 'Sign' },
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const DefaultStory = (args) => {
|
|
|
|
return <SignatureRequest {...args} />;
|
2021-02-08 17:49:49 +01:00
|
|
|
};
|
|
|
|
|
2021-12-08 21:32:59 +01:00
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
|
|
|
|
DefaultStory.args = {
|
|
|
|
txData: {
|
|
|
|
msgParams: {
|
|
|
|
data: JSON.stringify({
|
|
|
|
domain: {
|
|
|
|
name: 'happydapp.website',
|
|
|
|
},
|
|
|
|
message: {
|
|
|
|
string: 'haay wuurl',
|
|
|
|
number: 42,
|
|
|
|
},
|
2022-05-17 00:24:08 +02:00
|
|
|
primaryType: 'Mail',
|
|
|
|
types: {
|
|
|
|
EIP712Domain: [
|
|
|
|
{ name: 'name', type: 'string' },
|
|
|
|
{ name: 'version', type: 'string' },
|
|
|
|
{ name: 'chainId', type: 'uint256' },
|
|
|
|
{ name: 'verifyingContract', type: 'address' },
|
|
|
|
],
|
|
|
|
Group: [
|
|
|
|
{ name: 'name', type: 'string' },
|
|
|
|
{ name: 'members', type: 'Person[]' },
|
|
|
|
],
|
|
|
|
Mail: [
|
|
|
|
{ name: 'from', type: 'Person' },
|
|
|
|
{ name: 'to', type: 'Person[]' },
|
|
|
|
{ name: 'contents', type: 'string' },
|
|
|
|
],
|
|
|
|
Person: [
|
|
|
|
{ name: 'name', type: 'string' },
|
|
|
|
{ name: 'wallets', type: 'address[]' },
|
|
|
|
],
|
|
|
|
},
|
2021-12-08 21:32:59 +01:00
|
|
|
}),
|
2022-12-02 15:12:43 +01:00
|
|
|
origin: 'https://happydapp.website/',
|
2021-12-08 21:32:59 +01:00
|
|
|
},
|
|
|
|
},
|
2022-05-17 00:24:08 +02:00
|
|
|
fromAccount: MOCK_PRIMARY_IDENTITY,
|
2022-12-02 15:12:43 +01:00
|
|
|
provider: { name: 'Goerli ETH' },
|
2021-02-08 17:49:49 +01:00
|
|
|
};
|