Skip to content

Commit

Permalink
Show embedded version in about page.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Souther committed Dec 3, 2024
1 parent 7d0cea7 commit 9c7a1d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_192.png" />
<meta name="theme-color" content="rgb(16, 149, 193)" />
<link rel="stylesheet" href="%PUBLIC_URL%/root.css" />
<meta name="version" content="2024.49.0" />
</head>
<body class="flex">
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
12 changes: 12 additions & 0 deletions web/src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import raw from "raw.macro";
import Markdown from "../shell/markdown";

const VERSION =
document.querySelector("meta[name=version]")?.getAttribute("content") ??
"unknown";

const useVersion = () => {
return VERSION;
};

export const About = () => {
const version = useVersion();
return (
<div style={{ overflowY: "scroll" }}>
<div className="container">
<Markdown>{raw("./ABOUT.md")}</Markdown>
<p>
<b>Version</b> <code>{version}</code>
</p>
</div>
</div>
);
Expand Down

0 comments on commit 9c7a1d7

Please sign in to comment.