File tree 1 file changed +37
-0
lines changed
docs/src/gatsby-theme-apollo-docs/components
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ import PropTypes from 'prop-types' ;
2
+ import React from 'react' ;
3
+ import styled from '@emotion/styled' ;
4
+ import { HEADER_HEIGHT } from '../utils' ;
5
+ import { breakpoints } from 'gatsby-theme-apollo-core' ;
6
+
7
+ const Wrapper = styled . header ( {
8
+ position : 'sticky' ,
9
+ top : 0 ,
10
+ left : 0 ,
11
+ zIndex : 1
12
+ } ) ;
13
+
14
+ const InnerWrapper = styled . div ( {
15
+ display : 'flex' ,
16
+ alignItems : 'center' ,
17
+ height : HEADER_HEIGHT ,
18
+ padding : '0 56px' ,
19
+ backgroundColor : 'white' ,
20
+ [ breakpoints . md ] : {
21
+ padding : '0 24px'
22
+ }
23
+ } ) ;
24
+
25
+ export default function Header ( props ) {
26
+ return (
27
+ < Wrapper >
28
+ { props . beforeContent }
29
+ < InnerWrapper className = "content-header" > { props . children } </ InnerWrapper >
30
+ </ Wrapper >
31
+ ) ;
32
+ }
33
+
34
+ Header . propTypes = {
35
+ beforeContent : PropTypes . node . isRequired ,
36
+ children : PropTypes . node . isRequired
37
+ } ;
You can’t perform that action at this time.
0 commit comments