@@ -5,14 +5,15 @@ import Helmet from "react-helmet";
5
5
import GrapheneLogo from "./graphene-logo.svg" ;
6
6
import Arrow from "./arrow.svg" ;
7
7
import LogoOnWhite from "./logo-on-white.svg" ;
8
+ import GrapheneLogoWhite from "./graphene-logo-white.svg" ;
8
9
9
10
import "./index.css" ;
10
11
11
- const Header = ( ) => (
12
+ const Header = ( { docs } ) => (
12
13
< div >
13
14
< header className = "graphene-header" >
14
15
< div className = "container" >
15
- < Link to = "/" >
16
+ < Link to = "http://graphene-python.org /" >
16
17
< GrapheneLogo className = "graphene-logo" />
17
18
</ Link >
18
19
< a className = "tagline" href = "//graphene.tools/" >
@@ -21,16 +22,20 @@ const Header = () => (
21
22
</ a >
22
23
</ div >
23
24
</ header >
24
- < header className = "container navbar-header" >
25
- < Link to = "/" >
26
- < LogoOnWhite />
27
- </ Link >
28
- < nav >
29
- < a href = "//docs.graphene-python.org/" > Documentation</ a >
30
- < a href = "/blog" > Blog</ a >
31
- < a href = "https://github.com/graphql-python/graphene" > Github</ a >
32
- </ nav >
25
+ < header
26
+ className = { `navbar-header ${ docs ? "navbar-header-contrast" : "" } ` }
27
+ >
28
+ < div className = "container" >
29
+ < a href = "http://graphene-python.org/" className = "logo-link" >
30
+ { docs ? < GrapheneLogoWhite /> : < LogoOnWhite /> }
31
+ </ a >
32
+ < nav >
33
+ < a href = "http://docs.graphene-python.org/" > Documentation</ a >
34
+ < a href = "https://github.com/graphql-python/graphene" > Github</ a >
35
+ </ nav >
36
+ </ div >
33
37
</ header >
38
+
34
39
< style jsx > { `
35
40
.graphene-header {
36
41
background: #000000;
@@ -72,11 +77,18 @@ const Header = () => (
72
77
position: relative;
73
78
top: 2px;
74
79
}
80
+ .navbar-header-contrast {
81
+ background-image: linear-gradient(-180deg, #f67049 0%, #e14b2e 100%);
82
+ }
83
+
75
84
.navbar-header {
76
85
height: 94px;
77
- align-items: center;
86
+ }
87
+ .navbar-header :global(.container) {
78
88
display: flex;
89
+ align-items: center;
79
90
}
91
+
80
92
.navbar-header nav {
81
93
height: 100%;
82
94
display: block;
@@ -99,24 +111,34 @@ const Header = () => (
99
111
.navbar-header nav a:hover {
100
112
color: black;
101
113
}
114
+ .navbar-header-contrast nav a {
115
+ color: white;
116
+ }
117
+ .navbar-header-contrast nav a:hover {
118
+ color: #eee;
119
+ }
120
+
102
121
@import url("https://fonts.googleapis.com/css?family=Fira+Mono|Open+Sans:400,600");
103
122
` } </ style >
104
123
</ div >
105
124
) ;
106
125
107
- const TemplateWrapper = ( { children } ) => (
108
- < div >
109
- < Helmet
110
- title = "Graphene-Python"
111
- meta = { [
112
- { name : "description" , content : "Graphene framework for Python" } ,
113
- { name : "keywords" , content : "graphene, graphql, python, framework" }
114
- ] }
115
- />
116
- < Header />
117
- < div > { children ( ) } </ div >
118
- </ div >
119
- ) ;
126
+ const TemplateWrapper = ( { children, ...otherProps } ) => {
127
+ const docs = otherProps . location . pathname . indexOf ( "/docs" ) > - 1 ;
128
+ return (
129
+ < div >
130
+ < Helmet
131
+ title = "Graphene-Python"
132
+ meta = { [
133
+ { name : "description" , content : "Graphene framework for Python" } ,
134
+ { name : "keywords" , content : "graphene, graphql, python, framework" }
135
+ ] }
136
+ />
137
+ < Header docs = { docs } />
138
+ < div > { children ( ) } </ div >
139
+ </ div >
140
+ ) ;
141
+ } ;
120
142
121
143
TemplateWrapper . propTypes = {
122
144
children : PropTypes . func
0 commit comments