From f594f001f685e583182069a6dbe801c8fbb67cfb Mon Sep 17 00:00:00 2001 From: Yevhen Odynets Date: Wed, 5 Feb 2025 21:17:25 +0200 Subject: [PATCH] cart mechanism complete --- .gitignore | 1 + .idea/codeStyles/Project.xml | 2 +- .idea/watcherTasks.xml | 4 + app/[locale]/(root)/(shop)/cart/page.tsx | 31 ++++++ app/[locale]/(root)/(shop)/checkout/page.tsx | 12 --- .../(shop)/product/[[...slug]]/page.tsx | 16 +++ app/[locale]/(root)/page.tsx | 16 --- app/globals.css | 22 ++++ app/layout.tsx | 6 +- .../admin/product/create-edit-form.tsx | 1 + components/pages/cart/cart.module.scss | 4 + components/pages/cart/items.tsx | 74 ++++++++++++++ components/pages/product/add-cart-button.tsx | 28 +++++ components/pages/product/index.tsx | 57 +++++++++++ components/shared/header/cabinet-button.tsx | 1 - components/shared/header/controls.tsx | 15 +-- .../shared/header/shopping-cart-icon.tsx | 25 +++++ components/shared/navbar/index.tsx | 2 +- components/shared/navbar/navbar-menu.tsx | 8 +- lib/data/models/product.ts | 8 +- package-lock.json | 85 +++++++++++----- package.json | 5 +- public/uploads/products/IMG_6572.jpg | Bin 389923 -> 0 bytes store/cart-store.ts | 96 ++++++++++++++++++ 24 files changed, 441 insertions(+), 78 deletions(-) create mode 100644 .idea/watcherTasks.xml create mode 100644 app/[locale]/(root)/(shop)/cart/page.tsx delete mode 100644 app/[locale]/(root)/(shop)/checkout/page.tsx create mode 100644 app/[locale]/(root)/(shop)/product/[[...slug]]/page.tsx create mode 100644 components/pages/cart/cart.module.scss create mode 100644 components/pages/cart/items.tsx create mode 100644 components/pages/product/add-cart-button.tsx create mode 100644 components/pages/product/index.tsx create mode 100644 components/shared/header/shopping-cart-icon.tsx delete mode 100644 public/uploads/products/IMG_6572.jpg create mode 100644 store/cart-store.ts diff --git a/.gitignore b/.gitignore index f66bd6e..87b5daa 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,4 @@ dist .pnp.js .env*.local /messages/*.d.json.ts +/public/uploads/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index ccec8e0..21164b5 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -54,7 +54,7 @@