chore: Standardized headers (#1883)
* feat: Collection to standard header feat: Sticky tabs * chore: Document to standard header * chore: Dashboard -> Home chore: Scene component * chore: Trash, Templates, Drafts * fix: Mobile improvements * fix: Content showing at sides and occassionally ontop of sticky headers
This commit is contained in:
@ -1,16 +1,27 @@
|
||||
// @flow
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Tabs = styled.nav`
|
||||
position: relative;
|
||||
const Nav = styled.nav`
|
||||
border-bottom: 1px solid ${(props) => props.theme.divider};
|
||||
margin-top: 22px;
|
||||
margin-bottom: 12px;
|
||||
margin: 12px 0;
|
||||
overflow-y: auto;
|
||||
white-space: nowrap;
|
||||
transition: opacity 250ms ease-out;
|
||||
`;
|
||||
|
||||
// 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};
|
||||
z-index: ${(props) => props.theme.depths.stickyHeader};
|
||||
`;
|
||||
|
||||
export const Separator = styled.span`
|
||||
border-left: 1px solid ${(props) => props.theme.divider};
|
||||
position: relative;
|
||||
@ -19,4 +30,12 @@ export const Separator = styled.span`
|
||||
margin-top: 6px;
|
||||
`;
|
||||
|
||||
const Tabs = (props: {}) => {
|
||||
return (
|
||||
<Sticky>
|
||||
<Nav {...props}></Nav>
|
||||
</Sticky>
|
||||
);
|
||||
};
|
||||
|
||||
export default Tabs;
|
||||
|
Reference in New Issue
Block a user