diff options
author | August Skare <post@augustskare.no> | 2018-11-19 16:50:19 +0800 |
---|---|---|
committer | August Skare <post@augustskare.no> | 2018-11-19 16:50:19 +0800 |
commit | fa24ec1a04577590c791f344d5a2bed27abc2663 (patch) | |
tree | 97e2e3f3f23cd0cc57b8b635de4081aee30a305a /packages/dev-tools-pages | |
parent | 6e1014a64755757777ddc0a58b2d409590efe42e (diff) | |
download | dexon-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')
-rw-r--r-- | packages/dev-tools-pages/ts/components/Tabs.tsx | 44 |
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> ); |