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
133 changes: 111 additions & 22 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,148 @@
import Card from '@/components/shared/card';

// GroupListItemResponse 타입
// {
// id: number;
// title: string;
// location: string;
// locationDetail?: string | null;
// startTime: string; // ISO 8601 형식: "2026-12-25T19:00:00"
// endTime?: string | null; // ISO 8601 형식: "2026-12-25T21:00:00"
// images: string[]; // 이미지 URL 배열
// tags: string[];
// description: string;
// participantCount: number;
// maxParticipants: number;
// createdBy: {
// userId: number;
// nickName: string;
// profileImage: string | null;
// };
// createdAt: string; // ISO 8601 형식
// updatedAt: string; // ISO 8601 형식
// }

const formatDateTime = (startTime: string, _endTime?: string | null): string => {
const start = new Date(startTime);
const year = start.getFullYear().toString().slice(-2);
const month = String(start.getMonth() + 1).padStart(2, '0');
const day = String(start.getDate()).padStart(2, '0');
const hours = String(start.getHours()).padStart(2, '0');
const minutes = String(start.getMinutes()).padStart(2, '0');

return `${year}. ${month}. ${day} - ${hours}:${minutes}`;
};

const MOCK_MEETINGS = [
{
id: 1,
title: '네즈코와 무한성에서 정모 하실 분',
images: [],
location: '네즈코 호수공원',
dateTime: '25. 11. 28 - 10:00',
nickName: 'Hope Lee',
locationDetail: '호수공원 입구 근처',
startTime: '2025-11-28T10:00:00',
endTime: '2025-11-28T12:00:00',
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
tags: ['젠이츠', '기유', '네즈코'],
description: '네즈코와 무한성에서 정모 하실 분들을 모집합니다.',
participantCount: 8,
maxParticipants: 10,
tags: ['#태그', '#태그', '#태그'],
createdBy: {
userId: 1,
nickName: 'Hope Lee',
profileImage: null,
},
createdAt: '2025-11-20T14:29:06',
updatedAt: '2025-11-20T14:29:06',
},
{
id: 2,
title: '주말 러닝 크루 모집',
images: [],
location: '한강공원 잠실지구',
dateTime: '25. 12. 05 - 07:30',
nickName: 'Minseo Kim',
locationDetail: '잠실나루역 2번 출구',
startTime: '2025-12-05T07:30:00',
endTime: '2025-12-05T09:30:00',
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
tags: ['러닝', '아침운동'],
description: '주말 아침 한강에서 함께 러닝하실 분들을 모집합니다.',
participantCount: 5,
maxParticipants: 12,
tags: ['#러닝', '#아침운동'],
createdBy: {
userId: 2,
nickName: 'Minseo Kim',
profileImage: null,
},
createdAt: '2025-11-25T10:15:00',
updatedAt: '2025-11-25T10:15:00',
},
{
id: 3,
title: '동네 책모임 신규 멤버 구함',
images: [],
location: '망원동 카페 거리',
dateTime: '25. 12. 10 - 19:30',
nickName: 'Book Lover',
locationDetail: '망원역 1번 출구 근처',
startTime: '2025-12-10T19:30:00',
endTime: '2025-12-10T21:30:00',
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
tags: ['책모임', '수다환영'],
description: '동네에서 책을 읽고 이야기 나누는 모임입니다.',
participantCount: 3,
maxParticipants: 8,
tags: ['#책모임', '#수다환영'],
createdBy: {
userId: 3,
nickName: 'Book Lover',
profileImage: null,
},
createdAt: '2025-12-01T09:00:00',
updatedAt: '2025-12-01T09:00:00',
},
{
id: 4,
title: '퇴근 후 보드게임 번개',
images: [],
location: '홍대입구역 인근',
dateTime: '25. 12. 02 - 20:00',
nickName: 'Board Master',
locationDetail: '홍대입구역 9번 출구',
startTime: '2025-12-02T20:00:00',
endTime: '2025-12-02T23:00:00',
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
tags: ['보드게임', '처음이어도환영'],
description: '퇴근 후 보드게임으로 스트레스 풀어요!',
participantCount: 6,
maxParticipants: 10,
tags: ['#보드게임', '#처음이어도환영'],
createdBy: {
userId: 4,
nickName: 'Board Master',
profileImage: null,
},
createdAt: '2025-11-28T18:30:00',
updatedAt: '2025-11-28T18:30:00',
},
{
id: 5,
title: '주말 등산 같이 가요',
images: [],
location: '북한산 입구',
dateTime: '25. 12. 07 - 09:00',
nickName: 'Hiker Lee',
locationDetail: '북한산 우이역 1번 출구',
startTime: '2025-12-07T09:00:00',
endTime: '2025-12-07T15:00:00',
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
tags: ['등산', '초보환영'],
description: '주말에 북한산 등산 같이 가실 분 모집합니다.',
participantCount: 4,
maxParticipants: 15,
tags: ['#등산', '#초보환영'],
createdBy: {
userId: 5,
nickName: 'Hiker Lee',
profileImage: null,
},
createdAt: '2025-11-30T12:00:00',
updatedAt: '2025-11-30T12:00:00',
},
];

Expand All @@ -65,12 +153,13 @@ export default function HomePage() {
{MOCK_MEETINGS.map((meeting) => (
<Card
key={meeting.id}
dateTime={meeting.dateTime}
dateTime={formatDateTime(meeting.startTime, meeting.endTime)}
images={meeting.images}
location={meeting.location}
maxParticipants={meeting.maxParticipants}
nickName={meeting.nickName}
nickName={meeting.createdBy.nickName}
participantCount={meeting.participantCount}
profileImage={meeting.createdBy.profileImage}
tags={meeting.tags}
title={meeting.title}
/>
Expand Down
4 changes: 3 additions & 1 deletion src/app/schedule/(components)/current.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const MOCK_MEETINGS: Meeting[] = [
{
id: 1,
title: '네즈코와 무한성에서 정모 하실 분',
images: [],
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
location: '네즈코 호수공원',
dateTime: '25. 11. 28 - 10:00',
nickName: 'Hope Lee',
Expand Down
6 changes: 3 additions & 3 deletions src/app/schedule/(components)/empty-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '@/components/ui';
import { cn } from '@/lib/utils';

type EmptyStateProps = {
type: 'current' | 'my' | 'history';
type: 'current' | 'myPost' | 'past';
onButtonClick: () => void;
};

Expand All @@ -15,12 +15,12 @@ const EMPTY_STATE_CONFIG = {
buttonText: '모임 보러가기',
buttonWidth: 'w-[124px]',
},
my: {
myPost: {
text: '아직 생성한 모임이 없어요.\n지금 바로 모임을 만들어보세요!',
buttonText: '모임 만들기',
buttonWidth: 'w-[112px]',
},
history: {
past: {
text: '아직 참여한 모임이 없어요.\n마음에 드는 모임을 발견해보세요!',
buttonText: '모임 보러가기',
buttonWidth: 'w-[124px]',
Expand Down
4 changes: 2 additions & 2 deletions src/app/schedule/(components)/history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export default function History() {
return (
<MeetingList
emptyStatePath='/'
emptyStateType='history'
emptyStateType='past'
meetings={MOCK_MEETINGS}
showActions={false}
tabType='history'
tabType='past'
/>
);
}
8 changes: 5 additions & 3 deletions src/app/schedule/(components)/my.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const MOCK_MEETINGS: Meeting[] = [
{
id: 2,
title: '주말 러닝 크루 모집',
images: [],
images: [
'https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=717&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
],
location: '한강공원 잠실지구',
dateTime: '25. 12. 05 - 07:30',
nickName: 'Minseo Kim',
Expand All @@ -21,11 +23,11 @@ export default function My() {
return (
<MeetingList
emptyStatePath='/post-meetup'
emptyStateType='my'
emptyStateType='myPost'
leaveActionText='모임 취소'
meetings={MOCK_MEETINGS}
showActions={true}
tabType='my'
tabType='myPost'
/>
);
}
2 changes: 1 addition & 1 deletion src/app/schedule/(components)/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export type Meeting = {
tags: string[];
};

export type TabType = 'current' | 'my' | 'history';
export type TabType = 'current' | 'myPost' | 'past';
8 changes: 4 additions & 4 deletions src/app/schedule/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import My from './(components)/my';

const SCHEDULE_TABS = [
{ label: '현재 모임', value: 'current' },
{ label: '나의 모임', value: 'my' },
{ label: '모임 이력', value: 'history' },
{ label: '나의 모임', value: 'myPost' },
{ label: '모임 이력', value: 'past' },
];

const ScheduleContent = () => {
Expand All @@ -23,8 +23,8 @@ const ScheduleContent = () => {
return (
<>
{tab === 'current' && <Current />}
{tab === 'my' && <My />}
{tab === 'history' && <History />}
{tab === 'myPost' && <My />}
{tab === 'past' && <History />}
</>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type CardProps = {
onLeave: () => void;
onChat: () => void;
};
tabType?: 'current' | 'my' | 'history';
tabType?: 'current' | 'myPost' | 'past';
};

const calculateProgress = (count: number, max: number): number => {
Expand Down Expand Up @@ -59,8 +59,8 @@ const Card = ({
const hasThumbnail = !!thumbnail && !imageError;
const cardTags = convertToCardTags(tags);
const progress = calculateProgress(participantCount, maxParticipants);
const shouldShowButtons = leaveAndChatActions && tabType !== 'history';
const leaveButtonText = tabType === 'my' ? '모임 취소' : '모임 탈퇴';
const shouldShowButtons = leaveAndChatActions && tabType !== 'past';
const leaveButtonText = tabType === 'myPost' ? '모임 취소' : '모임 탈퇴';

return (
<div
Expand Down