mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
ff96836871
* Add updated version of the Snaps list UI Add more changes to match the designs of snaps list Add next design iteration for snaps list Update icons, sizes and pointer behaviour Add redesign for snap settings page Refactor and improve designs Fix unit tests and refactor code Fix e2e test Fix lint Update margin values Add CSS override for connected sites list and update margins Update paddings as requested Fix vertical alignment of links Fix tooltip position on the enable button Add usage of getSnapName function for displaying snap names Fix e2e tests and update date format for snap install date Improve unit test for snap-settings-card Change installation info logic Update mocked state for snap Add tests for ViewSnap component, refactor and update mocked state Add check for version info Change Snaps icon in Settings Refactor Snaps list to use selector Add handling in case of missing version history * Fix icon ref * Remove console logs * Remove onClick from selector * Add code fencing for imports in selectors.js
79 lines
1.7 KiB
JavaScript
79 lines
1.7 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: <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';
|