├── src ├── lib │ ├── tools │ │ ├── datahooks.ts │ │ ├── utils.ts │ │ ├── hooks.ts │ │ └── ls.ts │ ├── fetching │ │ ├── axios.ts │ │ └── fetch.ts │ ├── types │ │ └── contract.ts │ └── zustand │ │ ├── likedStore.ts │ │ └── cartStore.ts ├── vite-env.d.ts ├── assets │ ├── diamond.png │ ├── routes.json │ ├── sneakers.svg │ ├── reviews.json │ └── product.json ├── components │ ├── Common │ │ ├── Show.tsx │ │ ├── ItemLoading.tsx │ │ ├── Item.tsx │ │ └── Logo.tsx │ ├── Cart │ │ ├── CartSummary.tsx │ │ ├── index.tsx │ │ ├── EmptyCart.tsx │ │ ├── Counter.tsx │ │ ├── CartList.tsx │ │ ├── CartItem.tsx │ │ ├── Promo.tsx │ │ └── Details.tsx │ ├── Header │ │ ├── Icons.tsx │ │ ├── index.tsx │ │ ├── TopHeaderX.tsx │ │ ├── CartX.tsx │ │ ├── InputX.tsx │ │ ├── MenuX.tsx │ │ ├── MenuContentX.tsx │ │ ├── LikedDrawerItem.tsx │ │ └── LikedItemDrawerX.tsx │ ├── FullScreen │ │ ├── ImageShowerLoading.tsx │ │ ├── Rating.tsx │ │ ├── SimilarItemsX.tsx │ │ ├── ReviewX.tsx │ │ ├── index.tsx │ │ ├── ImageShowerX.tsx │ │ ├── ItemDescriptionLoading.tsx │ │ └── ItemDescriptionX.tsx │ ├── Footer │ │ ├── Email.tsx │ │ └── index.tsx │ └── ui │ │ └── drawer.tsx ├── pages │ ├── CartPage.tsx │ ├── ItemPage.tsx │ ├── index.tsx │ └── App.tsx ├── main.tsx └── index.css ├── postcss.config.js ├── vercel.json ├── tsconfig.node.json ├── vite.config.ts ├── .gitignore ├── components.json ├── index.html ├── .eslintrc.cjs ├── tsconfig.json ├── README.md ├── package.json ├── tailwind.config.js └── pnpm-lock.yaml /src/lib/tools/datahooks.ts: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/assets/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanhamilthon/sneakers/main/src/assets/diamond.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewrites": [ 3 | { 4 | "source": "/(.*)", 5 | "destination": "/index.html" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/lib/fetching/axios.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | const api = axios.create({ 4 | baseURL: "https://65953dd904335332df824a3e.mockapi.io/products", 5 | }); 6 | 7 | export default api; 8 | -------------------------------------------------------------------------------- /src/lib/tools/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /src/assets/routes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "title": "Главная", "path": "/" }, 3 | { "title": "Каталог", "path": "/" }, 4 | { "title": "Доставка и оплата", "path": "/" }, 5 | { "title": "Контакты", "path": "/" } 6 | ] 7 | -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /src/components/Common/Show.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from "react"; 2 | 3 | type ShowPropsType = { 4 | children: ReactNode; 5 | when?: boolean; 6 | }; 7 | 8 | const Show: React.FC = ({ children, when = false }) => { 9 | return when ? children : null; 10 | }; 11 | 12 | export default Show; 13 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import react from "@vitejs/plugin-react"; 3 | import path from "path"; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [react()], 8 | resolve: { 9 | alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }], 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /src/pages/CartPage.tsx: -------------------------------------------------------------------------------- 1 | import Cart from "@/components/Cart"; 2 | import Footer from "@/components/Footer"; 3 | import Header from "@/components/Header"; 4 | 5 | const CartPage = () => { 6 | return ( 7 | <> 8 |
9 | 10 |