Skip to content

Commit d360edf

Browse files
authored
학생회 요구사항으로 인한 브랜치 최신화 (#291)
2 parents e6896a3 + 43729e5 commit d360edf

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

service-manager/src/components/apply-list/ApplyCount.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ interface ApplyCountProps {
1313
export const ApplyCount = ({ eventId, sector }: ApplyCountProps) => {
1414
const { sectorSettingData } = useSectorQueryById(eventId);
1515
const { registrations } = useAllRegistrationQuery(eventId);
16+
1617
const applicantNumber =
17-
registrations?.filter((data) => data.sectorNum === sector) ?? 0;
18+
registrations?.filter((data) => data.sectorNum === sector) ?? [];
1819
const limit = sectorSettingData?.find((data) => data.sectorNumber === sector);
20+
const noCompactCount = registrations?.filter((data) => !data.isCompact)
21+
.length;
1922

2023
return (
2124
<div className="flex flex-col gap-2">
@@ -31,6 +34,9 @@ export const ApplyCount = ({ eventId, sector }: ApplyCountProps) => {
3134
0,
3235
)}명 / ${limit?.reserve ?? 0}명`}
3336
</Txt>
37+
<Txt size="h6" color="black">
38+
{`경차 아닌 학생 정원: ${noCompactCount}명 / ${registrations.length}명`}
39+
</Txt>
3440
</div>
3541
);
3642
};

service-manager/src/components/apply-list/ApplyList.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import { Suspense, useState } from 'react';
22
import { Button } from '@quokka/design-system';
33

44
import {
@@ -7,6 +7,7 @@ import {
77
} from '../../hooks/react-query/useRegistration';
88
import { useSectorQueryById } from '../../hooks/react-query/useSetting';
99
import { ApplyCount } from './ApplyCount';
10+
import ErrorBoundary from '../common/ErrorBoundary';
1011

1112
interface ApplyListProps {
1213
eventId: string;
@@ -67,7 +68,11 @@ export const ApplyList = ({ eventId }: ApplyListProps) => {
6768
</div>
6869
<div className="w-full">
6970
<div className="flex justify-between align-bottom">
70-
<ApplyCount eventId={eventId} sector={selectedSector} />
71+
<ErrorBoundary>
72+
<Suspense>
73+
<ApplyCount eventId={eventId} sector={selectedSector} />
74+
</Suspense>
75+
</ErrorBoundary>
7176
<div className="text-right my-5">
7277
<Button
7378
size="small"
@@ -82,6 +87,7 @@ export const ApplyList = ({ eventId }: ApplyListProps) => {
8287
</Button>
8388
</div>
8489
</div>
90+
<div className="mb-4" />
8591
<table className="w-full min-w-[50rem]">
8692
<thead>
8793
<tr>
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import { useParams } from 'react-router-dom';
22
import { ApplyList } from '../../components/apply-list/ApplyList';
3+
import ErrorBoundary from '../../components/common/ErrorBoundary';
4+
import { Suspense } from 'react';
35

46
export const ApplyListPage = () => {
57
const { eventId } = useParams();
68
if (!eventId) return <div>잘못된 접근입니다.</div>;
79

8-
return <ApplyList eventId={eventId} />;
10+
return (
11+
<ErrorBoundary>
12+
<Suspense>
13+
<ApplyList eventId={eventId} />
14+
</Suspense>
15+
</ErrorBoundary>
16+
);
917
};

0 commit comments

Comments
 (0)