diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 3345a05a6..5ae1fc273 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -3,6 +3,7 @@ import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; import { ThemeProvider } from "@/components/theme-provider"; import { SiteHeader } from "@/components/site-header"; +import { SiteFooter } from "@/components/site-footer"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -37,7 +38,10 @@ export default function RootLayout({ disableTransitionOnChange > - {children} +
+ {children} + +
diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx index 16ef35846..ca3101058 100644 --- a/web/src/app/page.tsx +++ b/web/src/app/page.tsx @@ -1,54 +1,5 @@ -import Image from "next/image"; -import { FileJson2 } from "lucide-react"; -import CollinMBarrettIcon from "../assets/collinmbarrett-icon.png"; -import GitHubMark from "../assets/github-mark.svg"; - export default function Home() { return ( -
-
- -
+
); } diff --git a/web/src/assets/collinmbarrett-icon-dark.png b/web/src/assets/collinmbarrett-icon-dark.png new file mode 100644 index 000000000..1b144b831 Binary files /dev/null and b/web/src/assets/collinmbarrett-icon-dark.png differ diff --git a/web/src/assets/collinmbarrett-icon-light.png b/web/src/assets/collinmbarrett-icon-light.png new file mode 100644 index 000000000..3b8563b5e Binary files /dev/null and b/web/src/assets/collinmbarrett-icon-light.png differ diff --git a/web/src/assets/collinmbarrett-icon-white.png b/web/src/assets/collinmbarrett-icon-white.png deleted file mode 100644 index 8827c5e37..000000000 Binary files a/web/src/assets/collinmbarrett-icon-white.png and /dev/null differ diff --git a/web/src/assets/collinmbarrett-icon.png b/web/src/assets/collinmbarrett-icon.png deleted file mode 100644 index 1300e19c8..000000000 Binary files a/web/src/assets/collinmbarrett-icon.png and /dev/null differ diff --git a/web/src/assets/github-mark-white.svg b/web/src/assets/github-mark-dark.svg similarity index 100% rename from web/src/assets/github-mark-white.svg rename to web/src/assets/github-mark-dark.svg diff --git a/web/src/assets/github-mark.svg b/web/src/assets/github-mark-light.svg similarity index 100% rename from web/src/assets/github-mark.svg rename to web/src/assets/github-mark-light.svg diff --git a/web/src/components/site-footer.tsx b/web/src/components/site-footer.tsx new file mode 100644 index 000000000..48b15be43 --- /dev/null +++ b/web/src/components/site-footer.tsx @@ -0,0 +1,54 @@ +import { FileJson2 } from "lucide-react"; +import CollinMBarrettIconLight from "../assets/collinmbarrett-icon-light.png"; +import CollinMBarrettIconDark from "../assets/collinmbarrett-icon-dark.png"; +import GitHubMarkLight from "../assets/github-mark-light.svg"; +import GitHubMarkDark from "../assets/github-mark-dark.svg"; +import { ThemeImage } from "@/components/theme-image"; + +export function SiteFooter() { + return ( + + ); +} diff --git a/web/src/components/site-header.tsx b/web/src/components/site-header.tsx index 4cc6711e3..113d6a888 100644 --- a/web/src/components/site-header.tsx +++ b/web/src/components/site-header.tsx @@ -1,5 +1,3 @@ -"use client"; - import { ThemeModeToggle } from "./theme-mode-toggle"; export function SiteHeader() { diff --git a/web/src/components/theme-image.tsx b/web/src/components/theme-image.tsx new file mode 100644 index 000000000..5acf6444a --- /dev/null +++ b/web/src/components/theme-image.tsx @@ -0,0 +1,33 @@ +"use client"; + +import { useState, useEffect } from "react"; +import Image, { type ImageProps, type StaticImageData } from "next/image"; +import { useTheme } from "next-themes"; + +type ThemedImageProps = Omit & { + srcLight: string | StaticImageData; + srcDark: string | StaticImageData; + alt: string; +}; + +export function ThemeImage({ + srcLight, + srcDark, + alt, + ...props +}: ThemedImageProps) { + const { resolvedTheme } = useTheme(); + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + }, []); + + const src = resolvedTheme === "dark" ? srcDark : srcLight; + + if (!mounted) { + return {alt}; + } + + return {alt}; +}