-
Notifications
You must be signed in to change notification settings - Fork 2
Feature(client): dashboard popup에 추가 popup 연결 #105
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,13 +1,14 @@ | ||||||
| import { useState } from 'react'; | ||||||
| import { POP_TEXTAREA_MAX_LENGTH } from '@constants/index'; | ||||||
| import { | ||||||
| CategoryDropDown, | ||||||
| CommonBtn, | ||||||
| InfoBox, | ||||||
| TextArea, | ||||||
| TextFieldPopup, | ||||||
| TimePicker, | ||||||
| ToggleButton, | ||||||
| } from '@pinback/design-system/ui'; | ||||||
| import { POP_TEXTAREA_MAX_LENGTH } from '@constants/index'; | ||||||
| import { useState } from 'react'; | ||||||
| interface ModalPopProps { | ||||||
| onClose: () => void; | ||||||
| } | ||||||
|
|
@@ -18,6 +19,12 @@ const ModalPop = ({ onClose }: ModalPopProps) => { | |||||
| time: '', | ||||||
| timeError: '', | ||||||
| }); | ||||||
| const [categoryPopupMode, setCategoryPopupMode] = useState< | ||||||
| 'edit' | 'add' | '' | ||||||
| >(''); | ||||||
| const [selectedCategory, setSelectedCategory] = useState(''); | ||||||
| const [categories, setCategories] = useState(['기획', '취미', '요리']); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 기본 카테고리 "안 읽은 정보" 누락 문제. 기존 학습에서 "안 읽은 정보" 카테고리가 첫 번째 기본 카테고리로 포함되어야 한다고 했는데, 현재 코드에서는 누락되어 있습니다. 다음 diff를 적용하여 기본 카테고리를 포함하세요: - const [categories, setCategories] = useState(['기획', '취미', '요리']);
+ const [categories, setCategories] = useState(['안 읽은 정보', '기획', '취미', '요리']);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| const handleFieldChange = ( | ||||||
| field: 'date' | 'time', | ||||||
| value: string, | ||||||
|
|
@@ -30,8 +37,39 @@ const ModalPop = ({ onClose }: ModalPopProps) => { | |||||
| })); | ||||||
| }; | ||||||
|
|
||||||
| const handleCategoryChange = (value: string) => { | ||||||
| if (value === 'edit') { | ||||||
| setCategoryPopupMode('edit'); | ||||||
| } else if (value === 'create') { | ||||||
| setCategoryPopupMode('add'); | ||||||
| } else { | ||||||
| setSelectedCategory(value); | ||||||
| setCategoryPopupMode(''); | ||||||
| } | ||||||
| }; | ||||||
|
|
||||||
| const handlePopupClose = () => { | ||||||
| setCategoryPopupMode(''); | ||||||
| }; | ||||||
|
|
||||||
| const handlePopupConfirm = (newCategory?: string) => { | ||||||
| if (!newCategory) { | ||||||
| return; | ||||||
| } | ||||||
| if (categoryPopupMode === 'add') { | ||||||
| setCategories((prev) => [...prev, newCategory]); | ||||||
| setSelectedCategory(newCategory); | ||||||
| } else if (categoryPopupMode === 'edit') { | ||||||
| setCategories((prev) => | ||||||
| prev.map((cat) => (cat === selectedCategory ? newCategory : cat)) | ||||||
| ); | ||||||
| setSelectedCategory(newCategory); | ||||||
| } | ||||||
| handlePopupClose(); | ||||||
| }; | ||||||
|
|
||||||
| return ( | ||||||
| <div className="flex h-[64.2rem] w-[38.7rem] flex-col items-center justify-between rounded-[1rem] bg-white px-[3rem] py-[3rem]"> | ||||||
| <div className="relative flex h-[64.2rem] w-[38.7rem] flex-col items-center justify-between rounded-[1rem] bg-white px-[3rem] py-[3rem]"> | ||||||
| <div className="flex flex-col gap-[1.6rem]"> | ||||||
| {/* TODO : 하드코딩 데이터 구간 */} | ||||||
| <InfoBox | ||||||
|
|
@@ -44,6 +82,7 @@ const ModalPop = ({ onClose }: ModalPopProps) => { | |||||
| <CategoryDropDown | ||||||
| size="large" | ||||||
| categories={['기획', '취미', '요리']} | ||||||
| onSelect={handleCategoryChange} | ||||||
| /> | ||||||
| </section> | ||||||
| <section> | ||||||
|
|
@@ -95,6 +134,23 @@ const ModalPop = ({ onClose }: ModalPopProps) => { | |||||
| /> | ||||||
| </div> | ||||||
| {/* TODO : 하드코딩 데이터 구간 */} | ||||||
|
|
||||||
| {categoryPopupMode && ( | ||||||
| <TextFieldPopup | ||||||
| mode={categoryPopupMode} | ||||||
| value={categoryPopupMode === 'edit' ? selectedCategory : ''} | ||||||
| existingCategories={categories} | ||||||
| onCancel={handlePopupClose} | ||||||
| onConfirm={handlePopupConfirm} | ||||||
| onDelete={() => { | ||||||
| setCategories((prev) => | ||||||
| prev.filter((cat) => cat !== selectedCategory) | ||||||
| ); | ||||||
| setSelectedCategory(''); | ||||||
| handlePopupClose(); | ||||||
| }} | ||||||
| /> | ||||||
| )} | ||||||
| </div> | ||||||
| ); | ||||||
| }; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||
| import { useRef, useState } from 'react'; | ||||||
| import { Icon } from '@pinback/design-system/icons'; | ||||||
| import { CommonBtn } from '@pinback/design-system/ui'; | ||||||
| import { Input } from '@pinback/design-system/ui'; | ||||||
| import { CommonBtn, Input } from '@pinback/design-system/ui'; | ||||||
| import { useRef, useState } from 'react'; | ||||||
|
|
||||||
| type Mode = 'add' | 'edit' | 'delete'; | ||||||
|
|
||||||
|
|
@@ -159,7 +158,7 @@ const TextfieldPopup = ({ | |||||
| }; | ||||||
|
|
||||||
| return ( | ||||||
| <div className="fixed inset-0 z-50 flex items-center justify-center"> | ||||||
| <div className="absolute inset-0 z-50 flex items-center justify-center rounded-[10px] bg-[#00000063]"> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainpositioning 변경사항을 확인해주세요.
추가된 배경 오버레이( 다음 스크립트로 이 컴포넌트를 사용하는 부모 컨테이너들의 스타일링을 확인해주세요: 🏁 Script executed: #!/bin/bash
# Description: 부모 컨테이너들이 적절한 positioning을 가지고 있는지 확인
# TextfieldPopup을 사용하는 파일들 검색
echo "=== TextfieldPopup을 사용하는 파일들 ==="
rg -l "TextfieldPopup|TextFieldPopup" --type tsx --type ts
# ModalPop 컴포넌트들에서 TextfieldPopup 사용 컨텍스트 확인
echo "=== ModalPop에서 TextfieldPopup 사용 컨텍스트 ==="
rg -A 10 -B 5 "TextfieldPopup|TextFieldPopup" apps/client/src/shared/components/ui/modalPop/ModalPop.tsx apps/extension/src/components/modalPop/ModalPop.tsxLength of output: 5668 다음 스크립트로 🏁 Script executed: #!/bin/bash
echo "=== apps/client/src/shared/components/ui/modalPop/ModalPop.tsx – 최상위 컨테이너 className ==="
rg "className=" -n apps/client/src/shared/components/ui/modalPop/ModalPop.tsx | head -n 20
echo
echo "=== apps/extension/src/components/modalPop/ModalPop.tsx – 최상위 컨테이너 className ==="
rg "className=" -n apps/extension/src/components/modalPop/ModalPop.tsx | head -n 20Length of output: 1988 TextFieldPopup의 절대 위치 지정 이슈: extension ModalPop에 client 쪽 ModalPop 최상위 컨테이너에는 이미 수정이 필요한 위치:
제안하는 변경(diff 예시): - <div className="flex h-[54.7rem] w-[32rem] flex-col items-center justify-between rounded-[1rem] bg-white px-[2rem] py-[2rem]">
+ <div className="relative flex h-[54.7rem] w-[32rem] flex-col items-center justify-between rounded-[1rem] bg-white px-[2rem] py-[2rem]">배경 오버레이( 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| <div className="flex w-[26rem] flex-col rounded-xl bg-white p-[2rem] shadow-[6px_11px_20px_0_rgba(0,0,0,0.08)]"> | ||||||
| {renderContent()} | ||||||
| </div> | ||||||
|
|
||||||
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.
중복 z-index 클래스 문제를 해결해야 합니다.
동일한 요소에 두 개의 z-index 클래스가 적용되고 있습니다. CSS 우선순위에 따라
z-100이 적용되지만, 이는 혼란을 야기할 수 있습니다.다음 diff를 적용하여 중복을 제거하세요:
또는 상수 값을 사용하려면:
📝 Committable suggestion
🤖 Prompt for AI Agents