aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/Layout.tsx
diff options
context:
space:
mode:
authorKevin Hoerr <kjhoerr@protonmail.com>2022-11-28 17:37:25 -0500
committerGitHub <noreply@github.com>2022-11-28 17:37:25 -0500
commit832794e035705e7f0a5989ce240a385e5ccebf62 (patch)
treeed836a8473688545e93270f25697433e77feba20 /src/components/Layout.tsx
parent73736f0873017967e78538d42fcfabb60ba8b4a2 (diff)
downloadsubmelon.dev-832794e035705e7f0a5989ce240a385e5ccebf62.tar.gz
submelon.dev-832794e035705e7f0a5989ce240a385e5ccebf62.tar.bz2
submelon.dev-832794e035705e7f0a5989ce240a385e5ccebf62.zip
Reintegrate GraphQL (#23)
* Use GraphQL for site metadata incl version * Explicit props for passthrough components
Diffstat (limited to 'src/components/Layout.tsx')
-rw-r--r--src/components/Layout.tsx11
1 files changed, 7 insertions, 4 deletions
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>