Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit 70d1751

Browse files
committed
[Tabs] make the corners rounded + add hover effect.
1 parent 1b47a82 commit 70d1751

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

src/components/pricing/Tabs.tsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,57 @@ import styled from '@emotion/styled'
44
import { colors } from '../../styles/variables'
55
import { PricingBoxesProps } from './PricingBoxes'
66

7-
const Tab = styled.button`
7+
const Tab = styled.button<{ isRendered: boolean }>`
88
display: block;
99
padding: 1.3rem 2rem;
1010
font-size: 18px;
1111
color: ${colors.textLight};
1212
min-width: 15rem;
1313
text-align: center;
14-
background-color: ${colors.white};
1514
border: 1px solid ${colors.offWhite2};
15+
border-radius: 6px 6px 0 0;
1616
border-bottom-color: transparent;
1717
margin-bottom: -1px;
1818
cursor: pointer;
19+
transition: all .1s;
1920
2021
&:first-of-type {
22+
background-color: ${ ({ isRendered }) => isRendered ? colors.offWhite2 : colors.white };
2123
border-right: none;
2224
}
2325
2426
&:last-of-type {
27+
background-color: ${ ({ isRendered }) => isRendered ? colors.white : colors.offWhite2 };
2528
border-left: none;
2629
}
2730
2831
body.user-is-tabbing &:focus {
2932
outline: none;
3033
border: 1px solid #1AA6E4;;
3134
}
35+
36+
&:hover {
37+
color: ${colors.link};
38+
}
3239
`
3340

3441
const Tabs = ({ isRendered, changeIsRendered }: PricingBoxesProps) => (
3542
<div style={{
3643
display: 'flex',
3744
justifyContent: 'center'
3845
}}>
39-
<Tab style={{
40-
backgroundColor: isRendered ? colors.offWhite2 : colors.white,
41-
}}
46+
<Tab
47+
isRendered={isRendered}
4248
onClick={() => changeIsRendered(false)}
43-
>Cloud</Tab>
44-
<Tab style={{
45-
backgroundColor: isRendered ? colors.white : colors.offWhite2,
46-
}}
49+
>
50+
Cloud
51+
</Tab>
52+
<Tab
53+
isRendered={isRendered}
4754
onClick={() => changeIsRendered(true)}
48-
>Self-Hosted</Tab>
55+
>
56+
Self-Hosted
57+
</Tab>
4958
</div>
5059
)
5160

0 commit comments

Comments
 (0)