-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-ssr.js
87 lines (75 loc) · 2.35 KB
/
gatsby-ssr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
*
* See: https://www.gatsbyjs.com/docs/ssr-apis/
*/
// You can delete this file if you're not using it
import React from "react"
import { FirebaseAppProvider } from "reactfire"
import "firebase/firestore"
const firebaseConfig = {
apiKey: process.env.GATSBY_FIREBASE_API,
authDomain: "lucferbux-web-page.firebaseapp.com",
databaseURL: "https://lucferbux-web-page.firebaseio.com",
projectId: "lucferbux-web-page",
storageBucket: "lucferbux-web-page.appspot.com",
messagingSenderId: "304684761756",
appId: "1:304684761756:web:9b9b520ab849a3b554e359",
measurementId: "G-MEASUREMENT_ID",
}
export const wrapRootElement = ({ element }) => {
if (typeof window === "undefined") return <p></p>
return (
<FirebaseAppProvider firebaseConfig={firebaseConfig}>
{element}
</FirebaseAppProvider>
)
}
export const onRenderBody = ({ setPreBodyComponents }) => {
setPreBodyComponents([
<noscript key="noscript">
<style>
{`
html {
height: 100%;
}
body {
background: linear-gradient(180deg, #c98c31 0%, #eabe7d 100%) !important;
height: 100%;
margin: 0;
background-repeat: no-repeat;
background-attachment: fixed;
}
.no-script {
max-width: 1234px;
margin: 0 auto;
padding: 200px 30px;
display: grid;
text-align: center;
justify-item: center;
}
.title-fallback{
color: #fff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-clip: text;
-webkit-background-clip: text;
font-weight: bold;
font-size: 50px;
@media (max-width: 450px) {
font-size: 48px;
}
}
.description-fallback {
font-size: 22px;
line-height: 130%;
color: #fff;
}
`}
</style>
<div className="no-script">
<h1 className="title-fallback">Please, enable javascript</h1>
<p className="description-fallback">This page need javascript to run, it doesn't collect any usage nor navigation, please, enable javascript</p>
</div>
</noscript>,
])
}