-
-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(examples): validation of layout route functionality by running e…
…2e testing on the basic examples (#2042) * chore: unify the layout ui across all the basic examples * chore: more unification * test(examples): e2e validation of layout routes
- Loading branch information
1 parent
3b9976d
commit 3f6ffa5
Showing
33 changed files
with
678 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Outlet, createFileRoute } from '@tanstack/react-router' | ||
|
||
export const Route = createFileRoute('/_layout')({ | ||
component: LayoutComponent, | ||
}) | ||
|
||
function LayoutComponent() { | ||
return ( | ||
<div className="p-2"> | ||
<div className="border-b">I'm a layout</div> | ||
<div> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
) | ||
} |
34 changes: 34 additions & 0 deletions
34
examples/react/basic-file-based/src/routes/_layout/_layout-2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Link, Outlet, createFileRoute } from '@tanstack/react-router' | ||
|
||
export const Route = createFileRoute('/_layout/_layout-2')({ | ||
component: LayoutComponent, | ||
}) | ||
|
||
function LayoutComponent() { | ||
return ( | ||
<div> | ||
<div>I'm a nested layout</div> | ||
<div className="flex gap-2 border-b"> | ||
<Link | ||
to="/layout-a" | ||
activeProps={{ | ||
className: 'font-bold', | ||
}} | ||
> | ||
Layout A | ||
</Link> | ||
<Link | ||
to="/layout-b" | ||
activeProps={{ | ||
className: 'font-bold', | ||
}} | ||
> | ||
Layout B | ||
</Link> | ||
</div> | ||
<div> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/react/basic-file-based/src/routes/_layout/_layout-2/layout-a.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createFileRoute } from '@tanstack/react-router' | ||
|
||
export const Route = createFileRoute('/_layout/_layout-2/layout-a')({ | ||
component: LayoutAComponent, | ||
}) | ||
|
||
function LayoutAComponent() { | ||
return <div>I'm layout A!</div> | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/react/basic-file-based/src/routes/_layout/_layout-2/layout-b.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createFileRoute } from '@tanstack/react-router' | ||
|
||
export const Route = createFileRoute('/_layout/_layout-2/layout-b')({ | ||
component: LayoutBComponent, | ||
}) | ||
|
||
function LayoutBComponent() { | ||
return <div>I'm layout B!</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.