Skip to content

Commit d038085

Browse files
committed
add RR pages
1 parent c4b2c7b commit d038085

File tree

99 files changed

+838
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+838
-149
lines changed

apps/test-react-router-rsc/app/root.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { isRouteErrorResponse, Links, Meta, Outlet, ScrollRestoration } from 'react-router';
1+
import {
2+
isRouteErrorResponse,
3+
Links,
4+
Meta,
5+
NavLink,
6+
Outlet,
7+
ScrollRestoration,
8+
} from 'react-router';
9+
import { primitives } from '@repo/test-registry';
210
import type { Route } from './+types/root';
311
import './globals.css';
412

@@ -25,7 +33,25 @@ export function Layout({ children }: { children: React.ReactNode }) {
2533
<Links />
2634
</head>
2735
<body>
28-
{children}
36+
<h1>React Router RSC testing</h1>
37+
<div style={{ display: 'flex', gap: '10em' }}>
38+
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.5em' }}>
39+
<h2>Public APIs</h2>
40+
{primitives.public.map((primitive) => (
41+
<NavLink key={primitive.id} to={`/${primitive.id}`}>
42+
{primitive.name}
43+
</NavLink>
44+
))}
45+
<hr />
46+
<h2>Internal APIs</h2>
47+
{primitives.internal.map((primitive) => (
48+
<NavLink key={primitive.id} to={`/${primitive.id}`}>
49+
{primitive.name}
50+
</NavLink>
51+
))}
52+
</div>
53+
<div>{children}</div>
54+
</div>
2955
<ScrollRestoration />
3056
</body>
3157
</html>
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
import { type RouteConfig, index } from "@react-router/dev/routes";
1+
import { type RouteConfig, index, route } from '@react-router/dev/routes';
2+
import { primitives } from '@repo/test-registry';
23

3-
export default [index("routes/home.tsx")] satisfies RouteConfig;
4+
export default [
5+
index('routes/page.tsx'),
6+
// Public APIs
7+
...primitives.public.map((primitive) => route(primitive.id, `routes/${primitive.id}/page.tsx`)),
8+
// Internal APIs
9+
...primitives.internal.map((primitive) => route(primitive.id, `routes/${primitive.id}/page.tsx`)),
10+
] satisfies RouteConfig;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as AccessibleIcon from '@repo/test-registry/components/accessible-icon';
2+
3+
export default function Page() {
4+
return <AccessibleIcon.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Accordion from '@repo/test-registry/components/accordion';
2+
3+
export default function Page() {
4+
return <Accordion.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as AlertDialog from '@repo/test-registry/components/alert-dialog';
2+
3+
export default function Page() {
4+
return <AlertDialog.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Arrow from '@repo/test-registry/components/arrow';
2+
3+
export default function Page() {
4+
return <Arrow.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as AspectRatio from '@repo/test-registry/components/aspect-ratio';
2+
3+
export default function Page() {
4+
return <AspectRatio.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Avatar from '@repo/test-registry/components/avatar';
2+
3+
export default function Page() {
4+
return <Avatar.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Checkbox from '@repo/test-registry/components/checkbox';
2+
3+
export default function Page() {
4+
return <Checkbox.Basic />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Collapsible from '@repo/test-registry/components/collapsible';
2+
3+
export default function Page() {
4+
return <Collapsible.Basic />;
5+
}

0 commit comments

Comments
 (0)