aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/Layout.tsx
diff options
context:
space:
mode:
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>