Skip to content

Commit

Permalink
Footer shows build hash, branch, and time
Browse files Browse the repository at this point in the history
  • Loading branch information
UnsignedArduino committed Mar 17, 2024
1 parent d9a6cfd commit 4a68127
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
24 changes: 23 additions & 1 deletion src/components/Footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import Image from "next/image";
import { appName } from "@/components/Layout/layout";
import icon from "../../../public/android-chrome-512x512.png";
import { AppProps } from "@/components/WithAppProps";
import { formatDateLong } from "@/scripts/Utils/DateAndTime/Format";
import {
formatDateAndTime,
formatDateLong,
} from "@/scripts/Utils/DateAndTime/Format";

export const DEVELOPERS = ["UnsignedArduino"];
export const CREATION_DATE = new Date("2023-04-15T02:00:20Z");
Expand Down Expand Up @@ -113,6 +116,25 @@ function Footer({ appProps }: { appProps: AppProps }): JSX.Element {
owner of MakeCode Arcade. <br />
Microsoft and MakeCode Arcade are trademarks of the Microsoft group of
companies.
<br />
<br />
Build{" "}
<a
href={`https://github.com/UnsignedArduino/Awesome-Arcade/commit/${appProps.buildHash}`}
target="_blank"
rel="noopener noreferrer"
>
<code>{appProps.buildHash}</code>
</a>{" "}
(branch{" "}
<a
href={`https://github.com/UnsignedArduino/Awesome-Arcade/tree/${appProps.buildBranch}`}
target="_blank"
rel="noopener noreferrer"
>
<code>{appProps.buildBranch}</code>
</a>
) on {formatDateAndTime(new Date(appProps.buildTime))}.
</>
);

Expand Down
19 changes: 19 additions & 0 deletions src/components/TextCountFromDate/Static.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { formatDuration } from "@/scripts/Utils/DateAndTime/Format";
import React from "react";

export function StaticLowPrecisionTextCountup({
date,
}: {
date: Date;
}): React.ReactNode {
const [show, setShow] = React.useState(false);
const timeSince = Date.now() - date.getTime();

React.useEffect(() => {
setShow(true);
}, []);

return (
<>{show ? (timeSince > 0 ? formatDuration(timeSince) : null) : null}</>
);
}
18 changes: 16 additions & 2 deletions src/pages/_environment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@ export function About({ envVars, appProps }: AboutProps): JSX.Element {
<Layout title={pageName} currentPage={pageName} appProps={appProps}>
<h1>Environment</h1>
<p>
Build hash: <code>{appProps.buildHash}</code>
Build hash:{" "}
<a
href={`https://github.com/UnsignedArduino/Awesome-Arcade/commit/${appProps.buildHash}`}
target="_blank"
rel="noopener noreferrer"
>
<code>{appProps.buildHash}</code>
</a>
<br />
Build branch: <code>{appProps.buildBranch}</code>
Build branch:{" "}
<a
href={`https://github.com/UnsignedArduino/Awesome-Arcade/tree/${appProps.buildBranch}`}
target="_blank"
rel="noopener noreferrer"
>
<code>{appProps.buildBranch}</code>
</a>
<br />
Build time: <code>{appProps.buildTime}</code> (
{formatDateAndTimeAndSecond(new Date(appProps.buildTime))} -{" "}
Expand Down

0 comments on commit 4a68127

Please sign in to comment.