diff --git a/public/images/back.png b/public/images/back.png new file mode 100644 index 0000000..add81c0 Binary files /dev/null and b/public/images/back.png differ diff --git a/public/images/invitation-white.png b/public/images/invitation-white.png new file mode 100644 index 0000000..bf3ac10 Binary files /dev/null and b/public/images/invitation-white.png differ diff --git a/public/images/next.png b/public/images/next.png new file mode 100644 index 0000000..8c6c5c0 Binary files /dev/null and b/public/images/next.png differ diff --git a/public/images/prev.png b/public/images/prev.png new file mode 100644 index 0000000..b13ea1a Binary files /dev/null and b/public/images/prev.png differ diff --git a/src/app/dashboard/[id]/edit/components/EditInfo.tsx b/src/app/dashboard/[id]/edit/components/EditInfo.tsx new file mode 100644 index 0000000..a4f5eb1 --- /dev/null +++ b/src/app/dashboard/[id]/edit/components/EditInfo.tsx @@ -0,0 +1,3 @@ +export default function EditInfo() { + return

대시보드 수정 페이지

+} diff --git a/src/app/dashboard/[id]/edit/components/EditInvitation.tsx b/src/app/dashboard/[id]/edit/components/EditInvitation.tsx new file mode 100644 index 0000000..ffa2750 --- /dev/null +++ b/src/app/dashboard/[id]/edit/components/EditInvitation.tsx @@ -0,0 +1,3 @@ +export default function EditInvitation() { + return

대시보드 초대 수정 페이지

+} diff --git a/src/app/dashboard/[id]/edit/components/EditMember.tsx b/src/app/dashboard/[id]/edit/components/EditMember.tsx new file mode 100644 index 0000000..3cf5295 --- /dev/null +++ b/src/app/dashboard/[id]/edit/components/EditMember.tsx @@ -0,0 +1,3 @@ +export default function EditMember() { + return

대시보드 멤버 수정 페이지

+} diff --git a/src/app/dashboard/[id]/edit/page.tsx b/src/app/dashboard/[id]/edit/page.tsx index c4903d2..63530c2 100644 --- a/src/app/dashboard/[id]/edit/page.tsx +++ b/src/app/dashboard/[id]/edit/page.tsx @@ -1,24 +1,37 @@ 'use client' +import EditInfo from '@dashboard/components/edit/EditInfo' +import EditInvitation from '@dashboard/components/edit/EditInvitation' +import EditMember from '@dashboard/components/edit/EditMember' import { showError, showSuccess } from '@lib/toast' +import Image from 'next/image' export default function DashBoardEditPage() { const handleSuccess = () => { - showSuccess('대시보드가 성공적으로 저장되었습니다.') + showSuccess('대시보드가 성공적으로 수정되었습니다.') } const handleError = () => { - showError('저장 중 오류가 발생했습니다.') + showError('수정 중 오류가 발생했습니다.') } return ( -
-

대시보드 수정 페이지

- -
- - +
+
window.history.back()} + > + 돌아가기 +

돌아가기

+
+
+ + +
+
) } diff --git a/src/app/features/dashboard/components/edit/EditInfo.tsx b/src/app/features/dashboard/components/edit/EditInfo.tsx new file mode 100644 index 0000000..1053973 --- /dev/null +++ b/src/app/features/dashboard/components/edit/EditInfo.tsx @@ -0,0 +1,129 @@ +import api from '@lib/axios' +import Image from 'next/image' +import { useRouter } from 'next/navigation' +import React, { useEffect, useState } from 'react' + +import { DASHBOARD_COLORS } from '@/app/shared/constants/colors' +import { CreateDashboardRequest } from '@/app/shared/types/dashboard' + +export default function EditInfo() { + const router = useRouter() + const [formData, setFormData] = useState({ + title: '', + color: DASHBOARD_COLORS[0], + }) + + const [isSubmitting, setIsSubmitting] = useState(false) + + /// 입력값 변경 처리 + const handleChange = (e: React.ChangeEvent) => { + const { name, value } = e.target + setFormData((prev) => ({ + ...prev, + [name]: value, + })) + } + // 색상 선택 처리 + const handleColorSelect = (color: string) => { + setFormData((prev) => ({ ...prev, color })) + } + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + + if (!formData.title || !formData.color) { + return + } + try { + setIsSubmitting(true) + + if (!process.env.NEXT_PUBLIC_TEAM_ID) { + throw new Error('NEXT_PUBLIC_TEAM_ID 환경변수가 설정되지 않았습니다.') + } + + const response = await api.post( + `/${process.env.NEXT_PUBLIC_TEAM_ID}/dashboards`, + formData, + ) + + const data = response.data + + // 성공 시 대시보드 상세 페이지로 이동 + router.push(`/dashboard/${data.id}`) + } catch (error) { + console.error('대시보드 생성 오류:', error) + } finally { + setIsSubmitting(false) + } + } + + return ( +
+ {/* 컨테이너 */} +
+

새로운 대시보드

+ +
+ {/* 제목 입력 */} +
+ + +
+ + {/* 색상 선택 */} +
+
+ {DASHBOARD_COLORS.map((color) => ( + + ))} +
+
+ + {/* 하단 버튼 */} +
+ +
+
+
+
+ ) +} diff --git a/src/app/features/dashboard/components/edit/EditInvitation.tsx b/src/app/features/dashboard/components/edit/EditInvitation.tsx new file mode 100644 index 0000000..b247cf5 --- /dev/null +++ b/src/app/features/dashboard/components/edit/EditInvitation.tsx @@ -0,0 +1,67 @@ +import { UserInfo } from '@components/common/UserInfo' +import { cn } from '@lib/cn' +import Image from 'next/image' +import Link from 'next/link' +import { usePathname } from 'next/navigation' +import React from 'react' + +import { mockMembers } from './mockMember' + +export default function EditInvitation() { + const pathname = usePathname() + return ( +
+ {/* 컨테이너 */} +
+
+

초대 내역

+ +
+

1 페이지 중 1

+ 이전 + 다음 + +
+ 초대 버튼 +
+

초대하기

+ +
+
+ +
+ +
+ {mockMembers.map((member, index) => ( +
+ + +
+ ))} +
+
+
+
+ ) +} diff --git a/src/app/features/dashboard/components/edit/EditMember.tsx b/src/app/features/dashboard/components/edit/EditMember.tsx new file mode 100644 index 0000000..674cc34 --- /dev/null +++ b/src/app/features/dashboard/components/edit/EditMember.tsx @@ -0,0 +1,48 @@ +import Image from 'next/image' +import React from 'react' + +import { UserInfo } from '@/app/shared/components/common/UserInfo' + +import { mockMembers } from './mockMember' + +export default function EditMember() { + return ( +
+ {/* 컨테이너 */} +
+
+

구성원

+ +
+

1 페이지 중 1

+ 이전 + 다음 +
+
+ +
+ +
+ {mockMembers.map((member, index) => ( +
+ + +
+ ))} +
+
+
+
+ ) +} diff --git a/src/app/features/dashboard/components/edit/mockMember.js b/src/app/features/dashboard/components/edit/mockMember.js new file mode 100644 index 0000000..473e07d --- /dev/null +++ b/src/app/features/dashboard/components/edit/mockMember.js @@ -0,0 +1,24 @@ +// mockMember.js + +export const mockMembers = [ + { + nickname: '민준', + imageUrl: '/images/profile.gif', + }, + { + nickname: '서연', + imageUrl: null, + }, + { + nickname: 'James', + imageUrl: null, + }, + { + nickname: '나연 ', + imageUrl: '/images/profile.gif', + }, + { + nickname: 'Emily', + imageUrl: null, + }, +] diff --git a/src/app/globals.css b/src/app/globals.css index f03d8e3..3ea873b 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -40,6 +40,9 @@ body { .Text-error { @apply text-[#D6173A]; } +.Text-btn { + @apply text-[#5FBBFF] dark:text-[#228DFF]; +} .Border-error { @apply border border-[#D6173A]; } diff --git a/src/app/shared/components/common/UserInfo.tsx b/src/app/shared/components/common/UserInfo.tsx index f4a06c9..e4b7201 100644 --- a/src/app/shared/components/common/UserInfo.tsx +++ b/src/app/shared/components/common/UserInfo.tsx @@ -4,7 +4,7 @@ import { Avatar } from './Avatar' type UserInfoProps = { nickname: string - imageUrl?: string + imageUrl?: string | null size?: number } diff --git a/src/app/shared/components/common/header/Header.tsx b/src/app/shared/components/common/header/Header.tsx index 3cd1de8..64bb68a 100644 --- a/src/app/shared/components/common/header/Header.tsx +++ b/src/app/shared/components/common/header/Header.tsx @@ -13,7 +13,7 @@ export default function Header() { const pathname = usePathname() return ( -
+
{/* 좌측 대시보드명 */}
@@ -41,7 +41,7 @@ export default function Header() { @@ -52,8 +52,8 @@ export default function Header() { {/* 협업자 목록 */} - | -
+ +
{/* 사용자 정보 드롭다운 */} {/* 다크모드 토글 */} diff --git a/src/app/shared/components/common/sidebar/modal/CreateDashboardModal.tsx b/src/app/shared/components/common/sidebar/modal/CreateDashboardModal.tsx index 837ae65..437b430 100644 --- a/src/app/shared/components/common/sidebar/modal/CreateDashboardModal.tsx +++ b/src/app/shared/components/common/sidebar/modal/CreateDashboardModal.tsx @@ -1,14 +1,13 @@ 'use client' +import { DASHBOARD_COLORS } from '@constants/colors' +import api from '@lib/axios' +import { useModalStore } from '@store/useModalStore' import Image from 'next/image' import { useRouter } from 'next/navigation' import React, { useEffect, useState } from 'react' -import api from '@/app/shared/lib/axios' -import { useModalStore } from '@/app/shared/store/useModalStore' -import { CreateDashboardRequest } from '@/app/shared/types/dashboard' - -const DASHBOARD_COLORS = ['#10B981', '#8B5CF6', '#F59E0B', '#3B82F6', '#EC4899'] +import { CreateDashboardRequest } from '@/types/dashboard' export default function CreateDashboardModal() { const router = useRouter() @@ -46,7 +45,10 @@ export default function CreateDashboardModal() { throw new Error('NEXT_PUBLIC_TEAM_ID 환경변수가 설정되지 않았습니다.') } - const response = await api.post(`/${process.env.NEXT_PUBLIC_TEAM_ID}/dashboards`, formData) + const response = await api.post( + `/${process.env.NEXT_PUBLIC_TEAM_ID}/dashboards`, + formData, + ) const data = response.data diff --git a/src/app/shared/constants/colors.ts b/src/app/shared/constants/colors.ts new file mode 100644 index 0000000..1b52dcb --- /dev/null +++ b/src/app/shared/constants/colors.ts @@ -0,0 +1,9 @@ +// src/app/shared/constants/colors.ts + +export const DASHBOARD_COLORS = [ + '#10B981', // green + '#8B5CF6', // violet + '#F59E0B', // yellow + '#3B82F6', // blue + '#EC4899', // pink +] diff --git a/tsconfig.json b/tsconfig.json index 59cce61..b53700b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,7 +26,10 @@ "@components/*": ["./src/app/shared/components/*"], "@store/*": ["./src/app/shared/store/*"], "@hooks/*": ["./src/app/shared/hooks/*"], - "@lib/*": ["./src/app/shared/lib/*"] + "@lib/*": ["./src/app/shared/lib/*"], + "@/types/*": ["./src/app/shared/types/*"], + "@constants/*": ["./src/app/shared/constants/*"], + "@dashboard/*": ["./src/app/features/dashboard/*"] } }, "include": [