-
Notifications
You must be signed in to change notification settings - Fork 1
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
style: 선물 보따리 채우기 플로우 퍼블리싱 #25
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d714224
feat: shadcn tooltip 설치
xxxjinn a6bac95
design: shadcn tooltip (기본) 추가
xxxjinn 8c8dd53
feat: 선물 업로드 페이지로 연결 및 선물 업로드 페이지 라우팅 처리
xxxjinn 9405c7d
design: 선물 링크 input 컴포넌트 퍼블리싱
xxxjinn 42d22d5
design: 선물 정보 업로드 페이지 기본 구조 잡기
xxxjinn cdc1e1b
feat: 삭제 아이콘 추가
xxxjinn 4c11078
feat: image 아이콘 추가
xxxjinn eec2e5d
design: ImageCard 컴포넌트 퍼블리싱
xxxjinn 47f1386
feat: 이미지 업로드 목록 퍼블리싱 및 구현
xxxjinn e259192
feat: 선물 상세 업로드 - 이미지 업로드 컴포넌트 구현
xxxjinn aac82da
feat: CharacterCountInput의 value를 부모에 전달할 수 있도록 props 추가
xxxjinn 49f3ee8
feat: 보따리 이름 입력에 따른 button disabled 구현
xxxjinn 58f88e0
refactor: (임시) CharacterCountInput onChange props 선택으로 수정
xxxjinn c8c8ebb
design: symantic color 추가
xxxjinn 2ac28c5
feat: 에러메세지 컴포넌트 구현
xxxjinn 63ca7ed
feat: 선물 정보 업로드 - 필수 입력 항목 입력 여부에 따른 에러메세지 출력 구현
xxxjinn b6f0410
refactor: constants 추가
xxxjinn f1541c1
design: font weight 추가
xxxjinn 4461788
design: pretendardVariable로 변경 (weight 수정 가능)
xxxjinn eab9dc3
feat: Chip 컴포넌트 구현
xxxjinn c158b54
feat: ChipList 컴포넌트 구현
xxxjinn 1c2f152
rename: constants.ts 파일 하나로 합치기
xxxjinn 31e413e
rename: ChipList.tsx 파일 위치 이동
xxxjinn 761edee
feat: shadcn textarea 설치
xxxjinn 6a202b6
refactor: 0번째 chip default로 선택하도록 수정
xxxjinn 3daee02
design: Chip 스타일 수정
xxxjinn 7df7baf
design: CustomTextArea 퍼블리싱
xxxjinn 5cbfea1
feat: chip 선택에 따라 textArea 내용 매핑
xxxjinn 7941804
rename: store 관련 폴더 구조 정리
xxxjinn 02346e7
feat: gift_letter_square img 추가
xxxjinn 566c272
feat: 선물 선택 이유 컴포넌트 구현
xxxjinn 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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,4 @@ | ||
export const GIFTBAG_NAME_MAX_LENGTH = 20; | ||
export const GIFT_NAME_MAX_LENGTH = 20; | ||
|
||
export const GIFT_SELECT_REASON_MAX_LENGTH = 100; |
Binary file not shown.
Binary file not shown.
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,11 @@ | ||
import GiftForm from "@/components/gift-upload/GiftForm"; | ||
|
||
const page = () => { | ||
return ( | ||
<> | ||
<GiftForm /> | ||
</> | ||
); | ||
}; | ||
|
||
export default page; |
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
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,19 @@ | ||
interface ChipProps { | ||
text: string; | ||
isActive: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
const Chip = ({ text, isActive, onClick }: ChipProps) => { | ||
return ( | ||
<span | ||
onClick={onClick} | ||
className={`inline-flex items-center justify-center min-w-[55px] h-[28px] px-3 rounded-[6px] border-[1.4px] cursor-pointer | ||
${isActive ? "bg-pink-500 border-pink-500 text-white" : "bg-white hover:bg-pink-500 hover:border-pink-500 hover:text-white"}`} | ||
> | ||
<p className="m-0 text-xs">{text}</p> | ||
</span> | ||
); | ||
}; | ||
|
||
export default Chip; |
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,9 @@ | ||
interface ErrorMessageProps { | ||
message: string; | ||
} | ||
|
||
const ErrorMessage = ({ message }: ErrorMessageProps) => { | ||
return <p className="text-symantic-negative text-xs mt-1">{message}</p>; | ||
}; | ||
|
||
export default ErrorMessage; |
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 Chip from "../common/Chip"; | ||
|
||
interface ChipListProps { | ||
chipText: string[]; | ||
selectedChipIndex: number; | ||
onChipClick: (index: number) => void; | ||
} | ||
|
||
const ChipList = ({ | ||
chipText, | ||
selectedChipIndex, | ||
onChipClick, | ||
}: ChipListProps) => { | ||
return ( | ||
<div className="flex gap-[7px] whitespace-nowrap"> | ||
{chipText.map((text, index) => ( | ||
<Chip | ||
key={index} | ||
text={text} | ||
isActive={index === selectedChipIndex} | ||
onClick={() => onChipClick(index)} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ChipList; |
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,32 @@ | ||
import { Textarea } from "../ui/textarea"; | ||
|
||
interface CustomTextAreaProps { | ||
placeholder: string; | ||
maxLength: number; | ||
text: string; | ||
onTextChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void; | ||
} | ||
|
||
const CustomTextArea = ({ | ||
placeholder, | ||
maxLength, | ||
text, | ||
onTextChange, | ||
}: CustomTextAreaProps) => { | ||
return ( | ||
<div className="relative"> | ||
<Textarea | ||
placeholder={placeholder} | ||
className="min-h-[135px] h-[135px] resize-none bg-white placeholder:text-gray-300" | ||
value={text} | ||
onChange={onTextChange} | ||
maxLength={maxLength} | ||
/> | ||
<span className="absolute bottom-2 right-2 text-gray-400 text-[10px]"> | ||
{text.length} / {maxLength} | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CustomTextArea; |
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,56 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
import CharacterCountInput from "../common/CharacterCountInput"; | ||
import { Button } from "../ui/button"; | ||
import InputLink from "./InputLink"; | ||
import InputReason from "./InputReason"; | ||
import UploadImageList from "./UploadImageList"; | ||
import ErrorMessage from "../common/ErrorMessage"; | ||
import { GIFT_NAME_MAX_LENGTH } from "@/app/constants/constants"; | ||
|
||
const GiftForm = () => { | ||
const [imageCount, setImageCount] = useState(0); | ||
const [giftName, setGiftName] = useState(""); | ||
const [isSubmitted, setIsSubmitted] = useState(false); | ||
|
||
const handleSubmit = () => { | ||
if (imageCount === 0 || giftName.length === 0) { | ||
setIsSubmitted(true); | ||
return; | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="flex flex-col p-4 gap-[50px]"> | ||
<div className="flex flex-col gap-1"> | ||
<div | ||
className="w-full overflow-x-auto h-[110px] flex items-center" | ||
style={{ scrollbarWidth: "none" }} | ||
> | ||
<div className="min-w-max"> | ||
<UploadImageList onImagesChange={setImageCount} /> | ||
</div> | ||
</div> | ||
{isSubmitted && imageCount === 0 && ( | ||
<ErrorMessage message="필수 입력 정보입니다." /> | ||
)} | ||
<CharacterCountInput | ||
maxLength={GIFT_NAME_MAX_LENGTH} | ||
placeholder="선물명을 적어주세요" | ||
onChange={setGiftName} | ||
/> | ||
{isSubmitted && giftName.length === 0 && ( | ||
<ErrorMessage message="필수 입력 정보입니다." /> | ||
)} | ||
</div> | ||
<InputReason /> | ||
<InputLink /> | ||
<Button size="lg" onClick={handleSubmit}> | ||
채우기 완료 | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default GiftForm; |
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,39 @@ | ||
import React from "react"; | ||
import Image from "next/image"; | ||
import EraseIcon from "../../../public/icons/btn_erase.svg"; | ||
|
||
interface ImageCardProps { | ||
src: string; | ||
isPrimary?: boolean; | ||
onDelete: () => void; | ||
} | ||
|
||
const ImageCard = ({ src, isPrimary, onDelete }: ImageCardProps) => { | ||
return ( | ||
<div className="relative"> | ||
<button | ||
className="absolute top-[-8px] right-[-8px] z-10" | ||
onClick={onDelete} | ||
> | ||
<Image src={EraseIcon} alt="delete" width={24} height={24} /> | ||
</button> | ||
<div className="relative rounded-[10px] h-[88px] w-[88px] bg-gray-50 border-[1.4px] border-gray-100 overflow-hidden"> | ||
<Image | ||
src={src} | ||
alt="Uploaded" | ||
width={88} | ||
height={88} | ||
className="w-full h-full object-cover" | ||
priority | ||
/> | ||
{isPrimary && ( | ||
<div className="absolute bottom-0 w-[88px] bg-[#0F0F10] opacity-70 text-gray-300 text-xs pt-0.5 text-center rounded-bl-[10px] rounded-br-[10px] h-5"> | ||
<p className="text-[10px]">대표 사진</p> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ImageCard; |
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,17 @@ | ||
import { Input } from "../ui/input"; | ||
|
||
const InputLink = () => { | ||
return ( | ||
<div className="flex flex-col gap-4"> | ||
<div className="flex flex-col gap-[5px] "> | ||
<p className="text-[15px]">선물 링크를 메모해보세요.</p> | ||
<p className="text-gray-400 text-xs"> | ||
선물 링크는 상대방에게 공개되지 않습니다. | ||
</p> | ||
</div> | ||
<Input placeholder="링크 추가" /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default InputLink; |
Oops, something went wrong.
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.
constants.ts
파일을 app 내 위치시킨 이유가 있으실까요?!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.
어 그러게요....ㅎ 인지를 못하고있었네요 dev 브랜치에서 바로 경로 루트로 바꿔놔도 괜찮을가요?
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.
넵!