2018-08-10 06:14:51 +00:00
|
|
|
// @flow
|
2021-02-14 21:18:33 +00:00
|
|
|
import * as React from "react";
|
2020-06-20 20:59:15 +00:00
|
|
|
import styled from "styled-components";
|
2018-08-10 06:14:51 +00:00
|
|
|
|
2021-02-14 21:18:33 +00:00
|
|
|
const Nav = styled.nav`
|
2020-08-09 01:53:11 +00:00
|
|
|
border-bottom: 1px solid ${(props) => props.theme.divider};
|
2021-02-14 21:18:33 +00:00
|
|
|
margin: 12px 0;
|
2020-08-17 07:08:22 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
white-space: nowrap;
|
2021-02-10 04:13:09 +00:00
|
|
|
transition: opacity 250ms ease-out;
|
2018-08-10 06:14:51 +00:00
|
|
|
`;
|
|
|
|
|
2021-02-14 21:18:33 +00:00
|
|
|
// When sticky we need extra background coverage around the sides otherwise
|
|
|
|
// items that scroll past can "stick out" the sides of the heading
|
|
|
|
const Sticky = styled.div`
|
|
|
|
position: sticky;
|
|
|
|
top: 54px;
|
|
|
|
margin: 0 -8px;
|
|
|
|
padding: 0 8px;
|
|
|
|
background: ${(props) => props.theme.background};
|
|
|
|
transition: ${(props) => props.theme.backgroundTransition};
|
2021-02-15 23:19:51 +00:00
|
|
|
z-index: 1;
|
2021-02-14 21:18:33 +00:00
|
|
|
`;
|
|
|
|
|
2019-12-16 02:46:08 +00:00
|
|
|
export const Separator = styled.span`
|
2020-08-09 01:53:11 +00:00
|
|
|
border-left: 1px solid ${(props) => props.theme.divider};
|
2019-12-16 02:46:08 +00:00
|
|
|
position: relative;
|
|
|
|
top: 2px;
|
|
|
|
margin-right: 24px;
|
|
|
|
margin-top: 6px;
|
|
|
|
`;
|
|
|
|
|
2021-02-14 21:18:33 +00:00
|
|
|
const Tabs = (props: {}) => {
|
|
|
|
return (
|
|
|
|
<Sticky>
|
|
|
|
<Nav {...props}></Nav>
|
|
|
|
</Sticky>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2018-08-10 06:14:51 +00:00
|
|
|
export default Tabs;
|