2021-02-08 17:49:49 +01:00
|
|
|
import React from 'react';
|
2023-07-20 19:51:38 +02:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import configureStore from '../../../store/store';
|
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';
|
2023-07-20 19:51:38 +02:00
|
|
|
import SignatureRequest from './signature-request';
|
2021-02-08 17:49:49 +01:00
|
|
|
|
2023-07-20 19:51:38 +02:00
|
|
|
const store = configureStore({
|
|
|
|
...testData,
|
|
|
|
metamask: {
|
|
|
|
...testData.metamask,
|
|
|
|
selectedAddress: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e',
|
|
|
|
},
|
|
|
|
});
|
2021-02-08 17:49:49 +01:00
|
|
|
|
|
|
|
export default {
|
2021-12-01 20:27:57 +01:00
|
|
|
title: 'Components/App/SignatureRequest',
|
2023-07-20 19:51:38 +02:00
|
|
|
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
|
|
|
|
2021-12-08 21:32:59 +01:00
|
|
|
component: SignatureRequest,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
txData: { control: 'object' },
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
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: {
|
2023-07-20 19:51:38 +02:00
|
|
|
from: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e',
|
2021-12-08 21:32:59 +01:00
|
|
|
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
|
|
|
},
|
|
|
|
},
|
2023-04-25 12:47:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export const AccountMismatchStory = (args) => {
|
|
|
|
return <SignatureRequest {...args} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
AccountMismatchStory.storyName = 'AccountMismatch';
|
|
|
|
|
|
|
|
AccountMismatchStory.args = {
|
|
|
|
...DefaultStory.args,
|
2023-07-20 19:51:38 +02:00
|
|
|
txData: {
|
|
|
|
msgParams: {
|
|
|
|
...DefaultStory.args.txData.msgParams,
|
|
|
|
from: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4',
|
|
|
|
},
|
|
|
|
},
|
2021-02-08 17:49:49 +01:00
|
|
|
};
|