Skip to content

Conversation

@robinnedergard
Copy link
Owner

@robinnedergard robinnedergard commented Dec 1, 2025

Note

Modularizes the app with a new shared layout and centralized routing, adds a Cart context/hooks with header sidebar UI, updates pages to consume it, and configures path aliases with new tests.

  • Architecture:
    • Layout: Add components/layout/Layout with Header and cart sidebar; remove components/PageContainer usage across pages.
    • Routing: Centralize routes in routes.tsx; App renders <Routes> via AppRoutes and wraps each route with Layout.
    • State Management: Introduce CartContext (contexts/cart/*) and useCart hook; migrate all cart logic from App to provider. Split auth into contexts/auth/* with useAuth hook.
  • UI/Pages:
    • Add cart sidebar components (CartSidebar, CartItemsList, CartSummary, etc.) and header controls (CartInfo, CartToggleButton, AuthSection).
    • Update ProductsPage, ProductPage, CheckoutPage, CheckoutSuccessPage, UserOrdersPage, LoginPage, RegisterPage to use hooks/context and new layout; clear cart on checkout success. Extract pages/HomePage.
  • Utilities/Types:
    • Add utils/constants (currency, shipping config, perks) and shared types in types.
  • Tooling:
    • Configure path aliases (#src, #test) in tsconfig* and vite.config.ts; update imports accordingly.
  • Tests:
    • Add tests for EmptyState, ErrorMessage, LoadingState, ProtectedRoute, StarRating, and useCart; update test/App.test.tsx to use aliases.

Written by Cursor Bugbot for commit 533d505. This will update automatically on new commits. Configure here.

@robinnedergard robinnedergard self-assigned this Dec 1, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@robinnedergard robinnedergard merged commit 48eaf8b into main Dec 1, 2025
6 checks passed
@robinnedergard robinnedergard deleted the refactoring branch December 1, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants