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
1 change: 0 additions & 1 deletion package-lock.json

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

Binary file added public/images/defaultBookClub.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AuthImage from '@/features/auth/container/auth-image/AuthImage';

function Login() {
return (
<div className="mx-auto flex w-full flex-1 flex-col items-center justify-center px-4 lg:flex-row lg:justify-between">
<div className="flex w-full flex-1 flex-col items-center justify-center px-4 lg:flex-row lg:justify-between">
<AuthImage isLoginPage={true} />
<Suspense fallback={<div>Loading...</div>}>
<LoginForm />
Expand Down
4 changes: 3 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { BookClubMainPage } from '@/features/bookclub/components';

export default function Home() {
return (
<div>
<h3>hello world</h3>
<BookClubMainPage />
</div>
);
}
2 changes: 1 addition & 1 deletion src/app/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ProfilePage from '@/features/profile/components/ProfilePage';
import ProfilePage from '@/features/profile/container/ProfilePage';
import React from 'react';

const Profile = () => {
Expand Down
75 changes: 46 additions & 29 deletions src/components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function Card(props: CardProps) {
case 'defaultClub':
default: {
const {
clubId,
imageUrl,
imageAlt,
title,
Expand All @@ -211,10 +212,11 @@ function Card(props: CardProps) {
max,
isPast,
isCanceled,
meetingType,
// meetingType,
bookClubType,
onClick,
onDelete,
status,
clubStatus,
} = props as DefaultClubCard & { variant: 'defaultClub' };

return (
Expand All @@ -227,11 +229,14 @@ function Card(props: CardProps) {
onLikeClick={onLikeClick}
/>

<Card.Box onClick={onClick} className="justify-between">
<Card.Box
onClick={() => onClick(clubId)}
className="justify-between"
>
<div className="flex flex-col gap-0.5">
<div className="flex justify-between">
<Card.Title>{title}</Card.Title>
<ClubChip variant={meetingType} isPast={isPast} />
<ClubChip variant={bookClubType} isPast={isPast} />
</div>
<div className="flex items-center gap-1.5">
<Card.Location>{location}</Card.Location>
Expand All @@ -246,30 +251,32 @@ function Card(props: CardProps) {
max={max}
isPast={isPast}
/>
<ClubChip variant={status} isPast={isPast} />
<ClubChip variant={clubStatus} isPast={isPast} />
</div>
<ProgressBar
percentage={(current / max) * 100}
isPast={isPast}
/>
</div>
</Card.Box>
{isCanceled && <Card.Overlay onDelete={onDelete} />}
{isCanceled && <Card.Overlay onDelete={() => onDelete()} />}
</div>
);
}

case 'participatedClub': {
const {
clubId,
imageUrl,
imageAlt,
isLiked,
onLikeClick,
// isLiked,
// onLikeClick,
isCanceled,
onClick,
onDelete,
status,
meetingType,
clubStatus,
// meetingType,
bookClubType,
title,
location,
datetime,
Expand All @@ -283,17 +290,20 @@ function Card(props: CardProps) {
<Card.Image
url={imageUrl}
alt={imageAlt}
isLiked={isLiked}
onLikeClick={onLikeClick}
// isLiked={isLiked}
// onLikeClick={onLikeClick}
/>
<Card.Box onClick={onClick} className="justify-between">
<Card.Box
onClick={() => onClick(clubId)}
className="justify-between"
>
<div className="flex flex-col gap-2.5">
<div className="flex justify-between">
<div className="flex gap-2">
<ClubChip variant={isPast ? 'completed' : 'scheduled'} />
<ClubChip variant={status} />
<ClubChip variant={clubStatus} />
</div>
<ClubChip variant={meetingType} />
<ClubChip variant={bookClubType} />
</div>
<div className="flex flex-col">
<Card.Title>{title}</Card.Title>
Expand Down Expand Up @@ -324,26 +334,28 @@ function Card(props: CardProps) {
lightColor="gray-normal-01"
onClick={(e) => {
e.stopPropagation();
onCancel();
onCancel(clubId);
}}
className="w-full"
/>
)}
</div>
</div>
</Card.Box>
{isCanceled && <Card.Overlay onDelete={onDelete} />}
{isCanceled && <Card.Overlay onDelete={() => onDelete(clubId)} />}
</div>
);
}

case 'hostedClub': {
const {
clubId,
imageUrl,
imageAlt,
onClick,
status,
meetingType,
clubStatus,
// meetingType,
bookClubType,
isPast,
title,
location,
Expand All @@ -355,11 +367,14 @@ function Card(props: CardProps) {
return (
<div className="flex flex-col gap-6 md:flex-row">
<Card.Image url={imageUrl} alt={imageAlt} />
<Card.Box onClick={onClick} className="justify-between">
<Card.Box
onClick={() => onClick(clubId)}
className="justify-between"
>
<div className="flex flex-col gap-2.5">
<div className="flex justify-between">
<ClubChip variant={isPast ? 'completed' : status} />
<ClubChip variant={meetingType} />
<ClubChip variant={isPast ? 'completed' : clubStatus} />
<ClubChip variant={bookClubType} />
</div>
<div className="flex flex-col">
<Card.Title>{title}</Card.Title>
Expand Down Expand Up @@ -413,19 +428,21 @@ function Card(props: CardProps) {

case 'detailedClub': {
const {
clubId,
imageUrl,
imageAlt,
title,
location,
datetime,
isLiked,
onLikeClick,
meetingType,
// meetingType,
bookClubType,
current,
max,
isPast,
host,
status,
clubStatus,
participants,
onClick,
isHost,
Expand Down Expand Up @@ -542,13 +559,13 @@ function Card(props: CardProps) {
/>

<Card.Box
onClick={onClick}
className="cursor-default justify-between"
onClick={() => onClick(clubId)}
className="justify-between"
>
<div className="flex flex-col gap-0.5">
<div className="flex justify-between">
<Card.Title>{title}</Card.Title>
<ClubChip variant={meetingType} isPast={isPast} />
<ClubChip variant={bookClubType} isPast={isPast} />
</div>
<div className="flex items-center gap-1.5">
<Card.Location>{location}</Card.Location>
Expand All @@ -574,7 +591,7 @@ function Card(props: CardProps) {
))}
</AvatarGroup>
</div>
<ClubChip variant={status} isPast={isPast} />
<ClubChip variant={clubStatus} isPast={isPast} />
</div>
<ProgressBar
percentage={(current / max) * 100}
Expand All @@ -598,7 +615,7 @@ function Card(props: CardProps) {
>
<article
className={twMerge(
'relative flex h-full w-full min-w-[336px] flex-col',
'relative flex h-full min-w-[336px] flex-col md:w-full',
)}
>
{renderCardContent()}
Expand Down
10 changes: 6 additions & 4 deletions src/components/card/ClubCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const meta = {
control: 'select',
options: ['FREE', 'FIXED'],
},
status: {
clubStatus: {
control: 'select',
options: ['completed', 'scheduled', 'pending', 'confirmed', 'closed'],
options: ['pending', 'confirmed', 'closed'],
},
},
tags: ['autodocs'],
Expand All @@ -28,12 +28,14 @@ const baseArgs = {
// ClubCard 기본 인터페이스의 속성들
imageUrl: 'https://picsum.photos/400/300',
imageAlt: '모임 이미지',
clubId: 45,
title: '을지로 독서 모임',
location: '을지로 3가',
datetime: '12/14(토) 오전 10:00',
meetingType: 'FREE' as const,
meetingType: 'OFFLINE' as const,
bookClubType: 'FREE' as const,
isPast: false,
status: 'confirmed' as const,
clubStatus: 'confirmed' as const,
onClick: () => alert('카드 클릭!'),
} as const;

Expand Down
16 changes: 9 additions & 7 deletions src/components/card/types/clubCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ interface ClubCard {
imageAlt?: string;

// 모임 정보
clubId: number;
title: string;
location: string;
datetime: string;
meetingType: 'FREE' | 'FIXED';
meetingType: 'ONLINE' | 'OFFLINE';
bookClubType: 'FREE' | 'FIXED';
isPast: boolean; // 지난 모임인지 아닌지
status: 'completed' | 'scheduled' | 'pending' | 'confirmed' | 'closed'; // 개설 현황
clubStatus: 'pending' | 'confirmed' | 'closed'; // 개설 현황

// 액션 (카드 클릭시 라우터 처리 등)
onClick: () => void;
onClick: (clubId: number) => void;
}

interface DefaultClubCard extends ClubCard {
Expand All @@ -31,16 +33,16 @@ interface DefaultClubCard extends ClubCard {

interface ParticipatedClubCard extends ClubCard {
// 찜 정보
isLiked: boolean;
onLikeClick: () => void;
// isLiked: boolean;
// onLikeClick: () => void;

// 취소 정보 (블러)
isCanceled: boolean;
onDelete: () => void;
onDelete: (clubId: number) => void;

// 버튼 액션
onWriteReview: () => void; // 리뷰 작성
onCancel: () => void; // 모임 취소
onCancel: (clubId: number) => void; // 모임 취소
}

interface HostedClubCard extends ClubCard {
Expand Down
10 changes: 3 additions & 7 deletions src/components/header/HeaderBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { useEffect } from 'react';
import React from 'react';
import NavButton from './NavButton';
import { NAV_ITEMS } from '@/constants/navigation';
import { usePathname, useRouter } from 'next/navigation';
Expand All @@ -10,18 +10,14 @@ import { logout } from '@/features/auth/api/auth';

function HeaderBar() {
const pathname = usePathname();
const { isLoggedIn, user, checkLoginStatus } = useAuthStore();
const { isLoggedIn, user } = useAuthStore();
const router = useRouter();

useEffect(() => {
checkLoginStatus();
}, [checkLoginStatus]);

const handleDropDownChange = async (value: string | undefined) => {
if (value === 'LOGOUT') {
try {
await logout();
router.replace('/exchange');
router.replace('/bookclub');
} catch (error) {
console.error('로그아웃 실패:', error);
}
Expand Down
23 changes: 23 additions & 0 deletions src/components/pop-up-button/PopUpButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const THEME_COLOR = {
cancel: 'border border-orange-600 bg-white text-orange-600 mr-[8px]',
confirm: 'bg-orange-600 text-white',
};

interface PopUpButtonProps {
isConfirm: boolean;
// onClick: (
// event: MouseEvent<HTMLButtonElement> | MouseEvent<HTMLDivElement>,
// ) => void;
}

function PopUpButton({ isConfirm }: PopUpButtonProps) {
return (
<button
className={`h-[44px] w-[120px] rounded-lg ${isConfirm ? THEME_COLOR.confirm : THEME_COLOR.cancel}`}
>
{isConfirm ? '확인' : '취소'}
</button>
);
}

export default PopUpButton;
2 changes: 1 addition & 1 deletion src/constants/navigation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const NAV_ITEMS = [
{ id: 'bookco', href: '/exchange', label: 'bookco' },
{ id: 'bookco', href: '/bookclub', label: 'bookco' },
{ id: 'bookclub', href: '/bookclub', label: '책 모임' },
{ id: 'exchange', href: '/exchange', label: '책 교환' },
{ id: 'wish', href: '/wish', label: '찜 목록' },
Expand Down
Loading
Loading