Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"@dnd-kit/core": "^6.3.1",
"@tanstack/react-query": "^5.80.2",
"axios": "^1.9.0",
"clsx": "^2.1.1",
"next": "14.2.25",
"next-themes": "^0.4.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.57.0",
"sonner": "^2.0.5",
"tailwind-merge": "^3.3.0",
"tailwindcss-preset-px-to-rem": "^1.2.1",
"zustand": "^5.0.5"
},
Expand Down
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/collaborator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/crown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/invitation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/management.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/profile.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/app/dashboard/[id]/edit/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Header from '@components/common/header/Header'

export default function AboutLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<div>
<Header />
<div>{children}</div> {/* 여기에 page.tsx 내용이 들어옴 */}
</div>
)
}
3 changes: 3 additions & 0 deletions src/app/dashboard/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function dashBoardEditPage() {
return <p>대시보드 수정 페이지</p>
}
3 changes: 3 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { Providers } from './providers'
export const metadata: Metadata = {
title: 'Coplan',
description: 'Generated by create next app',
icons: {
icon: '/favicon.png',
},
}

export default function RootLayout({
Expand Down
87 changes: 87 additions & 0 deletions src/app/shared/components/common/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
'use client'

import { useUserStore } from '@store/useUserStore' // Zustand 예시
import { usePathname, useRouter } from 'next/navigation'
import Link from 'next/link'
import Image from 'next/image'

export default function Header() {
const pathname = usePathname()
const router = useRouter()
const goToMypage = () => {
router.push('/mypage')
}
const { user, logout } = useUserStore() // Zustand 상태

return (
<header className="flex items-center justify-between border-b border-gray-200 bg-white px-36 py-16 dark:border-gray-700 dark:bg-black">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 global.css에 작성해둔 커스텀 유틸 클래스
BG-white, Border-section 사용하시면 더 간결하게 다크모드 적용 가능합니다!
혹시 직접 특정 색상을 사용하고 싶으셨던 건가요??

Copy link
Contributor Author

@yuj2n yuj2n Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 임시로 적어둔 거라 추후 수정할 계획입니당!!

{/* 좌측 대시보드명 */}
<div className="flex items-center gap-8">
<div className="font-bold">대시보드 명</div>
<div className="relative h-12 w-14 overflow-hidden">
<Image src="/images/crown.png" fill alt="내가 만든 대시보드" />
</div>
</div>

{/* 우측 사용자 정보/다크모드 */}
<div className="flex items-center gap-16">
<>
<nav className="hidden gap-8 text-sm text-gray-600 dark:text-gray-300 md:flex">
<Link
href="/dashboard"
className={`flex items-center gap-6 rounded-md border-2 border-solid px-8 py-4 ${pathname === '/dashboard' ? 'font-semibold' : ''}`}
>
<div className="relative flex size-12">
<Image src="/images/management.png" fill alt="관리 버튼" />
</div>
관리
</Link>
<Link
href="/modal"
className={`flex items-center gap-6 rounded-6 border-2 border-solid px-8 py-4 ${pathname === '/modal' ? 'font-semibold' : ''}`}
>
<div className="relative flex size-12">
<Image src="/images/invitation.png" fill alt="초대 버튼" />
</div>
초대하기
</Link>
</nav>
{/* 공동작업자 프로필 이미지 */}
<div className="relative size-48 overflow-hidden rounded-full">
<Image
src="/images/collaborator.png"
fill
alt="초대된 사용자"
style={{ objectFit: 'cover' }}
/>
</div>
<div className="relative size-48 overflow-hidden rounded-full">
<Image
src="/images/collaborator.png"
fill
alt="초대된 사용자"
style={{ objectFit: 'cover' }}
/>
</div>
|{/* 내 프로필 이미지 */}
<div className="relative size-48 overflow-hidden rounded-full">
<Image
src="/images/profile.gif"
fill
alt="프로필이미지"
style={{ objectFit: 'cover' }}
/>
</div>
<span className="text-sm">배유철 {user?.name}</span>
{/* 드롭다운 메뉴 */}
<button onClick={goToMypage} className="text-xs">
마이페이지
</button>
<button onClick={logout} className="text-xs">
로그아웃
</button>
</>
</div>
</header>
)
}
26 changes: 26 additions & 0 deletions src/app/shared/store/useUserStore.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 저도 비슷하게 작성하고 있어서 제가 PR 올리기 전에 같이 살펴보고 결정하는 게 좋을 거 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!!

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// store/useUserStore.ts
import { create } from 'zustand'
import { persist } from 'zustand/middleware'

import { User } from '../types/User.interface'

interface UserState {
user: User | null
accessToken: string | null
setUser: (user: User, accessToken: string) => void
logout: () => void // clearUser와 동일
}

export const useUserStore = create<UserState>()(
persist(
(set) => ({
user: null,
accessToken: null,
setUser: (user, accessToken) => set({ user, accessToken }),
logout: () => set({ user: null, accessToken: null }),
}),
{
name: 'user-storage',
},
),
)
9 changes: 9 additions & 0 deletions src/app/shared/types/user.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface User {
id: number
name: string
email: string
avatarUrl?: string // optional
role?: 'user' | 'admin' // optional 예시
createdAt?: string // optional ISO date string
updatedAt?: string // optional ISO date string
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// alias 설정
"@/*": ["./src/*"],
"@components/*": ["./src/app/shared/components/*"],
"@store/*": ["./src/app/shared/store/*"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store로 바로 연결할 수 있게 추가해주셨군요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아무래도 자주 사용할 것 같아서 추가해놨습니당

"@hooks/*": ["./src/app/shared/hooks/*"]
}
},
Expand Down
Loading