forked from apollographql/gatsby-theme-apollo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the sidebar to the components dir
- Loading branch information
1 parent
76777f8
commit 78dd936
Showing
3 changed files
with
58 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Header from './header'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import colors from '../util/colors'; | ||
import styled from '@emotion/styled'; | ||
import {ReactComponent as LogoSmall} from '../../ui/logo-small.svg'; | ||
|
||
const Container = styled.aside({ | ||
flexShrink: 0, | ||
width: 305, | ||
borderRight: `1px solid ${colors.divider}`, | ||
overflowY: 'auto', | ||
position: 'relative' | ||
}); | ||
|
||
const StyledHeader = styled(Header)({ | ||
borderBottom: `1px solid ${colors.divider}`, | ||
fontSize: 18 | ||
}); | ||
|
||
const StyledLogoSmall = styled(LogoSmall)({ | ||
marginRight: 8, | ||
height: 36, | ||
fill: 'currentColor' | ||
}); | ||
|
||
const Content = styled.div({ | ||
padding: '20px 24px', | ||
paddingRight: 0 | ||
}); | ||
|
||
export default function Sidebar(props) { | ||
return ( | ||
<Container> | ||
<StyledHeader> | ||
<StyledLogoSmall /> | ||
{props.title} | ||
</StyledHeader> | ||
<Content>{props.children}</Content> | ||
</Container> | ||
); | ||
} | ||
|
||
Sidebar.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
title: PropTypes.string.isRequired | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters