-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2647646
commit 408635b
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import styled from "styled-components" | ||
import { | ||
Tab as UnstyledTab, | ||
TabList as UnstyledTabList, | ||
TabPanel as UnstyledTabPanel, | ||
Tabs as UnstyledTabs | ||
} from "react-tabs" | ||
|
||
const Tabs = styled(UnstyledTabs)` | ||
background: var(--main-background-color); | ||
` | ||
|
||
const TabList = styled(UnstyledTabList)` | ||
display: flex; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
padding: 0; | ||
margin: 0; | ||
` | ||
|
||
const Tab = styled(UnstyledTab).attrs({ | ||
selectedClassName: "selected", | ||
disabledClassName: "disabled" | ||
})` | ||
flex-grow: 1; | ||
text-align: center; | ||
padding: 12px 0; | ||
list-style: none; | ||
cursor: pointer; | ||
border-bottom: 1px solid var(--card-outline); | ||
&:first-child { | ||
border-left: none; | ||
} | ||
&.selected { | ||
border-bottom: 5px var(--highlight-color) solid; | ||
} | ||
&.disabled { | ||
color: var(--unlisted-text-color); | ||
cursor: not-allowed; | ||
} | ||
` | ||
|
||
const TabPanel = styled(UnstyledTabPanel).attrs({ selectedClassName: "selected" })` | ||
display: none; | ||
&.selected { | ||
display: block; | ||
} | ||
` | ||
|
||
Tab.tabsRole = "Tab" | ||
Tabs.tabsRole = "Tabs" | ||
TabPanel.tabsRole = "TabPanel" | ||
TabList.tabsRole = "TabList" | ||
|
||
export { Tab, TabList, Tabs, TabPanel } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters