-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-browser.js
37 lines (34 loc) · 897 Bytes
/
gatsby-browser.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
import React from "react"
import AudioPlayer from "./src/components/audioPlayer"
import AudioPlayerProvider from "./src/context/audioPlayerContext"
import Theme, { defaultTheme } from "./src/context/themeContext"
import pathOr from "./src/utils/pathOr"
export const wrapPageElement = ({ element, props }, options) => {
const {
color_sitio,
color_navegacion,
color_navegacion_hover,
color_fondo,
color_letra,
color_links,
color_links_hover,
} = pathOr(defaultTheme, ["data", "markdownRemark", "frontmatter"], props)
return (
<Theme
overrideTheme={{
color_sitio,
color_navegacion,
color_navegacion_hover,
color_fondo,
color_letra,
color_links,
color_links_hover,
}}
>
<AudioPlayerProvider>
{element}
<AudioPlayer />
</AudioPlayerProvider>
</Theme>
)
}