File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { useStaticQuery , graphql } from 'gatsby' ;
2
+
3
+ export default function useSite ( ) {
4
+ const data = useStaticQuery ( graphql `
5
+ {
6
+ site {
7
+ siteMetadata {
8
+ userLogo
9
+ }
10
+ }
11
+ }
12
+ ` ) ;
13
+ return data ?. site ?. siteMetadata || { } ;
14
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { navigate } from 'gatsby';
4
4
import { HelmetProvider , Helmet } from 'react-helmet-async' ;
5
5
6
6
import useRgd from '@hooks/useRgd' ;
7
+ import useSite from '@hooks/useSite' ;
7
8
import useRepoLink from '@hooks/useRepoLink' ;
8
9
import Logo from '@comps/logo' ;
9
10
import Nav from '@comps/nav' ;
@@ -19,6 +20,7 @@ interface LayoutProps {
19
20
20
21
export default function Layout ( props : LayoutProps ) {
21
22
const data = useRgd ( ) ;
23
+ const siteData = useSite ( ) ;
22
24
const { siteRepo } = useRepoLink ( ) ;
23
25
24
26
return (
@@ -32,7 +34,7 @@ export default function Layout(props: LayoutProps) {
32
34
</ Helmet >
33
35
< div className = { clsx ( 'gg-container' , props . className ) } >
34
36
< header >
35
- { ! data . userLogo ? (
37
+ { ! siteData ? .userLogo ? (
36
38
< Logo onClick = { ( ) => navigate ( `/` ) } color = "var(--gg-logo)" />
37
39
) : (
38
40
< img
You can’t perform that action at this time.
0 commit comments