-
Notifications
You must be signed in to change notification settings - Fork 2
feat(web): add canonical private routes #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
...web/src/app/(shopper)/buyer/cart/page.tsx → apps/web/src/app/(app)/cart/page.tsx
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
...pper)/buyer/checkout/[productId]/page.tsx → ...c/app/(app)/checkout/[productId]/page.tsx
This file contains hidden or 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 hidden or 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,26 @@ | ||
| import type { Metadata } from "next"; | ||
| import { FeedClient } from "@/components/feed/FeedClient"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Home | twizrr", | ||
| description: | ||
| "Your personalised feed of products and posts from stores you follow on twizrr.", | ||
| }; | ||
|
|
||
| export default function HomePage() { | ||
| return ( | ||
| <> | ||
| <section className="border-b border-[var(--border)] px-4 py-5 sm:px-6"> | ||
| <h1 className="font-cabinet text-xl font-bold text-[var(--color-espresso)]"> | ||
| Home | ||
| </h1> | ||
| </section> | ||
|
|
||
| <FeedClient | ||
| defaultTab="for-you" | ||
| isAuthenticated={true} | ||
| loginRedirect="/home" | ||
| /> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or 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,6 @@ | ||
| import type { ReactNode } from "react"; | ||
| import { ShopperShell } from "@/app/(shopper)/buyer/_components/ShopperShell"; | ||
|
|
||
| export default function AppRouteLayout({ children }: { children: ReactNode }) { | ||
| return <ShopperShell>{children}</ShopperShell>; | ||
| } |
This file contains hidden or 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,18 @@ | ||
| import type { Metadata } from "next"; | ||
| import { EmptyState } from "@/components/ui/State"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Chats | twizrr", | ||
| robots: { index: false, follow: false }, | ||
| }; | ||
|
|
||
| export default function MessagesPage() { | ||
| return ( | ||
| <section className="px-4 py-10 sm:px-6"> | ||
| <EmptyState | ||
| title="Chats are coming soon" | ||
| description="Store and shopper conversations will appear here when chat is available." | ||
| /> | ||
| </section> | ||
| ); | ||
| } |
This file contains hidden or 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,18 @@ | ||
| import type { Metadata } from "next"; | ||
| import { EmptyState } from "@/components/ui/State"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Notifications | twizrr", | ||
| robots: { index: false, follow: false }, | ||
| }; | ||
|
|
||
| export default function NotificationsPage() { | ||
| return ( | ||
| <section className="px-4 py-10 sm:px-6"> | ||
| <EmptyState | ||
| title="No notifications yet" | ||
| description="Order updates, store activity, and important account alerts will appear here." | ||
| /> | ||
| </section> | ||
| ); | ||
| } |
4 changes: 2 additions & 2 deletions
4
.../app/(shopper)/buyer/orders/[id]/page.tsx → apps/web/src/app/(app)/orders/[id]/page.tsx
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
...buyer/orders/confirmed/[orderId]/page.tsx → ...(app)/orders/confirmed/[orderId]/page.tsx
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
...b/src/app/(shopper)/buyer/orders/page.tsx → apps/web/src/app/(app)/orders/page.tsx
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
...eb/src/app/(shopper)/buyer/saved/page.tsx → apps/web/src/app/(app)/saved/page.tsx
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
...src/app/(shopper)/buyer/wishlist/page.tsx → apps/web/src/app/(app)/wishlist/page.tsx
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the middleware example to match the shared route policy.
The protected-route snippet still only covers
/home,/cart,/orders, and/store/, so anyone copying it will miss/checkout,/wishlist,/saved,/messages,/notifications, and/settings/*. At this point it would be safer to referenceapps/web/src/lib/route-policy.tsdirectly instead of duplicating prefix lists here.🤖 Prompt for AI Agents