diff --git a/src/features/profile/components/MainContent.tsx b/src/features/profile/container/MainContent.tsx similarity index 67% rename from src/features/profile/components/MainContent.tsx rename to src/features/profile/container/MainContent.tsx index cb24dd8c..483ebc3b 100644 --- a/src/features/profile/components/MainContent.tsx +++ b/src/features/profile/container/MainContent.tsx @@ -2,14 +2,15 @@ import Tab from '@/components/tab/Tab'; import { CONTENT_TABS, ContentTab } from '@/constants'; import { useState } from 'react'; -import ClubContents from './clubs/ClubContents'; -import ExchangeContents from './exchange/ExchangeContents'; +import { ClubContents } from '../container'; +import ExchangeContents from '../components/exchange/ExchangeContents'; +import { ProfilePageProps } from '../types'; -function MainContent() { +function MainContent({ user }: ProfilePageProps) { const [selectedTab, setSelectedTab] = useState(CONTENT_TABS[0]); return ( -
+
{selectedTab === CONTENT_TABS[0] ? ( - + ) : ( )} diff --git a/src/features/profile/container/ProfileHeader.tsx b/src/features/profile/container/ProfileHeader.tsx new file mode 100644 index 00000000..305a9329 --- /dev/null +++ b/src/features/profile/container/ProfileHeader.tsx @@ -0,0 +1,14 @@ +import { ProfilePageProps } from '../types'; +import { Profile } from '../components/profile'; + +export default function ProfileHeader({ user }: ProfilePageProps) { + return ( +
+ {/* TODO: 프로필 페이지가 로그인된 유저의 프로필 페이지와 일치 여부 확인 후 마이페이지 or **님의 페이지 */} + + 마이 페이지 + + +
+ ); +} diff --git a/src/features/profile/components/ProfilePage.tsx b/src/features/profile/container/ProfilePage.tsx similarity index 72% rename from src/features/profile/components/ProfilePage.tsx rename to src/features/profile/container/ProfilePage.tsx index a010bf05..f246ad0e 100644 --- a/src/features/profile/components/ProfilePage.tsx +++ b/src/features/profile/container/ProfilePage.tsx @@ -1,8 +1,7 @@ 'use client'; -import MainContent from './MainContent'; -import ProfileHeader from './ProfileHeader'; import { useAuthStore } from '@/store/authStore'; +import { MainContent, ProfileHeader } from '../container'; function ProfilePage() { const { user } = useAuthStore(); @@ -10,7 +9,7 @@ function ProfilePage() { return (
- +
); } diff --git a/src/features/profile/container/index.ts b/src/features/profile/container/index.ts index cb0ff5c3..35ae0bdc 100644 --- a/src/features/profile/container/index.ts +++ b/src/features/profile/container/index.ts @@ -1 +1,4 @@ -export {}; +export { default as ClubContents } from './ClubContents'; +export { default as MainContent } from './MainContent'; +export { default as ProfileHeader } from './ProfileHeader'; +export { default as Profile } from './ProfilePage'; diff --git a/src/features/profile/types/index.ts b/src/features/profile/types/index.ts index c948e72e..c7010aab 100644 --- a/src/features/profile/types/index.ts +++ b/src/features/profile/types/index.ts @@ -1,4 +1,13 @@ -import User from './user'; +export interface User { + teamId: string; + id: number; + email: string; + name: string; + description?: string | null; + image?: string | null; + createdAt: Date; + updatedAt: Date; +} export interface ProfilePageProps { user: User | null; @@ -6,6 +15,25 @@ export interface ProfilePageProps { export interface ProfileEditData { name: string; - companyName?: string; + description?: string; image?: string | null; } + +//TODO: isCanceled, imageUrl. isPast, status 수정 +export interface BookClub { + clubId: number; + title: string; + description: string; + meetingType: 'ONLINE' | 'OFFLINE'; + bookClubType: 'FREE' | 'FIXED'; + targetDate: string; + endDate: string; + memberLimit: number; + town: string; + memberCount: number; + isLiked: boolean; + isCanceled: boolean; + imageUrl: string; + isPast: boolean; + clubStatus: 'pending' | 'confirmed' | 'closed'; +} diff --git a/src/features/profile/types/user.ts b/src/features/profile/types/user.ts index 2c5c42f5..81ab2bc2 100644 --- a/src/features/profile/types/user.ts +++ b/src/features/profile/types/user.ts @@ -1,10 +1,10 @@ -export default interface User { - teamId: string; - id: number; - email: string; - name: string; - description?: string | null; - image?: string | null; - createdAt: Date; - updatedAt: Date; -} +// export default interface User { +// teamId: string; +// id: number; +// email: string; +// name: string; +// description?: string | null; +// image?: string | null; +// createdAt: Date; +// updatedAt: Date; +// } diff --git a/src/middleware.ts b/src/middleware.ts index 1b764c86..91fcba4a 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,7 +1,7 @@ import { NextResponse } from 'next/server'; import type { NextRequest } from 'next/server'; -const AUTH_REQUIRED_PATHS = ['/wish', '/profile']; +const AUTH_REQUIRED_PATHS = ['/wish', '/profile', '/bookclub/create']; export function middleware(request: NextRequest) { const { pathname } = request.nextUrl; @@ -24,5 +24,5 @@ export function middleware(request: NextRequest) { } export const config = { - matcher: ['/wish', '/profile', '/login'], + matcher: ['/wish', '/profile', '/login', '/bookclub/create'], };