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.

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
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;
Loading
Loading