diff --git a/src/app/buildpc/BoxListAccessory/index.tsx b/src/app/buildpc/BoxListAccessory/index.tsx new file mode 100644 index 0000000..4f08ecc --- /dev/null +++ b/src/app/buildpc/BoxListAccessory/index.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import { category_config } from '@/data/buildpc/category'; +import { FaPlus } from 'react-icons/fa'; + +export const BoxListAccessory = () => { + return ( +
+ {category_config.map((category, index) => ( +
+
+

+ {index + 1}. {category.name} +

+
+
+ + + {''} + Chọn {category.name} + +
+
+
+ ))} +
+ ); +}; diff --git a/src/app/buildpc/BtnAction/index.tsx b/src/app/buildpc/BtnAction/index.tsx new file mode 100644 index 0000000..03b8d82 --- /dev/null +++ b/src/app/buildpc/BtnAction/index.tsx @@ -0,0 +1,49 @@ +import { FaImage, FaFileExcel, FaPrint, FaShoppingCart } from 'react-icons/fa'; + +const BtnAction = () => { + return ( + <> +
+

+ Chi phí dự tính: +

+
+ + + ); +}; +export default BtnAction; diff --git a/src/app/buildpc/page.tsx b/src/app/buildpc/page.tsx index 5e38cfe..8eeed9a 100644 --- a/src/app/buildpc/page.tsx +++ b/src/app/buildpc/page.tsx @@ -1,9 +1,13 @@ import React from 'react'; -import '@styles/buildpc.css'; import { Metadata } from 'next'; +import '@styles/buildpc.css'; +import { FaUndo } from 'react-icons/fa'; + import { Breadcrumb } from '@/components/Common/Breadcrumb'; import Slider from '@/app/buildpc/Slider'; +import { BoxListAccessory } from './BoxListAccessory'; +import BtnAction from './BtnAction'; export const metadata: Metadata = { title: 'Build PC - Xây dựng cấu hình máy tính PC giá rẻ chuẩn nhất', @@ -77,6 +81,34 @@ export default function BuildPcPage() {
+ + +
+

+ Chi phí dự tính: {' '} +

+
+
+
+ + {/* Hiển thị dữ liệu tai đây */} + + + {/* btn */} + diff --git a/src/components/other/Header/HeaderMid/index.tsx b/src/components/other/Header/HeaderMid/index.tsx index 3963ba8..f6b04de 100644 --- a/src/components/other/Header/HeaderMid/index.tsx +++ b/src/components/other/Header/HeaderMid/index.tsx @@ -27,6 +27,22 @@ const HeaderMid: React.FC = () => { return cart.reduce((sum: number, item) => sum + Number(item.in_cart.total_price), 0); }); + const [isFixed, setIsFixed] = useState(false); + + useEffect(() => { + const handleScroll = () => { + const distanceFromTop = window.scrollY; + if (distanceFromTop > 680) { + setIsFixed(true); + } else { + setIsFixed(false); + } + }; + + window.addEventListener('scroll', handleScroll); + return () => window.removeEventListener('scroll', handleScroll); + }, []); + const PopupAddress = () => { const modal = document.getElementById('boxShowroom') as HTMLDialogElement; modal?.showModal(); @@ -38,7 +54,7 @@ const HeaderMid: React.FC = () => { }; return ( -
+
diff --git a/src/data/buildpc/category/index.ts b/src/data/buildpc/category/index.ts new file mode 100644 index 0000000..ab6b581 --- /dev/null +++ b/src/data/buildpc/category/index.ts @@ -0,0 +1,114 @@ +export const category_config = [ + { + id: 277, + name: 'CPU - B\u1ed9 Vi X\u1eed L\u00fd', + }, + { + id: 278, + name: 'Main - Bo M\u1ea1ch Ch\u1ee7', + }, + { + id: 283, + name: 'RAM - B\u1ed9 Nh\u1edb Trong', + }, + { + id: 3274, + name: '\u1ed4 C\u1ee9ng SSD 1', + }, + { + id: 3644, + name: '\u1ed4 C\u1ee9ng SSD 2', + }, + { + id: 3273, + name: '\u1ed4 C\u1ee9ng HDD', + }, + { + id: 279, + name: 'VGA - Card M\u00e0n H\u00ecnh', + }, + { + id: 282, + name: 'PSU - Ngu\u1ed3n M\u00e1y T\u00ednh', + }, + { + id: 280, + name: 'Case - V\u1ecf M\u00e1y T\u00ednh', + }, + { + id: 3270, + name: 'T\u1ea3n Nhi\u1ec7t Kh\u00ed', + }, + { + id: 3269, + name: 'T\u1ea3n Nhi\u1ec7t N\u01b0\u1edbc AIO', + }, + { + id: 3630, + name: 'T\u1ea3n Nhi\u1ec7t N\u01b0\u1edbc Custom', + }, + { + id: 3271, + name: 'Fan T\u1ea3n Nhi\u1ec7t', + }, + { + id: 281, + name: 'Monitor - M\u00e0n H\u00ecnh', + }, + { + id: 3705, + name: 'Monitor - M\u00e0n H\u00ecnh 2', + }, + { + id: 1235, + name: 'B\u00e0n Ph\u00edm', + }, + { + id: 1147, + name: 'Mouse - Chu\u1ed9t', + }, + { + id: 1118, + name: 'Pad - B\u00e0n Di Chu\u1ed9t', + }, + { + id: 3309, + name: 'Tai Nghe', + }, + { + id: 3308, + name: 'Loa', + }, + { + id: 3307, + name: 'Gh\u1ebf Gaming', + }, + { + id: 3411, + name: 'B\u00e0n Gaming', + }, + { + id: 3287, + name: 'Webcam', + }, + { + id: 3341, + name: 'Microphones', + }, + { + id: 3413, + name: 'Thi\u1ebft B\u1ecb Studio, Stream', + }, + { + id: 1751, + name: 'Thi\u1ebft B\u1ecb M\u1ea1ng', + }, + { + id: 3598, + name: 'Gi\u00e1 treo m\u00e0n h\u00ecnh', + }, + { + id: 3437, + name: 'Ph\u1ea7n m\u1ec1m', + }, +]; diff --git a/src/data/buildpc/index.ts b/src/data/buildpc/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/styles/buildpc.css b/src/styles/buildpc.css index d827789..c1e4545 100644 --- a/src/styles/buildpc.css +++ b/src/styles/buildpc.css @@ -1,8 +1,6 @@ @charset "UTF-8"; .build-pc *, .custom-pc * { - margin: 0; - padding: 0; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;