Skip to content

Commit

Permalink
feat: Display system status link on settings page (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker authored Sep 12, 2024
1 parent 324fd2d commit 99aef0d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-eagles-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"namesake": patch
---

Add link to system status from settings page
14 changes: 11 additions & 3 deletions src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AppHeader } from "../components";

declare module "react-aria-components" {
interface RouterConfig {
href: ToOptions;
href: ToOptions | string;
routerOptions: Omit<NavigateOptions, keyof ToOptions>;
}
}
Expand All @@ -29,9 +29,17 @@ function RootRoute() {
const router = useRouter();

return (
// TODO: Improve this API
// https://github.com/adobe/react-spectrum/issues/6587
<RouterProvider
navigate={(path, options) => router.navigate({ ...path, ...options })}
useHref={(path) => router.buildLocation(path).href}
navigate={(path, options) =>
router.navigate(
typeof path === "string" ? { ...options } : { ...path, ...options },
)
}
useHref={(path) =>
typeof path === "string" ? path : router.buildLocation(path).href
}
>
<main className="flex flex-col flex-1 min-h-screen text-gray-normal">
<AppHeader />
Expand Down
9 changes: 2 additions & 7 deletions src/routes/admin/forms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,8 @@ const FormTableRow = ({ form }: { form: DataModel["forms"]["document"] }) => {
</Button>
<Menu>
{formUrl && (
<MenuItem>
{/* TODO: Relocate this `href` to parent MenuItem and delete `a`;
requires react-aria-components to support external links
https://github.com/adobe/react-spectrum/issues/6397 */}
<a href={formUrl} target="_blank" rel="noreferrer">
View PDF
</a>
<MenuItem href={formUrl} target="_blank" rel="noreferrer">
View PDF
</MenuItem>
)}
{form.deletionTime ? (
Expand Down
21 changes: 15 additions & 6 deletions src/routes/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Theme } from "../../../convex/constants";
import {
Button,
Container,
Link,
Modal,
PageHeader,
Radio,
Expand Down Expand Up @@ -155,12 +156,20 @@ function SettingsRoute() {
</Modal>
</div>
)}
<a
href={`https://github.com/namesakefyi/namesake/releases/tag/v${APP_VERSION}`}
target="_blank"
rel="noreferrer"
className="inline-block mt-4"
>{`Namesake v${APP_VERSION}`}</a>
<div className="flex gap-2 items-center mt-4">
<Link
href="https://github.com/namesakefyi/namesake/releases"
target="_blank"
rel="noreferrer"
>{`Namesake v${APP_VERSION}`}</Link>
<Link
href="https://status.namesake.fyi"
target="_blank"
rel="noreferrer"
>
System Status
</Link>
</div>
</Container>
);
}

0 comments on commit 99aef0d

Please sign in to comment.