Skip to content

Commit 138a310

Browse files
authored
Merge pull request #77 from YAPP-Github/design/#68-yj
fix/#68 QA
2 parents 3bc12a6 + 05f622a commit 138a310

File tree

4 files changed

+38
-14
lines changed

4 files changed

+38
-14
lines changed

src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const geistMono = Geist_Mono({
1414
});
1515

1616
export const metadata: Metadata = {
17-
title: 'Create Next App',
18-
description: 'Generated by create next app',
17+
title: 'MOIT | 모두의 만남을 잇다, 모잇',
18+
description: '모잇으로 모임 일정을 쉽게 조율해보세요',
1919
};
2020

2121
export default function RootLayout({

src/app/meet/[meetingId]/page.tsx

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Metadata } from 'next';
12
import Link from 'next/link';
23

34
import { getMeetingById } from '@/entities/meet/api/getMeetingById';
@@ -10,16 +11,44 @@ import { VoteResultDataView } from '@/widgets/vote-result/ui/VoteResultDataView'
1011

1112
import ParticipantHeader from './ParticipantHeader';
1213

14+
interface PageProps {
15+
params: Promise<{
16+
meetingId: string;
17+
}>;
18+
}
19+
20+
export async function generateMetadata({
21+
params,
22+
}: PageProps): Promise<Metadata> {
23+
const { meetingId } = await params;
24+
25+
try {
26+
const meetingData = await getMeetingById(meetingId);
27+
return {
28+
title: `${meetingData.hostName}님이 초대한 ${meetingData.title}`,
29+
description: 'MOIT | 모두의 만남을 잇다, 모잇',
30+
};
31+
} catch {
32+
return {
33+
title: 'MOIT | 모두의 만남을 잇다, 모잇',
34+
description: '모잇으로 모임 일정을 쉽게 조율해보세요',
35+
};
36+
}
37+
}
38+
1339
// Transform Logic
1440
function getStatsFromParticipants(
1541
candidateDates: string[],
1642
participants: Participant[],
1743
) {
44+
// 투표한 참여자만 필터링
45+
const votedParticipants = participants.filter((p) => p.hasVoted);
46+
1847
return candidateDates.map((date) => {
1948
const can: Person[] = [];
2049
const cannot: Person[] = [];
2150

22-
participants.forEach((p) => {
51+
votedParticipants.forEach((p) => {
2352
if (p.voteDates.includes(date)) {
2453
can.push({ id: String(p.id), name: p.name });
2554
} else {
@@ -35,13 +64,7 @@ function getStatsFromParticipants(
3564
});
3665
}
3766

38-
interface ResultPageProps {
39-
params: Promise<{
40-
meetingId: string;
41-
}>;
42-
}
43-
44-
export default async function ResultPage({ params }: ResultPageProps) {
67+
export default async function ResultPage({ params }: PageProps) {
4568
const { meetingId } = await params;
4669
// Fetch meeting data from API
4770
const meetingData = await getMeetingById(meetingId);

src/entities/meet/dto/meet.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const participantDto = z.object({
3535
id: z.number(),
3636
name: z.string(),
3737
voteDates: z.array(z.string()),
38+
hasVoted: z.boolean(),
3839
});
3940

4041
/**

src/features/vote-results-calendar/ui/VoteResultsShell.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ export function VoteResultsShell({
2626
// Scroll to detail when opened
2727
useEffect(() => {
2828
if (selectedDate && detailRef.current) {
29-
calendarRef?.current?.scrollIntoView({
29+
detailRef.current.scrollIntoView({
3030
behavior: 'smooth',
31-
block: 'start',
31+
block: 'end',
3232
});
3333
}
34-
}, [selectedDate, calendarRef]);
34+
}, [selectedDate]);
3535

3636
return (
3737
<div className='flex flex-col gap-6' ref={calendarRef}>
@@ -44,7 +44,7 @@ export function VoteResultsShell({
4444
{selectedDate && (
4545
<div
4646
ref={detailRef}
47-
className='animate-in slide-in-from-top-4 fade-in rounded-xl border border-slate-100 bg-white p-6 shadow-sm duration-300'
47+
className='animate-in slide-in-from-top-4 fade-in scroll-mb-24 rounded-xl border border-slate-100 bg-white p-6 shadow-sm duration-300'
4848
>
4949
<div className='mb-6 flex items-start justify-between'>
5050
<div>

0 commit comments

Comments
 (0)