aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts
diff options
context:
space:
mode:
authorAugust Skare <post@augustskare.no>2018-11-19 16:50:19 +0800
committerAugust Skare <post@augustskare.no>2018-11-19 16:50:19 +0800
commitfa24ec1a04577590c791f344d5a2bed27abc2663 (patch)
tree97e2e3f3f23cd0cc57b8b635de4081aee30a305a /packages/dev-tools-pages/ts
parent6e1014a64755757777ddc0a58b2d409590efe42e (diff)
downloaddexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.tar
dexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.tar.gz
dexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.tar.bz2
dexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.tar.lz
dexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.tar.xz
dexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.tar.zst
dexon-sol-tools-fa24ec1a04577590c791f344d5a2bed27abc2663.zip
clean up tabs component
Diffstat (limited to 'packages/dev-tools-pages/ts')
-rw-r--r--packages/dev-tools-pages/ts/components/Tabs.tsx44
1 files changed, 17 insertions, 27 deletions
diff --git a/packages/dev-tools-pages/ts/components/Tabs.tsx b/packages/dev-tools-pages/ts/components/Tabs.tsx
index ece0db866..0a62fa334 100644
--- a/packages/dev-tools-pages/ts/components/Tabs.tsx
+++ b/packages/dev-tools-pages/ts/components/Tabs.tsx
@@ -15,6 +15,7 @@ const StyledTabList = styled(TabList)`
`;
const StyledTab = styled(Tab)`
+ background-color: ${props => props.theme.colors.secondary};
height: 2.5rem;
padding-left: 1rem;
padding-right: 1rem;
@@ -25,41 +26,30 @@ const StyledTab = styled(Tab)`
&:not(:first-of-type) {
margin-left: 0.25rem;
}
-`;
-
-const Root =
- styled.div <
- { colors: any } >
- `
- ${StyledTab} {
- background-color: ${props => props.theme.colors.secondary};
- &[aria-selected="true"] {
- background-color: ${colors.gray};
- }
+ &[aria-selected='true'] {
+ background-color: ${colors.gray};
+ }
- &[aria-selected="false"]:focus,
- &[aria-selected="false"]:hover {
- background-color: ${props => props.theme.colors.secondary_alt};
- cursor: pointer;
- }
+ &[aria-selected='false']:focus,
+ &[aria-selected='false']:hover {
+ background-color: ${props => props.theme.colors.secondary_alt};
+ cursor: pointer;
}
`;
const Tabs: React.StatelessComponent<{}> = props => (
<Breakout>
- <Root>
- <ReactTabs>
- <StyledTabList>
- {React.Children.map(props.children, child => {
- const { title } = React.cloneElement(child as React.ReactElement<any>).props;
- return <StyledTab>{title}</StyledTab>;
- })}
- </StyledTabList>
+ <ReactTabs>
+ <StyledTabList>
+ {React.Children.map(props.children, child => {
+ const { title } = React.cloneElement(child as React.ReactElement<any>).props;
+ return <StyledTab>{title}</StyledTab>;
+ })}
+ </StyledTabList>
- {React.Children.map(props.children, child => <TabPanel>{child}</TabPanel>)}
- </ReactTabs>
- </Root>
+ {React.Children.map(props.children, child => <TabPanel>{child}</TabPanel>)}
+ </ReactTabs>
</Breakout>
);