mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 07:16:36 +01:00
789779f4d5
* Add new snap header and footer to snap install * Add new snap header and footer to snap result and snap update * Fix loading state * Fix lint * Add required scrolling * Adjust avatar component * Apply new headers and footers to snaps confirmations * Rename previous SnapAuthorship component to SnapAuthorshipExpanded * Fix lint * Fix font weight * Fix fencing * Fix a test * Fix lint after rebase * Fix E2E * Fix locale lint * Fix another E2E * Fix test ID * Address PR comments * Better scroll button centering * Address design comments * Fix unit test * Fix E2Es
125 lines
2.4 KiB
JavaScript
125 lines
2.4 KiB
JavaScript
import React from 'react';
|
|
import { Provider } from 'react-redux';
|
|
|
|
import configureStore from '../../../../store/store';
|
|
import mockState from '../../../../../test/data/mock-state.json';
|
|
import SnapUpdate from '.';
|
|
|
|
const store = configureStore(mockState);
|
|
|
|
export default {
|
|
title: 'Pages/Snaps/SnapUpdate',
|
|
|
|
component: SnapUpdate,
|
|
argTypes: {},
|
|
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
|
};
|
|
|
|
export const DefaultStory = (args) => <SnapUpdate {...args} />;
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
DefaultStory.args = {
|
|
request: {
|
|
metadata: {
|
|
id: 'foo',
|
|
},
|
|
},
|
|
requestState: {
|
|
loading: false,
|
|
newVersion: '2.0.0',
|
|
approvedPermissions: {
|
|
'endowment:rpc': {
|
|
caveats: [
|
|
{
|
|
type: 'rpcOrigin',
|
|
value: {
|
|
dapps: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
snap_dialog: {},
|
|
snap_getBip44Entropy: {
|
|
caveats: [
|
|
{
|
|
type: 'permittedCoinTypes',
|
|
value: [
|
|
{
|
|
coinType: 1,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
targetSubjectMetadata: {
|
|
origin: 'npm:@metamask/test-snap-bip44',
|
|
},
|
|
};
|
|
|
|
export const LoadingStory = (args) => <SnapUpdate {...args} />;
|
|
|
|
LoadingStory.storyName = 'Loading';
|
|
|
|
LoadingStory.args = {
|
|
request: {
|
|
metadata: {
|
|
id: 'foo',
|
|
},
|
|
},
|
|
requestState: {
|
|
loading: true,
|
|
},
|
|
targetSubjectMetadata: {
|
|
origin: 'npm:@metamask/test-snap-bip44',
|
|
},
|
|
};
|
|
|
|
export const ScrollingStory = (args) => <SnapUpdate {...args} />;
|
|
|
|
ScrollingStory.storyName = 'Scrolling';
|
|
|
|
ScrollingStory.args = {
|
|
request: {
|
|
metadata: {
|
|
id: 'foo',
|
|
},
|
|
},
|
|
requestState: {
|
|
loading: false,
|
|
newVersion: '2.0.0',
|
|
approvedPermissions: {
|
|
'endowment:rpc': {
|
|
caveats: [
|
|
{
|
|
type: 'rpcOrigin',
|
|
value: {
|
|
dapps: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
'endowment:network-access': {},
|
|
snap_notify: {},
|
|
snap_dialog: {},
|
|
snap_getBip44Entropy: {
|
|
caveats: [
|
|
{
|
|
type: 'permittedCoinTypes',
|
|
value: [
|
|
{
|
|
coinType: 1,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
targetSubjectMetadata: {
|
|
origin: 'npm:@metamask/test-snap-bip44',
|
|
},
|
|
};
|