1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/ui/components/app/tab-bar/tab-bar.stories.js
Nidhi Kumari 6535e34943
Replaced all fa-icon-circle with INFO icon (#17539)
* replace all fa-icon-circle with INFO icon

* updated classnames

* updated classnames

* updated snapshots

* updated colors

* resolved errors

* fixed relative import

* fixed lint errors

* added story for alerts tab

* update snapshot

* updated info-circle

* updated enum for iconName

* removed classnames

* updated iconName in settings

* fixed lint errors and snapshots
2023-05-09 23:04:58 +05:30

79 lines
1.6 KiB
JavaScript

import React, { useState } from 'react';
import { Icon, IconName } 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: <Icon name={IconName.Setting} />,
content: 'General',
key: 'general',
},
{
icon: <Icon name={IconName.Book} />,
content: 'Contacts',
key: 'contacts',
},
{
icon: <Icon name={IconName.Snaps} />,
content: 'Snaps',
key: 'snaps',
},
{
icon: <i className="fa fa-lock" />,
content: 'SecurityAndPrivacy',
key: 'securityAndPrivacy',
},
{
icon: <Icon name={IconName.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: <Icon name={IconName.Info} />,
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';