Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11,841 changes: 11,841 additions & 0 deletions js/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion js/src/app/providers/QueryProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { queryClient } from "@/lib/api/queryClient";
import { QueryClientProvider } from "@tanstack/react-query";
import { ReactNode } from "react";

import { queryClient } from "@/lib/api/queryClient";

Check failure on line 4 in js/src/app/providers/QueryProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react" and "@/lib/api/queryClient" objects

Check failure on line 4 in js/src/app/providers/QueryProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/lib/api/queryClient" to come before "react"

Check failure on line 4 in js/src/app/providers/QueryProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react" and "@/lib/api/queryClient" objects

Check failure on line 4 in js/src/app/providers/QueryProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/lib/api/queryClient" to come before "react"

export default function QueryProvider({ children }: { children: ReactNode }) {
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
Expand Down
3 changes: 2 additions & 1 deletion js/src/app/router/guards/RequireAdmin.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useSession } from "@/lib/api/useSession";
import { Navigate, Outlet } from "react-router-dom";

import { useSession } from "@/lib/api/useSession";

Check failure on line 3 in js/src/app/router/guards/RequireAdmin.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react-router-dom" and "@/lib/api/useSession" objects

Check failure on line 3 in js/src/app/router/guards/RequireAdmin.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/lib/api/useSession" to come before "react-router-dom"

Check failure on line 3 in js/src/app/router/guards/RequireAdmin.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react-router-dom" and "@/lib/api/useSession" objects

Check failure on line 3 in js/src/app/router/guards/RequireAdmin.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/lib/api/useSession" to come before "react-router-dom"

/**
* Route guard: render the nested routes only for an admin. Assumes it is nested
* under RequireAuth, so the session is already resolved here; non-admins are sent
Expand Down
3 changes: 2 additions & 1 deletion js/src/app/router/guards/RequireAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useSession } from "@/lib/api/useSession";
import { Center, Loader } from "@mantine/core";
import { Navigate, Outlet } from "react-router-dom";

import { useSession } from "@/lib/api/useSession";

Check failure on line 4 in js/src/app/router/guards/RequireAuth.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react-router-dom" and "@/lib/api/useSession" objects

Check failure on line 4 in js/src/app/router/guards/RequireAuth.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/lib/api/useSession" to come before "react-router-dom"

Check failure on line 4 in js/src/app/router/guards/RequireAuth.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react-router-dom" and "@/lib/api/useSession" objects

Check failure on line 4 in js/src/app/router/guards/RequireAuth.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/lib/api/useSession" to come before "react-router-dom"

/**
* Route guard: render the nested routes only for an authenticated user.
* While the session is loading, show a spinner; if there is no session, redirect
Expand Down
9 changes: 7 additions & 2 deletions js/src/app/router/router.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { createBrowserRouter } from "react-router-dom";

import { AdminLayout } from "@/app/layouts/AdminLayout";

Check failure on line 3 in js/src/app/router/router.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react-router-dom" and "@/app/layouts/AdminLayout" objects

Check failure on line 3 in js/src/app/router/router.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/app/layouts/AdminLayout" to come before "react-router-dom"

Check failure on line 3 in js/src/app/router/router.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Extra spacing between "react-router-dom" and "@/app/layouts/AdminLayout" objects

Check failure on line 3 in js/src/app/router/router.tsx

View workflow job for this annotation

GitHub Actions / frontend-pretest

Expected "@/app/layouts/AdminLayout" to come before "react-router-dom"
import { AppLayout } from "@/app/layouts/AppLayout";
import { PublicLayout } from "@/app/layouts/PublicLayout";
import { RequireAdmin } from "@/app/router/guards/RequireAdmin";
import { RequireAuth } from "@/app/router/guards/RequireAuth";
import HomePage from "@/features/home/Home.page";
import IntakePage from "@/features/intake/intake.page";
import SamplePage from "@/features/sample/Sample.page";
import SampleAdminPage from "@/features/sample/SampleAdmin.page";
import { createBrowserRouter } from "react-router-dom";

export const router = createBrowserRouter([
// Public: no guard, public chrome.
{
element: <PublicLayout />,
children: [{ index: true, element: <HomePage /> }],
children: [
{ index: true, element: <HomePage /> },
{ path: "intake", element: <IntakePage /> },
],
},

// Authenticated: guard -> layout -> page. Admin nests a second guard + layout.
Expand Down
3 changes: 3 additions & 0 deletions js/src/features/home/Home.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export default function HomePage() {
<Text>
Monthly one-on-one coffee chat pairings for the Patina Network.
</Text>
<Anchor component={Link} to="/intake">
Complete the intake form
</Anchor>
<Anchor component={Link} to="/sample">
Go to the app
</Anchor>
Expand Down
Loading