-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MOJAN3543/main
feat: 상품 페이지, 마켓 페이지 추가
- Loading branch information
Showing
5 changed files
with
157 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
"use client" | ||
import MainLayout from "@/components/MainLayout"; | ||
import MarketDetail from "@/components/MarketDetail"; | ||
import Image from "next/image"; | ||
import { usePathname } from "next/navigation"; | ||
|
||
export default function ProductPage() { | ||
const router = usePathname(); | ||
return ( | ||
<MainLayout> | ||
<div> | ||
<div className="flex items-start justify-center gap-32 p-8"> | ||
<Image | ||
src="https://picsum.photos/512/512" | ||
alt="product Image" | ||
width={512} | ||
height={512} | ||
/> | ||
<div className="flex flex-col w-1/3 gap-5"> | ||
<div> | ||
<div className="text-4xl font-bold"> | ||
저당고단백 도시락 | ||
</div> | ||
<div className="text-lg text-gray-500"> | ||
영양 만점 도시락! | ||
</div> | ||
</div> | ||
<MarketDetail | ||
amount={1} | ||
price={10000} | ||
weight={100} | ||
calorie={300} | ||
carbs={200} | ||
protein={100} | ||
fat={12} | ||
origin={"국내산"} | ||
/> | ||
<div className="flex items-center justify-between p-4 bg-gray-200"> | ||
<div> | ||
저당고단백 도시락 | ||
</div> | ||
<input | ||
className="w-16 p-2" | ||
type="number" | ||
defaultValue={1}> | ||
</input> | ||
<div className="font-bold"> | ||
10,000원 | ||
</div> | ||
</div> | ||
<div className="flex gap-3 justify-evenly"> | ||
<button | ||
type="button" | ||
className="flex justify-center w-1/2 gap-3 p-5 text-lg bg-gray-200 rounded-lg " | ||
> | ||
장바구니에 담기 | ||
</button> | ||
<button | ||
type="button" | ||
className="flex justify-center w-1/2 gap-3 p-5 text-lg text-white rounded-lg bg-primary-600" | ||
> | ||
구매 | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</MainLayout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import MainLayout from "@/components/MainLayout"; | ||
import ProductCard from "@/components/ProductCard"; | ||
|
||
export default function MarketPage() { | ||
return ( | ||
<MainLayout> | ||
|
||
<div className="flex flex-col items-stretch gap-6 px-32 py-8"> | ||
<div className="text-4xl font-bold"> | ||
밀로그 마켓 | ||
</div> | ||
<div className="text-gray-400 text-gl"> | ||
사용자를 위해 건강한 식단을 판매합니다. | ||
</div> | ||
<div className="grid grid-cols-4 gap-6"> | ||
<ProductCard productImage={""} productId={1} productDetail="영양 만점 도시락!" productName="저당고단백 닭가슴살 도시락" productPrice={10000} /> | ||
<ProductCard productImage={""} productId={1} productDetail="영양 만점 도시락!" productName="저당고단백 닭가슴살 도시락" productPrice={10000} /> | ||
<ProductCard productImage={""} productId={1} productDetail="영양 만점 도시락!" productName="저당고단백 닭가슴살 도시락" productPrice={10000} /> | ||
<ProductCard productImage={""} productId={1} productDetail="영양 만점 도시락!" productName="저당고단백 닭가슴살 도시락" productPrice={10000} /> | ||
<ProductCard productImage={""} productId={1} productDetail="영양 만점 도시락!" productName="저당고단백 닭가슴살 도시락" productPrice={10000} /> | ||
<ProductCard productImage={""} productId={1} productDetail="영양 만점 도시락!" productName="저당고단백 닭가슴살 도시락" productPrice={10000} /> | ||
</div> | ||
</div> | ||
|
||
|
||
</MainLayout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> { | ||
productImage: string; | ||
productId: number; | ||
productName: string; | ||
productPrice: number; | ||
productDetail: string; | ||
} | ||
|
||
export default function ProductCard({ | ||
productImage, | ||
productId, | ||
productName, | ||
productPrice, | ||
productDetail, | ||
...props | ||
}: ProductCardProps) { | ||
return ( | ||
<div {...props} className="flex flex-col w-full"> | ||
<Link href={"/market/" + productId}> | ||
<Image | ||
className="w-full" | ||
src="https://picsum.photos/200/200" | ||
alt="product Image" | ||
width={200} | ||
height={200} | ||
/> | ||
</Link> | ||
<div className="text-base text-gray-500"> | ||
{productDetail} | ||
</div> | ||
<Link href={"/market/" + productId}> | ||
<div className="text-lg"> | ||
{productName} | ||
</div> | ||
</Link> | ||
<div className="text-xl"> | ||
<b>{productPrice.toLocaleString('ko-KR')}</b>원 | ||
</div> | ||
</div> | ||
) | ||
} |