From 832794e035705e7f0a5989ce240a385e5ccebf62 Mon Sep 17 00:00:00 2001
From: Kevin Hoerr <kjhoerr@protonmail.com>
Date: Mon, 28 Nov 2022 17:37:25 -0500
Subject: Reintegrate GraphQL (#23)

* Use GraphQL for site metadata incl version

* Explicit props for passthrough components
---
 src/components/Layout.tsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'src/components/Layout.tsx')

diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx
index 7be816f..4f93fec 100644
--- a/src/components/Layout.tsx
+++ b/src/components/Layout.tsx
@@ -1,14 +1,17 @@
 import React from "react";
 import { IconContext } from "react-icons/lib";
 import { Content, Footer } from "../styles";
-import package_json from "../../package.json";
+import { useSiteVersion } from "../hooks";
 import { getTimestamp } from "../util/timestamp";
 
 import "../styles/main.css";
 
-const VERSION = package_json.version;
+interface LayoutProps {
+  children: React.ReactNode;
+}
 
-const Layout = ({ children }) => {
+const Layout = ({ children }: LayoutProps) => {
+  const version = useSiteVersion();
   return (
     <React.StrictMode>
       <main>
@@ -20,7 +23,7 @@ const Layout = ({ children }) => {
           <Footer>
             <span>
               &copy;2022 kjhoerr@https://submelon.dev/:
-              {getTimestamp(Number(VERSION))}
+              {getTimestamp(Number(version))}
             </span>
           </Footer>
         </IconContext.Provider>
-- 
cgit 

