diff --git a/components/header/index.tsx b/components/header/index.tsx
index a113f2b..30faccc 100644
--- a/components/header/index.tsx
+++ b/components/header/index.tsx
@@ -1,11 +1,6 @@
import Link from "next/link";
import { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
-/*
-type HeaderType = {
- isErrorPage?: Boolean;
-}
-*/
type HeaderType = {
isErrorPage?: Boolean;
@@ -14,7 +9,8 @@ type HeaderType = {
const Header = ({ isErrorPage }: HeaderType) => {
const router = useRouter();
const arrayPaths = ['/'];
- const [onTop, setOnTop] = useState(( !arrayPaths.includes("/")|| isErrorPage ) ? false : true);
+ const [onTop, setOnTop] = useState(( !arrayPaths.includes("/router.pathname")|| isErrorPage ) ? false : true);
+ const [pageLogin] = useState(( router.pathname == "/login" ) ? true : false);
const headerClass = () => {
if(window.pageYOffset === 0) {
@@ -23,9 +19,7 @@ const Header = ({ isErrorPage }: HeaderType) => {
setOnTop(false);
}
}
- if(!arrayPaths.includes("login") ) {
- console.log("hihe")
- }
+
useEffect(() => {
if(!arrayPaths.includes(router.pathname) || isErrorPage) {
return;
@@ -77,36 +71,39 @@ const Header = ({ isErrorPage }: HeaderType) => {
-
-
diff --git a/components/item/index.tsx b/components/item/index.tsx
index 7fa6086..28c4440 100644
--- a/components/item/index.tsx
+++ b/components/item/index.tsx
@@ -3,13 +3,13 @@ import { ProductTypeList,IngredientType } from 'types';
import Ingredient from './ingredient';
-const MenuItem = ({ name, price,
+const MenuItem = ({ name, price,
images, merchart, currentPrice,
cook_method, time ,
ingredient,
distance, ratings, kcal}: ProductTypeList) => {
return(
-
+
{
diff --git a/pages/api/products.ts b/pages/api/products.ts
new file mode 100644
index 0000000..8af273c
--- /dev/null
+++ b/pages/api/products.ts
@@ -0,0 +1,13 @@
+import type { NextApiRequest, NextApiResponse } from 'next';
+
+// fake data
+import products from '../../utils/data/products';
+
+export default (req: NextApiRequest, res: NextApiResponse) => {
+ console.log(req);
+
+ // fake loading time
+ setTimeout(() => {
+ res.status(200).json(products);
+ }, 800);
+}
diff --git a/public/images/login_image.png b/public/images/login_image.png
new file mode 100644
index 0000000..e537758
Binary files /dev/null and b/public/images/login_image.png differ