feat: Dynamically Link back to the Goose homepage from the extensions site (#953)

This commit is contained in:
nick-w-nick
2025-02-11 10:28:08 -05:00
committed by GitHub
parent 48c93213f4
commit 01aeeaf413
2 changed files with 9 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import { IconDownload } from "./icons/download";
import { IconGoose } from "./icons/goose"; import { IconGoose } from "./icons/goose";
import { ThemeToggle } from "./themeToggle"; import { ThemeToggle } from "./themeToggle";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { SiteURLs } from '../constants';
import { NavLink, useLocation } from "react-router"; import { NavLink, useLocation } from "react-router";
export const Header = () => { export const Header = () => {
@@ -10,10 +11,13 @@ export const Header = () => {
const stableDownload = "https://github.com/block/goose/releases/download/stable/Goose.zip"; const stableDownload = "https://github.com/block/goose/releases/download/stable/Goose.zip";
// link back to the main site if the icon is clicked on the extensions homepage
// otherwise link back to the extensions homepage
const gooseIconLink = pathname === "/" ? SiteURLs.GOOSE_HOMEPAGE : "/";
return ( return (
<div className="bg-bgApp container mx-auto border-borderSubtle py-16"> <div className="bg-bgApp container mx-auto border-borderSubtle py-16">
<div className="h-full flex justify-between items-center"> <div className="h-full flex justify-between items-center">
<NavLink to="/" className="text-textProminent"> <NavLink to={gooseIconLink} className="text-textProminent">
<IconGoose /> <IconGoose />
</NavLink> </NavLink>
<div className="w-auto items-center flex"> <div className="w-auto items-center flex">

View File

@@ -0,0 +1,3 @@
export const SiteURLs = {
GOOSE_HOMEPAGE: "https://block.github.io/goose/",
};