generated from Chuseok22/chuseok22-github-template
-
Notifications
You must be signed in to change notification settings - Fork 0
20260115 #131 장바구니 빈 페이지 개발 #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "20260115_#131_\uC7A5\uBC14\uAD6C\uB2C8_\uBE48_\uD398\uC774\uC9C0_\uAC1C\uBC1C"
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc2bdf4
장바구니_빈_페이지_개발 : feat : pleading-face svg 아이콘 추가 https://github.com/Ca…
Chuseok22 b2c7e8b
장바구니_빈_페이지_개발 : feat : 헤더 장바구니 아이콘 클릭 시 장바구니 페이지 이동 https://github.co…
Chuseok22 5a9e9b5
장바구니_빈_페이지_개발 : feat : 장바구니 비어있는 경우 출력 화면 컴포넌트 개발 https://github.com/…
Chuseok22 5f74703
장바구니_빈_페이지_개발 : feat : QuantityStepper width, height 절대 수치로 변경 https:…
Chuseok22 a8c4238
장바구니_빈_페이지_개발 : feat : 장바구니 페이지 메뉴 컴포넌트 개발 https://github.com/CampusT…
Chuseok22 b139da8
장바구니_빈_페이지_개발 : feat : SeparationBar.tsx 컴포넌트 공용 사용을 위한 폴더 위치 변경 http…
Chuseok22 52b7957
장바구니_빈_페이지_개발 : feat : SeparationBar.tsx 폴더 이동에 따른 import 수정 https://…
Chuseok22 c1c961f
장바구니_빈_페이지_개발 : feat : 장바구니 빈 페이지 개발 https://github.com/CampusTable/c…
Chuseok22 de8bfdb
장바구니_빈_페이지_개발 : feat : 카테고리 라벨 bold 수정 https://github.com/CampusTable…
Chuseok22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,28 +1,19 @@ | ||
| "use client"; | ||
|
|
||
| import CartToast from "@/features/menu/components/toast/CartToast"; | ||
| import { useState } from "react"; | ||
| import EmptyCartView from "@/features/cart/components/view/EmptyCartView"; | ||
| import CartMenuCard from "@/features/cart/components/card/CartMenuCard"; | ||
|
|
||
| export default function CartPage() { | ||
| const [toastVisible, setToastVisible] = useState<boolean>(false); | ||
|
|
||
| const handleClick = (): void => { | ||
| setToastVisible(true); | ||
| setTimeout(() => setToastVisible(false), 1500); | ||
| } | ||
| return ( | ||
| <div className="w-full"> | ||
| 장바구니 페이지 | ||
| <button | ||
| type="button" | ||
| onClick={handleClick} | ||
| > | ||
| 토스트 | ||
| </button> | ||
| <CartToast | ||
| visible={toastVisible} | ||
| message="장바구니에 쏙 담았어요!" | ||
| /> | ||
| </div> | ||
| // <> | ||
| // <CartMenuCard menuId={1} | ||
| // imageSrc="/tmp/menu/menu-1.png" | ||
| // title="김치제육 덮밥" | ||
| // price={6000} /> | ||
| // <CartMenuCard menuId={1} | ||
| // imageSrc="/tmp/menu/menu-1.png" | ||
| // title="김치제육 덮밥" | ||
| // rank={1} | ||
| // price={6000} /> | ||
| // </> | ||
| <EmptyCartView/> | ||
| ); | ||
| } | ||
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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,55 @@ | ||
| .container { | ||
| display: flex; | ||
| position: relative; | ||
| gap: 1rem; | ||
|
|
||
| border: 1px solid black; | ||
|
|
||
| width: 100%; | ||
|
|
||
| background-color: var(--color-white); | ||
| } | ||
|
|
||
| .imageWrapper { | ||
| position: relative; | ||
| width: 5.125rem; | ||
| height: 5.125rem; | ||
| border-radius: 0.5rem; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .image { | ||
| object-fit: cover; | ||
| } | ||
|
|
||
| .labelWrapper { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.5rem; | ||
|
|
||
| padding-top: 0.25rem; | ||
| } | ||
|
|
||
| .title { | ||
| color: var(--color-black); | ||
| font-size: var(--text-base); | ||
| font-style: normal; | ||
| font-weight: var(--font-semibold); | ||
| line-height: var(--line-height-single); | ||
| letter-spacing: var(--letter-spacing); | ||
| } | ||
|
|
||
| .price { | ||
| color: var(--color-black); | ||
| font-size: var(--text-sm); | ||
| font-style: normal; | ||
| font-weight: var(--font-medium); | ||
| line-height: var(--line-height-single); | ||
| letter-spacing: var(--letter-spacing); | ||
| } | ||
|
|
||
| .stepperWrapper { | ||
| position: absolute; | ||
| right: 0; | ||
| bottom: 0; | ||
| } |
This file contains hidden or 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,61 @@ | ||
| "use client"; | ||
|
|
||
| import styles from "./CartMenuCard.module.css"; | ||
| import Image from "next/image"; | ||
| import PopularTag from "@/features/menu/components/tags/PopularTag"; | ||
| import { formatNumberWithComma } from "@/shared/utils/number/utils"; | ||
| import QuantityStepper from "@/features/cart/components/button/QuantityStepper"; | ||
|
|
||
| type Rank = 1 | 2 | 3; | ||
|
|
||
| interface CartMenuCardProps { | ||
| menuId: number; | ||
| imageSrc: string; | ||
| title: string; | ||
| price: number; | ||
| quantity: number; | ||
| rank?: Rank; | ||
| onClickAdd?: (menuId: number) => void; | ||
| } | ||
|
|
||
| export default function CartMenuCard({ | ||
| menuId, | ||
| imageSrc, | ||
| title, | ||
| price, | ||
| quantity, | ||
| rank, | ||
| }: CartMenuCardProps) { | ||
|
|
||
| const hasTag = typeof rank !== "undefined"; | ||
|
|
||
| return ( | ||
| <div className={styles.container}> | ||
| <div className={styles.imageWrapper}> | ||
| <Image | ||
| src={imageSrc} | ||
| alt={"메뉴사진"} | ||
| fill | ||
| className={styles.image} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className={styles.labelWrapper}> | ||
| {hasTag && <PopularTag rank={rank} />} | ||
| <div className={styles.title}> | ||
| {title} | ||
| </div> | ||
| <div className={styles.price}> | ||
| {formatNumberWithComma(price)}원 | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className={styles.stepperWrapper}> | ||
| <QuantityStepper | ||
| menuId={menuId} | ||
| quantity={quantity} | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
88 changes: 88 additions & 0 deletions
88
src/features/cart/components/view/EmptyCartView.module.css
This file contains hidden or 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,88 @@ | ||
| .container { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
|
|
||
| width: 100%; | ||
| min-height: calc(100vh - var(--top-header-height)); | ||
| } | ||
|
|
||
| .titleWrapper { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 0.25rem; | ||
|
|
||
| margin-bottom: 0.75rem; | ||
| } | ||
|
|
||
| .title { | ||
| color: var(--color-black); | ||
| font-family: var(--font-display); | ||
| font-size: var(--text-lg); | ||
| font-style: normal; | ||
| font-weight: var(--font-normal); | ||
| line-height: var(--line-height-single); | ||
| letter-spacing: -0.00363rem; | ||
| } | ||
|
|
||
| .subTitle { | ||
| color: var(--color-gray-600); | ||
| text-align: center; | ||
|
|
||
| font-size: var(--text-sm); | ||
| font-style: normal; | ||
| font-weight: var(--font-medium); | ||
| line-height: var(--line-height-single); | ||
| letter-spacing: -0.00281rem; | ||
|
|
||
| margin-bottom: 1.5rem; | ||
| } | ||
|
|
||
| .buttonWrapper { | ||
| display: flex; | ||
| gap: 0.5rem; | ||
| } | ||
|
|
||
| .homeButton { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
|
|
||
| border-radius: 0.75rem; | ||
| border: 1px solid var(--color-main-500); | ||
| background-color: var(--color-main-100); | ||
|
|
||
| padding: 1rem 1.5rem; | ||
| } | ||
|
|
||
| .homeButtonLabel { | ||
| color: var(--color-main); | ||
|
|
||
| font-size: var(--text-base); | ||
| font-style: normal; | ||
| font-weight: var(--font-semibold); | ||
| line-height: var(--line-height-single); | ||
| letter-spacing: -0.00319rem; | ||
| } | ||
|
|
||
| .menuButton { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
|
|
||
| border-radius: 0.75rem; | ||
| background-color: var(--color-main); | ||
|
|
||
| padding: 1rem 1.6rem; | ||
| } | ||
|
|
||
| .menuButtonLabel { | ||
| color: var(--color-white); | ||
|
|
||
| font-size: var(--text-base); | ||
| font-style: normal; | ||
| font-weight: var(--font-semibold); | ||
| line-height: var(--line-height-single); | ||
| letter-spacing: -0.00319rem; | ||
| } |
This file contains hidden or 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,38 @@ | ||
| import styles from "./EmptyCartView.module.css"; | ||
| import { PleadingFaceIcon } from "@/assets/icons"; | ||
| import Link from "next/link"; | ||
|
|
||
| export default function EmptyCartView() { | ||
| return ( | ||
| <div className={styles.container}> | ||
| <div className={styles.titleWrapper}> | ||
| <div className={styles.title}> | ||
| 아무것도 없어요 | ||
| </div> | ||
| <PleadingFaceIcon /> | ||
| </div> | ||
| <div className={styles.subTitle}> | ||
| 메뉴를 둘러 보고, 먹고 싶은 메뉴를 바로 담아봐요 | ||
| </div> | ||
|
|
||
|
|
||
| <div className={styles.buttonWrapper}> | ||
| <Link href="/"> | ||
| <div className={styles.homeButton}> | ||
| <div className={styles.homeButtonLabel}> | ||
| 인기 순위 보기 | ||
| </div> | ||
| </div> | ||
| </Link> | ||
|
|
||
| <Link href="/hakgwan"> | ||
| <div className={styles.menuButton}> | ||
| <div className={styles.menuButtonLabel}> | ||
| 메뉴 둘러보기 | ||
| </div> | ||
| </div> | ||
| </Link> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -27,5 +27,5 @@ | |
|
|
||
| .labelActive { | ||
| color: var(--color-white); | ||
| font-weight: var(--font-extrabold); | ||
| font-weight: var(--font-bold); | ||
| } | ||
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용되지 않는 import를 제거하세요.
CartMenuCard가 import되었지만 실제로 사용되지 않습니다. 주석 처리된 코드에서만 참조되고 있어 불필요한 import입니다.🧹 제안된 수정 사항
import EmptyCartView from "@/features/cart/components/view/EmptyCartView"; -import CartMenuCard from "@/features/cart/components/card/CartMenuCard";📝 Committable suggestion
🤖 Prompt for AI Agents