Commit 6ef0cac
authored
offers-page-list-view-switch (#906)
<!--
Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md
-->
<!-- RECURSEML_SUMMARY:START -->
## High-level PR Summary
This PR adds a toggle switch feature for the payments offers page,
allowing users to switch between two different view modes: a catalog
view (card-based layout) and a list view. The original code from
`page-client.tsx` has been split into two separate files -
`page-client-catalogs-view.tsx` for the existing card-based catalog view
and `page-client-list-view.tsx` for the new list-based view. The main
`page-client.tsx` file now acts as a simple router between these two
views, maintaining a view state and rendering the appropriate component
based on the selected view. Both view components include a toggle switch
in their header to allow users to switch between views.
⏱️ Estimated Review Time: 15-30 minutes
<details>
<summary>💡 Review Order Suggestion</summary>
| Order | File Path |
|-------|-----------|
| 1 |
`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers/page-client.tsx`
|
| 2 |
`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers/page-client-catalogs-view.tsx`
|
| 3 |
`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers/page-client-list-view.tsx`
|
</details>
<!-- RECURSEML_SUMMARY:END -->
<!-- RECURSEML_ANALYSIS:START -->
## Review by RecurseML
_🔍 Review performed on
[872174d..a5ad8d9](872174d...a5ad8d9fd1b92fffa4da77a40b32657be9e40a89)_
✨ No bugs found, your code is sparkling clean
<details>
<summary>✅ Files analyzed, no issues (3)</summary>
•
`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers/page-client-catalogs-view.tsx`
•
`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers/page-client-list-view.tsx`
•
`apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers/page-client.tsx`
</details>
[](https://discord.gg/n3SsVDAW6U)
<!-- RECURSEML_ANALYSIS:END -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- New Features
- Added revamped Payments Offers management with two views: List and
Catalogs.
- Grouping and sorting of offers by customer type, addons, and price.
- Inline create/edit/duplicate/delete for offers, prices, and items with
dialogs and validations.
- Search, filters, and hover-based highlighting with visual connections
between offers and items.
- Responsive layout (desktop and mobile), tooltips, and helpful
empty-state onboarding.
- Refactor
- Simplified page into dedicated List and Catalogs views with seamless
switching for a clearer, faster experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 872174d commit 6ef0cac
3 files changed
Lines changed: 2541 additions & 1566 deletions
File tree
- apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/payments/offers
0 commit comments