1
1
import * as React from 'react'
2
2
import { Helmet } from 'react-helmet'
3
- import { StaticQuery , graphql , Link } from 'gatsby'
4
- import CookieConsent from 'react-cookie-consent'
3
+ import { StaticQuery , graphql } from 'gatsby'
5
4
6
- import { colors , borders } from '../styles/variables'
7
5
import GitpodIcon from '../resources/gitpod.svg'
8
6
import GitpodIcon196 from '../resources/gitpod-196x196.png'
9
7
import GitpodIconApple from '../resources/apple-touch-icon.png'
10
8
11
9
import LayoutRoot from '../components/LayoutRoot'
12
10
import LayoutMain from '../components/LayoutMain'
13
- import Nav from '../components/Nav'
14
- import Footer from '../components/Footer'
15
- import MinimalFooter from '../components/MinimalFooter'
16
- import AnnoucementBanner from '../components/AnnouncementBanner'
11
+
17
12
18
13
type StaticQueryProps = {
19
- site : {
20
- siteMetadata : {
21
- title : string
22
- description : string
23
- siteUrl : string
14
+ site : {
15
+ siteMetadata : {
16
+ title : string
17
+ description : string
18
+ siteUrl : string
19
+ }
24
20
}
25
- }
26
21
}
27
22
28
- class IndexLayout extends React . Component < { title ?: string ; canonical ?: string ; description ?: string , isAFlowPage ?: boolean , showReInstallExtensionButton ?: boolean , ogImage ?:string } , { } > {
29
- handleFirstTab = ( e : any ) => {
30
- if ( e . key === 'Tab' ) {
31
- // the "I am a keyboard user" key
32
- document . body . classList . add ( 'user-is-tabbing' )
33
- window . removeEventListener ( 'keydown' , this . handleFirstTab )
34
- window . addEventListener ( 'mousedown' , this . handleMouseDownOnce )
23
+ class IndexLayout extends React . Component < { title ?: string ; canonical ?: string ; description ?: string , ogImage ?: string } , { } > {
24
+ handleFirstTab = ( e : any ) => {
25
+ if ( e . key === 'Tab' ) {
26
+ // the "I am a keyboard user" key
27
+ document . body . classList . add ( 'user-is-tabbing' )
28
+ window . removeEventListener ( 'keydown' , this . handleFirstTab )
29
+ window . addEventListener ( 'mousedown' , this . handleMouseDownOnce )
30
+ }
35
31
}
36
- }
37
32
38
- handleMouseDownOnce = ( ) => {
39
- document . body . classList . remove ( 'user-is-tabbing' )
33
+ handleMouseDownOnce = ( ) => {
34
+ document . body . classList . remove ( 'user-is-tabbing' )
40
35
41
- window . removeEventListener ( 'mousedown' , this . handleMouseDownOnce )
42
- window . addEventListener ( 'keydown' , this . handleFirstTab )
43
- }
36
+ window . removeEventListener ( 'mousedown' , this . handleMouseDownOnce )
37
+ window . addEventListener ( 'keydown' , this . handleFirstTab )
38
+ }
44
39
45
- componentDidMount ( ) {
46
- window . addEventListener ( 'keydown' , this . handleFirstTab )
47
- }
40
+ componentDidMount ( ) {
41
+ window . addEventListener ( 'keydown' , this . handleFirstTab )
42
+ }
48
43
49
- render ( ) {
50
- const { title, canonical, description, ogImage, children } = this . props
44
+ render ( ) {
45
+ const { title, canonical, description, ogImage, children } = this . props
51
46
52
- return (
53
- < StaticQuery
54
- query = { graphql `
47
+ return (
48
+ < StaticQuery
49
+ query = { graphql `
55
50
query IndexLayoutQuery {
56
51
site {
57
52
siteMetadata {
@@ -62,75 +57,40 @@ class IndexLayout extends React.Component<{ title?: string; canonical?: string;
62
57
}
63
58
}
64
59
` }
65
- render = { ( data : StaticQueryProps ) => (
66
- < LayoutRoot >
67
- < Helmet >
68
- < html lang = "en" />
69
- < title > { ( title && `${ title } - Gitpod` ) || data . site . siteMetadata . title } </ title >
70
- < meta name = "description" content = { description || data . site . siteMetadata . description } />
71
- < meta
72
- name = "keywords"
73
- content = "dev environment, development environment, devops, cloud ide, github ide, gitlab ide, javascript, online ide, web ide, code review"
74
- />
75
- { canonical ? < link rel = "canonical" href = { `${ data . site . siteMetadata . siteUrl } ${ canonical } ` } /> : null }
76
- < link href = "https://fonts.googleapis.com/css?family=Montserrat:400,600& display = swap " rel = "stylesheet" />
77
- < meta name = "theme-color" content = { colors . white } />
78
- < link rel = "apple-touch-icon" type = "image/png" href = { GitpodIconApple } sizes = "180x180" />
79
- < link rel = "icon" type = "image/png" href = { GitpodIcon196 } sizes = "196x196" />
80
- < link rel = "icon" type = "image/svg+xml" href = { GitpodIcon } sizes = "any" />
60
+ render = { ( data : StaticQueryProps ) => (
61
+ < LayoutRoot >
62
+ < Helmet >
63
+ < html lang = "en" />
64
+ < title > { ( title && `${ title } - Gitpod` ) || data . site . siteMetadata . title } </ title >
65
+ < meta name = "description" content = { description || data . site . siteMetadata . description } />
66
+ < meta
67
+ name = "keywords"
68
+ content = "dev environment, development environment, devops, cloud ide, github ide, gitlab ide, javascript, online ide, web ide, code review"
69
+ />
70
+ { canonical ? < link rel = "canonical" href = { `${ data . site . siteMetadata . siteUrl } ${ canonical } ` } /> : null }
71
+ < link href = "/font.css" rel = "stylesheet" />
72
+ < link rel = "apple-touch-icon" type = "image/png" href = { GitpodIconApple } sizes = "180x180" />
73
+ < link rel = "icon" type = "image/png" href = { GitpodIcon196 } sizes = "196x196" />
74
+ < link rel = "icon" type = "image/svg+xml" href = { GitpodIcon } sizes = "any" />
81
75
82
- < meta name = "twitter:card" content = "summary" > </ meta >
83
- < meta name = "twitter:site" content = "@gitpod" > </ meta >
84
- < meta name = "twitter:creator" content = "@gitpod" > </ meta >
76
+ < meta name = "twitter:card" content = "summary" > </ meta >
77
+ < meta name = "twitter:site" content = "@gitpod" > </ meta >
78
+ < meta name = "twitter:creator" content = "@gitpod" > </ meta >
85
79
86
- < meta property = "og:url" content = { data . site . siteMetadata . siteUrl } />
87
- < meta property = "og:title" content = { title || data . site . siteMetadata . title } />
88
- < meta property = "og:description" content = { description || data . site . siteMetadata . description } />
89
- < meta property = "og:image" content = { ogImage || "https://www.gitpod.io/media-image.jpg" } />
80
+ < meta property = "og:url" content = { data . site . siteMetadata . siteUrl } />
81
+ < meta property = "og:title" content = { title || data . site . siteMetadata . title } />
82
+ < meta property = "og:description" content = { description || data . site . siteMetadata . description } />
83
+ < meta property = "og:image" content = { ogImage || "https://www.gitpod.io/media-image.jpg" } />
90
84
91
- < meta name = "google-site-verification" content = "NBio3hCkfn2FKJpqZritJpXuyKo54noPGZzWsjDIp-M" />
92
- </ Helmet >
93
- < AnnoucementBanner />
94
- < Nav isAFlowPage = { this . props . isAFlowPage } showReInstallExtensionButton = { this . props . showReInstallExtensionButton } />
95
- < LayoutMain >
96
- < CookieConsent
97
- buttonClasses = "primary"
98
- containerClasses = "consent"
99
- style = { {
100
- backgroundColor : colors . white ,
101
- color : colors . text ,
102
- borderTop : borders . light ,
103
- zIndex : '2000000000'
104
- } }
105
- contentStyle = { {
106
- backgroundColor : 'transparent' ,
107
- margin : '10px 15px'
108
- } }
109
- buttonStyle = { {
110
- backgroundColor : 'transparent' ,
111
- border : 'solid 1px ' + colors . text ,
112
- borderRadius : '100px' ,
113
- padding : '.8rem 2.2rem' ,
114
- margin : '10px 15px'
115
- } }
116
- >
117
- This website uses cookies to
118
- < br /> enhance the user experience.
119
- < br /> Read our{ ' ' }
120
- < Link style = { { color : '#35C9FF' } } to = "/privacy/" >
121
- privacy policy
122
- </ Link > { ' ' }
123
- for more info.
124
- </ CookieConsent >
125
- { children }
126
- </ LayoutMain >
127
- {
128
- ! this . props . isAFlowPage ? < Footer /> : < MinimalFooter />
129
- }
130
- </ LayoutRoot >
131
- ) }
132
- />
133
- )
134
- }
85
+ < meta name = "google-site-verification" content = "NBio3hCkfn2FKJpqZritJpXuyKo54noPGZzWsjDIp-M" />
86
+ </ Helmet >
87
+ < LayoutMain >
88
+ { children }
89
+ </ LayoutMain >
90
+ </ LayoutRoot >
91
+ ) }
92
+ />
93
+ )
94
+ }
135
95
}
136
96
export default IndexLayout
0 commit comments