upload 29/12
42
.gitignore
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/versions
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*
|
||||
.env.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
18
eslint.config.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import nextVitals from "eslint-config-next/core-web-vitals";
|
||||
import nextTs from "eslint-config-next/typescript";
|
||||
|
||||
const eslintConfig = defineConfig([
|
||||
...nextVitals,
|
||||
...nextTs,
|
||||
// Override default ignores of eslint-config-next.
|
||||
globalIgnores([
|
||||
// Default ignores of eslint-config-next:
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
]),
|
||||
]);
|
||||
|
||||
export default eslintConfig;
|
||||
7
next.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
/* config options here */
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
6189
package-lock.json
generated
Normal file
29
package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "hoanghapc",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "eslint"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "16.1.0",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"swiper": "^12.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"autoprefixer": "^10.4.23",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "16.1.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
7
postcss.config.mjs
Normal file
@@ -0,0 +1,7 @@
|
||||
const config = {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
BIN
public/images/avatar-admin.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/bg-deal-home.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
public/images/bg-footer-info.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
public/images/brand/brand-1.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/images/brand/brand-2.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/images/brand/brand-3.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/images/brand/brand-4.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/images/brand/brand-5.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/images/brand/brand-6.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
public/images/cart-empty.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
public/images/cart-ticket.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/category/slide-category.png
Normal file
|
After Width: | Height: | Size: 205 KiB |
BIN
public/images/deal-bg.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
public/images/deal-icon-bolt.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
public/images/footer-newsletter-bg.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/images/footer-newsletter.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/images/global-deal-line.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
public/images/global-footer-bct.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/images/global/cat-1.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/images/global/cat-10.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/images/global/cat-11.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
public/images/global/cat-12.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/global/cat-13.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/global/cat-14.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/images/global/cat-15.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
public/images/global/cat-2.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/images/global/cat-3.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
public/images/global/cat-4.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
public/images/global/cat-5.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
public/images/global/cat-6.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/images/global/cat-7.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/images/global/cat-8.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/images/global/cat-9.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/images/header-banner.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
public/images/hoang-ha-pc-cau-giay.png
Normal file
|
After Width: | Height: | Size: 622 KiB |
BIN
public/images/hoang-ha-pc-dong-da-5.jpg
Normal file
|
After Width: | Height: | Size: 379 KiB |
BIN
public/images/hoang-ha-pc-hcm.jpg
Normal file
|
After Width: | Height: | Size: 428 KiB |
BIN
public/images/hoang_ha_pc_vinh.jpg
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
public/images/homepage/banner-cate.png
Normal file
|
After Width: | Height: | Size: 871 KiB |
BIN
public/images/homepage/home-slide.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
public/images/homepage/right-1.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/images/homepage/right-2.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
public/images/homepage/under-1.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
public/images/homepage/under-2.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
public/images/homepage/under-3.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
public/images/homepage/under-4.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
public/images/homepage/under-slide-1.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
public/images/homepage/under-slide-2.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
public/images/homepage/under-slide-3.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
public/images/icon-bolt.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
public/images/icon-cart.png
Normal file
|
After Width: | Height: | Size: 400 B |
BIN
public/images/icon-desktop.png
Normal file
|
After Width: | Height: | Size: 521 B |
BIN
public/images/icon-installment.png
Normal file
|
After Width: | Height: | Size: 526 B |
BIN
public/images/icon-laptop.png
Normal file
|
After Width: | Height: | Size: 806 B |
BIN
public/images/icon-mess-1.png
Normal file
|
After Width: | Height: | Size: 926 B |
BIN
public/images/icon-mess-2.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
public/images/icon-mess.png
Normal file
|
After Width: | Height: | Size: 467 B |
BIN
public/images/icon-metal.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/images/icon-planet.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/images/icon-playlist.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/images/icon-truck.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/images/icon-zalo.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/icon_add_desktop.png
Normal file
|
After Width: | Height: | Size: 302 B |
BIN
public/images/logo-tiktok.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/images/logo.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
public/images/logo/logo-anphat.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
public/images/logo/logo-fpt.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
public/images/logo/logo-gearvn.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/images/logo/logo-hacom.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/logo/logo-mygear.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
public/images/logo/logo-phongvu.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
public/images/logo/logo-phucanh.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/images/no_image.jpg
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
public/images/product-1.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
public/images/product-2.jpg
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
public/images/product-3.jpg
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
public/images/product-4.jpg
Normal file
|
After Width: | Height: | Size: 175 KiB |
BIN
public/images/product-5.jpg
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
public/images/product-6.jpg
Normal file
|
After Width: | Height: | Size: 154 KiB |
BIN
public/images/product-7.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
public/images/product-8.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
public/images/send-cart-face.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/images/send-cart-image.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
public/images/social_media/global-deal-line.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/images/sprite-2.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
public/images/sprite.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
public/images/star-black.png
Normal file
|
After Width: | Height: | Size: 814 B |
BIN
public/images/star.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/images/star_rating.png
Normal file
|
After Width: | Height: | Size: 752 B |
BIN
public/images/zalo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
240
public/styles/library.css
Normal file
1
public/styles/tailwind.css
Normal file
43
src/app/[slug]/page.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { findBySlug } from "@/lib/slugMap";
|
||||
|
||||
import ProductCategory from "@/components/product/Category";
|
||||
import ProductDetail from "@/components/product/ProductDetail";
|
||||
import ArticleHome from "@/components/article/Home";
|
||||
import ArticleCategory from "@/components/article/Category";
|
||||
import ArticleDetail from "@/components/article/ArticleDetail";
|
||||
|
||||
|
||||
export default async function SlugPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ slug: string }>;
|
||||
}) {
|
||||
const { slug } = await params;
|
||||
|
||||
if (!slug) return notFound();
|
||||
|
||||
const result = findBySlug(slug);
|
||||
|
||||
if (!result) return notFound();
|
||||
|
||||
switch (result.type) {
|
||||
case "product_category":
|
||||
return <ProductCategory slug={slug} />;
|
||||
|
||||
case "product_detail":
|
||||
return <ProductDetail slug={slug} />;
|
||||
|
||||
case "article_home":
|
||||
return <ArticleHome slug={slug} />;
|
||||
|
||||
case "article_category":
|
||||
return <ArticleCategory slug={slug} />;
|
||||
|
||||
case "article_detail":
|
||||
return <ArticleDetail slug={slug} />;
|
||||
|
||||
default:
|
||||
return notFound();
|
||||
}
|
||||
}
|
||||
BIN
src/app/favicon.ico
Normal file
|
After Width: | Height: | Size: 25 KiB |