1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/components/app/tab-bar/tab-bar.stories.js
David Walsh 8c233b2a82
UX: Icons: Stop using fa-address-book (#17761)
* UX: Icons: Stop using fa-address-book

* Remove locale string

* Fix positioning
2023-02-16 07:26:00 -06:00

79 lines
1.7 KiB
JavaScript

import React, { useState } from 'react';
import { Icon, ICON_NAMES } from '../../component-library';
import TabBar from '.';
export default {
title: 'Components/App/TabBar',
argTypes: {
isActive: {
action: 'isActive',
},
tabs: {
control: 'array',
},
onSelect: {
action: 'onSelect',
},
},
args: {
tabs: [
{
icon: <i className="fa fa-cog" />,
content: 'General',
key: 'general',
},
{
icon: <Icon name={ICON_NAMES.BOOK} />,
content: 'Contacts',
key: 'contacts',
},
{
icon: <i className="fa fa-flask" />,
content: 'Snaps',
key: 'snaps',
},
{
icon: <i className="fa fa-lock" />,
content: 'SecurityAndPrivacy',
key: 'securityAndPrivacy',
},
{
icon: <Icon name={ICON_NAMES.NOTIFICATION} />,
content: 'Alerts',
key: 'alerts',
},
{
icon: <i className="fa fa-plug" />,
content: 'Networks',
key: 'networks',
},
{
icon: <i className="fa fa-flask" />,
content: 'Experimental',
key: 'experimental',
},
{
icon: <i className="fa fa-info-circle" />,
content: 'About',
key: 'about',
},
],
},
};
export const DefaultStory = (args) => {
const [currentTab, setCurrentTab] = useState('');
const handleOnSelect = (key) => setCurrentTab(key);
const handleIsActive = (key) => currentTab === key;
return (
<TabBar
tabs={args.tabs}
isActive={handleIsActive}
onSelect={handleOnSelect}
/>
);
};
DefaultStory.storyName = 'Default';