2022-03-08 22:50:35 +01:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
import TabBar from '.';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/App/TabBar',
|
|
|
|
id: __filename,
|
|
|
|
argTypes: {
|
|
|
|
isActive: {
|
|
|
|
action: 'isActive',
|
|
|
|
},
|
|
|
|
tabs: {
|
|
|
|
control: 'array',
|
|
|
|
},
|
|
|
|
onSelect: {
|
|
|
|
action: 'onSelect',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
args: {
|
|
|
|
tabs: [
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-cog" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'General',
|
|
|
|
key: 'general',
|
|
|
|
},
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-address-book" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'Contacts',
|
|
|
|
key: 'contacts',
|
|
|
|
},
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-flask" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'Snaps',
|
|
|
|
key: 'snaps',
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-lock" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'SecurityAndPrivacy',
|
|
|
|
key: 'securityAndPrivacy',
|
|
|
|
},
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-bell" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'Alerts',
|
|
|
|
key: 'alerts',
|
|
|
|
},
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-plug" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'Networks',
|
|
|
|
key: 'networks',
|
|
|
|
},
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-flask" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
content: 'Experimental',
|
|
|
|
key: 'experimental',
|
|
|
|
},
|
|
|
|
{
|
2022-03-21 14:58:36 +01:00
|
|
|
icon: <i className="fa fa-info-circle" />,
|
2022-03-08 22:50:35 +01:00
|
|
|
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';
|