-
Notifications
You must be signed in to change notification settings - Fork 2
✨ Feat: create card modal 카드 생성 모달 구현 #82
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
a6e7d6e
9a7e32b
4d10040
9a3875d
1d422c9
9365403
38a70ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||||||||||
| import Header from '@components/common/header/Header' | ||||||||||||
|
|
||||||||||||
| import Sidebar from '@/app/shared/components/common/sidebar/Sidebar' | ||||||||||||
|
Comment on lines
+1
to
+3
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. 🛠️ Refactor suggestion import 경로 일관성 개선 필요 Header와 Sidebar의 import 경로가 일관되지 않습니다. 둘 다 같은 패턴을 사용하는 것이 좋습니다. -import Header from '@components/common/header/Header'
-
-import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'
+import Header from '@/app/shared/components/common/header/Header'
+import Sidebar from '@/app/shared/components/common/sidebar/Sidebar'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
|
|
||||||||||||
| export default function AboutLayout({ | ||||||||||||
| children, | ||||||||||||
| }: { | ||||||||||||
| children: React.ReactNode | ||||||||||||
| }) { | ||||||||||||
| return ( | ||||||||||||
| <div> | ||||||||||||
| {/* <Sidebar /> */} | ||||||||||||
| <Header /> | ||||||||||||
| <div>{children}</div> {/* 여기에 page.tsx 내용이 들어옴 */} | ||||||||||||
| </div> | ||||||||||||
| ) | ||||||||||||
| } | ||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,18 +1,21 @@ | ||||||||||||||||||||||||
| 'use client' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import Image from 'next/image' | ||||||||||||||||||||||||
| import { useParams } from 'next/navigation' | ||||||||||||||||||||||||
| import { useRef } from 'react' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import useColumns from '@/app/api/useColumns' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import { useCardMutation } from './api/useCardMutation' | ||||||||||||||||||||||||
| import Column from './Column/Column' | ||||||||||||||||||||||||
| import { useDragStore } from './store/useDragStore' | ||||||||||||||||||||||||
| import type { Card } from './type/Card' | ||||||||||||||||||||||||
| import { useCardMutation } from '@/app/features/dashboard_Id/api/useCardMutation' | ||||||||||||||||||||||||
| import useColumns from '@/app/features/dashboard_Id/api/useColumns' | ||||||||||||||||||||||||
| import Column from '@/app/features/dashboard_Id/Column/Column' | ||||||||||||||||||||||||
| import { useDragStore } from '@/app/features/dashboard_Id/store/useDragStore' | ||||||||||||||||||||||||
| import { Card } from '@/app/features/dashboard_Id/type/Card.type' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| export default function DashboardID() { | ||||||||||||||||||||||||
| const dashboard = 15120 | ||||||||||||||||||||||||
| const { data: columns, isLoading, error } = useColumns(dashboard) | ||||||||||||||||||||||||
| const params = useParams() | ||||||||||||||||||||||||
| const dashboardId = Number(params.id) | ||||||||||||||||||||||||
| const { data: columns, isLoading, error } = useColumns(dashboardId) | ||||||||||||||||||||||||
|
Comment on lines
+14
to
+16
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. 🛠️ Refactor suggestion 타입 안전성을 개선해주세요.
const params = useParams()
- const dashboardId = Number(params.id)
+ const dashboardId = params.id ? Number(params.id) : null
+
+ if (!dashboardId || isNaN(dashboardId)) {
+ return <div>잘못된 대시보드 ID입니다.</div>
+ }
+
const { data: columns, isLoading, error } = useColumns(dashboardId)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| // const { data: columns, isLoading, error } = useColumns(id) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const { draggingCard, setDraggingCard } = useDragStore() | ||||||||||||||||||||||||
| const cardMutation = useCardMutation() | ||||||||||||||||||||||||
| const touchPos = useRef({ x: 0, y: 0 }) | ||||||||||||||||||||||||
|
|
@@ -124,10 +127,9 @@ export default function DashboardID() { | |||||||||||||||||||||||
| if (error) return <p>error...{error.message}</p> | ||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||
| <div className="fixed left-0 h-1080 w-300 bg-gray-100">사이드바</div> | ||||||||||||||||||||||||
| <div className="ml-300 select-none"> | ||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||
| className="tablet:flex-col flex" | ||||||||||||||||||||||||
| className="flex min-h-[calc(100vh-100px)] tablet:flex-col" | ||||||||||||||||||||||||
| onTouchStart={handleTouchStart} | ||||||||||||||||||||||||
| onTouchMove={handleTouchMove} | ||||||||||||||||||||||||
| onTouchEnd={handleTouchEnd} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| import { cn } from '@/app/shared/lib/cn' | ||||||||||||||||||||||||||||||||||||||||||||
| const mockData = ['aaa', 'bbb', 'ccc'] | ||||||||||||||||||||||||||||||||||||||||||||
|
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. 🛠️ Refactor suggestion 목 데이터를 실제 데이터로 교체 필요 하드코딩된 목 데이터 대신 실제 멤버 데이터를 사용해야 합니다. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| interface AssigneeListProps { | ||||||||||||||||||||||||||||||||||||||||||||
| setSelectedAssignee: React.Dispatch<React.SetStateAction<string>> | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| export default function AssigneeList({ | ||||||||||||||||||||||||||||||||||||||||||||
| setSelectedAssignee, | ||||||||||||||||||||||||||||||||||||||||||||
| }: AssigneeListProps) { | ||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||
| <div className="BG-white Border-btn Text-gray absolute left-0 top-full z-10 mt-4 w-full rounded-6 text-14"> | ||||||||||||||||||||||||||||||||||||||||||||
| {mockData.map((Assignee, index) => ( | ||||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||||
| className={cn( | ||||||||||||||||||||||||||||||||||||||||||||
| 'BG-Input-hovered w-full cursor-pointer px-16 py-11 pt-14 placeholder-gray-400 caret-transparent', | ||||||||||||||||||||||||||||||||||||||||||||
| index !== 0 && 'border-t', | ||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||
| key={index} | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+18
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. 🛠️ Refactor suggestion 변수명과 키 사용 개선 필요 몇 가지 문제점이 있습니다:
- {mockData.map((Assignee, index) => (
+ {mockData.map((assignee, index) => (
<div
className={cn(
'BG-Input-hovered w-full cursor-pointer px-16 py-11 pt-14 placeholder-gray-400 caret-transparent',
index !== 0 && 'border-t',
)}
- key={index}
+ key={assignee}
onClick={() => {
- setSelectedAssignee(Assignee)
- console.log(Assignee)
+ setSelectedAssignee(assignee)
}}
>
- {Assignee}
+ {assignee}
</div>
))}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => { | ||||||||||||||||||||||||||||||||||||||||||||
| setSelectedAssignee(Assignee) | ||||||||||||||||||||||||||||||||||||||||||||
| console.log(Assignee) | ||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| {Assignee} | ||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||||||||||||||||||||||
| </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.
date-picker 사용해주셨군용!