1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/ui/components/multichain/app-header/app-header.stories.js
David Walsh eb51460cae
UX: Multichain: App header (#18363)
* UX: Multichain: App header

* Export app header, provide required information, put feature flag in place

* Provide available data

* Implement account picker -- centered and opens account popover

* Remove backgrounds, use isUnlocked

* Fix placement of the global menu

* Show logo when unlocked

* Add selector for getting current network, provide props to AvatarNetwork and PickerNetwork

* Wire up the network menu to the header

* fixed ui for all the screens

* updated story for header

* fixed import and header settings

* updated lint error

* fixed tests

* updated header

* removed test

* updated snapshot test

* updated network menu

* updated changes

* removed comment from menu bar

* updated css

* updated test for network list menu

* updated stylesheet

* updated ButtonIcon import

---------

Co-authored-by: NidhiKJha <menidhikjha@gmail.com>
2023-04-13 22:24:03 +05:30

72 lines
1.6 KiB
JavaScript

import React from 'react';
import { Provider } from 'react-redux';
import configureStore from '../../../store/store';
import testData from '../../../../.storybook/test-data';
import { AppHeader } from '.';
const store = configureStore(testData);
export default {
title: 'Components/Multichain/AppHeader',
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
component: AppHeader,
argTypes: {
onClick: {
action: 'onClick',
},
},
};
const customNetworkUnlockedData = {
...testData,
metamask: {
...testData.metamask,
preferences: {
showTestNetworks: true,
},
isUnlocked: true,
networkConfigurations: {
...testData.metamask.networkConfigurations,
},
},
};
const customNetworkUnlockedStore = configureStore(customNetworkUnlockedData);
const customNetworkLockedData = {
...testData,
metamask: {
...testData.metamask,
preferences: {
showTestNetworks: true,
},
isUnlocked: false,
networkConfigurations: {
...testData.metamask.networkConfigurations,
},
},
};
const customNetworkLockedStore = configureStore(customNetworkLockedData);
const Template = (args) => {
return <AppHeader {...args} />;
};
export const FullScreenAndUnlockedStory = Template.bind({});
FullScreenAndUnlockedStory.decorators = [
(Story) => (
<Provider store={customNetworkUnlockedStore}>
<Story />
</Provider>
),
];
export const FullScreenAndLockedStory = Template.bind({});
FullScreenAndLockedStory.decorators = [
(Story) => (
<Provider store={customNetworkLockedStore}>
<Story />
</Provider>
),
];