Skip to content

Commit 3fcc41d

Browse files
committed
refact: 수정사항 반영
1 parent d7a64a1 commit 3fcc41d

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

src/features/dashboard/model/store/ParticipantStore.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export const useParticipantStore = create<ParicipantState>((set, get) => ({
2020
all: false,
2121
participants: {},
2222
approvedParticipants: {},
23-
selectedTicketId: 0,
24-
selectedOrderId: 0,
23+
selectedTicketId: null,
24+
selectedOrderId: null,
2525

2626
// 초기 데이터 세팅
2727
initializeParticipants: participantList => {

src/features/dashboard/ui/IndividualResponseViewer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ const IndividualResponseViewer = ({ orders, currentIndex, setCurrentIndex }: Ind
5353
<div key={optionName} className="border border-gray-300 rounded-md p-4 mb-4 bg-white shadow-sm">
5454
<p className="font-semibold mb-2">{optionName}</p>
5555
{optionType === 'TEXT' ? (
56-
<UnderlineTextField
57-
label={""}
58-
value={answers[0]}
59-
onChange={() => { }}
60-
className="mb-0"
61-
/>
56+
<div className="mb-4">
57+
<p className="w-full border-b border-gray-300 py-2 px-1 text-sm font-semibold text-gray-800">
58+
{answers[0]}
59+
</p>
60+
</div>
6261
) : (
6362
<ul className="space-y-1">
63+
6464
{answers.map((ans, idx) => (
6565
<li key={idx}>
6666
<Checkbox

src/features/dashboard/ui/PariticipantsList.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useParticipantStore } from '../model/store/ParticipantStore';
55
import { participantsData } from '../../../shared/types/participantInfoType';
66
import { usePersonalTicketOptionAnswers } from '../../ticket/hooks/useTicketOptionHook';
77
import OrderAnswerModal from '../../../widgets/dashboard/ui/response/OrderAnswerModal';
8+
import { Order } from '../../ticket/model/ticketInformation';
89

910
interface ParticipantsListProps {
1011
listType: 'all' | 'approved' | 'pending';
@@ -27,7 +28,7 @@ const ParticipantsList = ({ listType, selectedFilter = [], participants }: Parti
2728

2829
const { data } = usePersonalTicketOptionAnswers(selectedTicketId);
2930
const [isModalOpen, setModalOpen] = useState(false);
30-
const [selectedOrder, setSelectedOrder] = useState<any>(null);
31+
const [selectedOrder, setSelectedOrder] = useState<Order | null>(null);
3132

3233
const handleCheckClick = (ticketId: number, orderId: number) => {
3334
setSelectedTicketId(ticketId);
@@ -71,10 +72,6 @@ const ParticipantsList = ({ listType, selectedFilter = [], participants }: Parti
7172
return false;
7273
});
7374

74-
useEffect(() => {
75-
initializeParticipants(participants);
76-
}, [participants, initializeParticipants]);
77-
7875
return (
7976
<div className="flex flex-col gap-2 mb-4">
8077
<div className="flex justify-between text-xs text-[#888686] bg-white shadow-sm px-2 md:px-3 py-3 rounded-t-lg">

src/features/dashboard/ui/ResponsesList.tsx

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,35 @@ const ResponsesList = ({ listType, ticketOptionResponses, ticketId }: ResponsesL
5959
const renderList = () => {
6060
switch (listType) {
6161
case 'summary':
62-
const filteredResponses = ticketOptionResponses.filter(
63-
(option) => option.optionType !== 'TEXT'
64-
);
65-
console.log(filteredResponses)
66-
return (
67-
<>
68-
<div className="flex justify-center">
69-
<div style={{ minWidth: '300px', maxWidth: '600px', width: '100%' }}>
70-
<MultiplePieCharts responses={filteredResponses} />
62+
{
63+
const filteredResponses = ticketOptionResponses.filter(
64+
(option) => option.optionType !== 'TEXT'
65+
);
66+
return (
67+
<>
68+
<div className="flex justify-center">
69+
<div style={{ minWidth: '300px', maxWidth: '600px', width: '100%' }}>
70+
<MultiplePieCharts responses={filteredResponses} />
71+
</div>
7172
</div>
72-
</div>
73-
{renderTextResponses(ticketOptionResponses)}
74-
</>
75-
);
73+
{renderTextResponses(ticketOptionResponses)}
74+
</>
75+
);
76+
}
7677

7778
case 'individual':
78-
if (isLoading) return <p>로딩 중...</p>;
79-
if (error || !data?.result) return <p>데이터를 불러오지 못했습니다.</p>;
80-
const allOrders = data.result.flatMap(user => user.orders);
81-
return (
82-
<IndividualResponseViewer
83-
orders={allOrders}
84-
currentIndex={currentIndex}
85-
setCurrentIndex={setCurrentIndex}
86-
/>
87-
);
79+
{
80+
if (isLoading) return <p>로딩 중...</p>;
81+
if (error || !data?.result) return <p>데이터를 불러오지 못했습니다.</p>;
82+
const allOrders = data.result.flatMap(user => user.orders);
83+
return (
84+
<IndividualResponseViewer
85+
orders={allOrders}
86+
currentIndex={currentIndex}
87+
setCurrentIndex={setCurrentIndex}
88+
/>
89+
);
90+
}
8891
default:
8992
return null;
9093
}

src/features/ticket/model/orderInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface OrderTicketRequest {
44
ticketId: number;
55
eventId: number;
66
ticketCnt: number;
7-
ticketOptionAnswers: TicketOptionAnswerRequest[][];
7+
ticketOptionAnswers?: TicketOptionAnswerRequest[][];
88
}
99
export interface TicketConfirm {
1010
id: number;

src/widgets/event/ui/TicketInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const TicketInfo = ({ eventId }: { eventId: number }) => {
6969
// 옵션 없음 → 바로 결제
7070
handleDirectOrder(ticketId, eventId, ticketCnt);
7171
}
72-
} catch (e) {
72+
} catch {
7373
alert('옵션 정보를 불러오는 중 오류가 발생했습니다.');
7474
}
7575
};

0 commit comments

Comments
 (0)