From fa24ec1a04577590c791f344d5a2bed27abc2663 Mon Sep 17 00:00:00 2001 From: August Skare Date: Mon, 19 Nov 2018 09:50:19 +0100 Subject: clean up tabs component --- packages/dev-tools-pages/ts/components/Tabs.tsx | 44 ++++++++++--------------- 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'packages/dev-tools-pages/ts') 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 => ( - - - - {React.Children.map(props.children, child => { - const { title } = React.cloneElement(child as React.ReactElement).props; - return {title}; - })} - + + + {React.Children.map(props.children, child => { + const { title } = React.cloneElement(child as React.ReactElement).props; + return {title}; + })} + - {React.Children.map(props.children, child => {child})} - - + {React.Children.map(props.children, child => {child})} + ); -- cgit v1.2.3