-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Approval Confirmation Screen component to Storybook (#10998)
* add metametrics wrapper * add history dep * provide test data and mock react router * add first confirmaion screen * figure out a way to mock match.params * render token approval with data * fix lockfile * fix lint * remove use effect * lintfix * add . for src paths * litfix * Add knobs to change redux store for confirm-approve component (Storybook) (#11135) * add knob for domain * knobify * remove logs * remove comment * lintfix * fix comments * add background calls + metriccs event to storybook acctions * lintfixxxx
- Loading branch information
Showing
20 changed files
with
960 additions
and
216 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
.storybook/initial-states/approval-screens/token-approval.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
export const currentNetworkTxListSample = { | ||
"id": 7900715443136469, | ||
"time": 1621395091737, | ||
"status": "unapproved", | ||
"metamaskNetworkId": "1337", | ||
"chainId": "0x539", | ||
"loadingDefaults": false, | ||
"txParams": { | ||
"from": "0x90f79bf6eb2c4f870365e785982e1f101e93b906", | ||
"to": "0x057ef64e23666f000b34ae31332854acbd1c8544", | ||
"value": "0x0", | ||
"data": "0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef40000000000000000000000000000000000000000000000000000000000011170", | ||
"gas": "0xea60", | ||
"gasPrice": "0x4a817c800" | ||
}, | ||
"origin": "https://metamask.github.io", | ||
"type": "approve", | ||
"history": [ | ||
{ | ||
"id": 7900715443136469, | ||
"time": 1621395091737, | ||
"status": "unapproved", | ||
"metamaskNetworkId": "1337", | ||
"chainId": "0x539", | ||
"loadingDefaults": true, | ||
"txParams": { | ||
"from": "0x90f79bf6eb2c4f870365e785982e1f101e93b906", | ||
"to": "0x057ef64e23666f000b34ae31332854acbd1c8544", | ||
"value": "0x0", | ||
"data": "0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef40000000000000000000000000000000000000000000000000000000000011170", | ||
"gas": "0xea60", | ||
"gasPrice": "0x4a817c800" | ||
}, | ||
"origin": "https://metamask.github.io", | ||
"type": "approve" | ||
}, | ||
[ | ||
{ | ||
"op": "replace", | ||
"path": "/loadingDefaults", | ||
"value": false, | ||
"note": "Added new unapproved transaction.", | ||
"timestamp": 1621395091742 | ||
} | ||
] | ||
] | ||
} | ||
|
||
export const domainMetadata = { | ||
"https://metamask.github.io": { | ||
"name": "E2E Test Dapp", | ||
"icon": "https://metamask.github.io/test-dapp/metamask-fox.svg", | ||
"lastUpdated": 1620723443380, | ||
"host": "metamask.github.io" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { | ||
MetaMetricsProvider, | ||
LegacyMetaMetricsProvider, | ||
} from '../ui/contexts/metametrics'; | ||
import { | ||
MetaMetricsProvider as NewMetaMetricsProvider, | ||
LegacyMetaMetricsProvider as NewLegacyMetaMetricsProvider, | ||
} from '../ui/contexts/metametrics.new'; | ||
|
||
const MetaMetricsProviderStorybook = (props) => | ||
( | ||
<MetaMetricsProvider> | ||
<LegacyMetaMetricsProvider> | ||
<NewMetaMetricsProvider> | ||
<NewLegacyMetaMetricsProvider> | ||
{props.children} | ||
</NewLegacyMetaMetricsProvider> | ||
</NewMetaMetricsProvider> | ||
</LegacyMetaMetricsProvider> | ||
</MetaMetricsProvider> | ||
); | ||
|
||
export default MetaMetricsProviderStorybook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.