From 260a6ab254a61f76d8975b21d2c8f31c4ca1269f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 1 Nov 2022 10:46:51 +0700 Subject: Update filename --- src/components/Header.js | 69 +++++++++++++++++++++++++++++++++++++++++++ src/components/ProductCard.js | 39 ++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 src/components/Header.js create mode 100644 src/components/ProductCard.js (limited to 'src/components') diff --git a/src/components/Header.js b/src/components/Header.js new file mode 100644 index 00000000..3d5d0f84 --- /dev/null +++ b/src/components/Header.js @@ -0,0 +1,69 @@ +import Image from "next/image"; +import Link from "next/link"; +import ShoppingCartIcon from "../icons/shopping-cart.svg"; +import SearchIcon from "../icons/search.svg"; +import MenuIcon from "../icons/menu.svg"; +import ChevronRightIcon from "../icons/chevron-right.svg"; +import { useState } from "react"; + + +export default function Header() { + const [isMenuActive, setIsMenuActive] = useState(false); + + const openMenu = () => setIsMenuActive(true); + const closeMenu = () => setIsMenuActive(false); + + return ( + <> +
+
+ Masuk + Daftar +
+
+ + Brand +
+ +
+ + + Blog +
+ +
+ + +
+
+ + +
+
+ + Logo Indoteknik + +
+ + + + +
+
+
+ + +
+
+ + ) +} \ No newline at end of file diff --git a/src/components/ProductCard.js b/src/components/ProductCard.js new file mode 100644 index 00000000..f51473ad --- /dev/null +++ b/src/components/ProductCard.js @@ -0,0 +1,39 @@ +import Link from "next/link"; +import currencyFormat from "../helpers/currencyFormat"; +import { createSlug } from "../helpers/slug"; +import { LazyLoadImage } from "react-lazy-load-image-component"; + +import 'react-lazy-load-image-component/src/effects/blur.css'; + + +export default function productCard({ data }) { + let product = data; + return ( +
+ + + +
+
+ {typeof product.manufacture.name !== undefined ? ( + {product.manufacture.name} + ) : ( + - + )} + + {product.name} + +
+
+ {product.lowest_price.discount_percentage > 0 ? ( +
+ {product.lowest_price.discount_percentage}% +

{currencyFormat(product.lowest_price.price)}

+
+ ) : ''} +

{product.lowest_price.price_discount > 0 ? currencyFormat(product.lowest_price.price_discount) : 'Tanya harga'}

+
+
+
+ ) +} \ No newline at end of file -- cgit v1.2.3