feat: tab close ui

This commit is contained in:
cha0s 2020-06-20 05:54:09 -05:00
parent 78cda4d07a
commit 8a5b7930e4
2 changed files with 28 additions and 2 deletions

View File

@ -162,7 +162,15 @@ const Traits = (props) => {
}
}}
>
{tabs.map(([type]) => <Tab key={type}>{type}</Tab>)}
{tabs.map(([type]) => (
<Tab key={type}>
<span className="wrapper">
<span className="icon" />
{type}
<span className="close"></span>
</span>
</Tab>
))}
</TabList>
{tabs.map(([type, content]) => (
<TabPanel

View File

@ -27,13 +27,31 @@
color: #aaaaaa;
cursor: pointer;
display: inline-block;
padding: 1em 3em;
&:not(:last-of-type) {
border-right: 1px solid #282828;
}
&:hover {
color: #ddd;
}
.wrapper {
align-content: space-between;
align-items: center;
display: flex;
justify-content: space-evenly;
height: 3em;
width: 10em;
}
.close {
color: #999999;
padding: 0.25em;
visibility: hidden;
&:hover {
color: #ffffff;
}
}
&:hover .close {
visibility: visible;
}
}
.react-tabs__tab--selected[class] {