mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 14:44:21 +01:00
feat: Dynamically Link back to the Goose homepage from the extensions site (#953)
This commit is contained in:
@@ -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 = () => {
|
||||||
@@ -9,11 +10,14 @@ export const Header = () => {
|
|||||||
const { hash, pathname, search } = location;
|
const { hash, pathname, search } = location;
|
||||||
|
|
||||||
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">
|
||||||
|
|||||||
3
extensions-site/app/constants.ts
Normal file
3
extensions-site/app/constants.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const SiteURLs = {
|
||||||
|
GOOSE_HOMEPAGE: "https://block.github.io/goose/",
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user