diff --git a/src/components/nav/NavActions.tsx b/src/components/nav/NavActions.tsx index 64e8ac8..73df885 100644 --- a/src/components/nav/NavActions.tsx +++ b/src/components/nav/NavActions.tsx @@ -1,11 +1,18 @@ "use client"; import { EditorAboutDropdown } from "@/components/nav/EditorAboutDropdown"; +import { IconButton } from "@/components/ui/IconButton"; import { ThemeToggle } from "@/components/ui/ThemeToggle"; +import { GitHubIcon } from "@/icons/GitHubIcon"; + +const REPO_URL = "https://github.com/EarthyScience/EarthPrints"; export function NavActions() { return (
+ + +
diff --git a/src/components/ui/IconButton.tsx b/src/components/ui/IconButton.tsx index 53e034b..aa993dd 100644 --- a/src/components/ui/IconButton.tsx +++ b/src/components/ui/IconButton.tsx @@ -5,6 +5,8 @@ type IconButtonProps = { "aria-label": string; "aria-expanded"?: boolean; "aria-controls"?: string; + /** When set, renders an anchor to this URL instead of a button. */ + href?: string; }; // Every IconButton renders inside the editor nav, so the editor sizing/colour @@ -21,11 +23,29 @@ export function IconButton({ "aria-label": ariaLabel, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, + href, }: IconButtonProps) { + const classes = [ICON_BUTTON_CLASS, className].filter(Boolean).join(" "); + + if (href) { + return ( + + {children} + + ); + } + return (