Skip to content

Commit

Permalink
feat: 아코디언 컴포넌트 기본 상태값 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
corinthionia committed Dec 8, 2024
1 parent fd93af1 commit dc7eb39
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 49 deletions.
5 changes: 4 additions & 1 deletion src/components/commons/accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ const Accordion = ({

return (
<Wrapper>
<Group onClick={handleClickAccordion}>
<Group
onClick={handleClickAccordion}
className={isCollapsed ? 'collapsed' : 'expanded'}
>
<GroupInfo>{title}</GroupInfo>
{!!totalCount && (
<AccordionIcon
Expand Down
70 changes: 22 additions & 48 deletions src/pages/result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,54 +163,28 @@ const Result = () => {
</NobodyWrapper>
) : null}

{data?.candidateTimes
.slice(0, 1)
.map(
({
date,
dayOfWeek,
startTime,
endTime,
availableParticipantNames,
unavailableParticipantNames,
}: CandidateTimesType) => (
<Candidate
key={`part ${date} ${startTime} ${endTime}`}
date={date}
dayOfWeek={dayOfWeek}
startTime={startTime}
endTime={endTime}
availableParticipantNames={availableParticipantNames}
unavailableParticipantNames={unavailableParticipantNames}
count={participants.length}
defaultOpen={true}
/>
)
)}

{data?.candidateTimes
.slice(1)
.map(
({
date,
dayOfWeek,
startTime,
endTime,
availableParticipantNames,
unavailableParticipantNames,
}: CandidateTimesType) => (
<Candidate
key={`part ${date} ${startTime} ${endTime}`}
date={date}
dayOfWeek={dayOfWeek}
startTime={startTime}
endTime={endTime}
availableParticipantNames={availableParticipantNames}
unavailableParticipantNames={unavailableParticipantNames}
count={participants.length}
/>
)
)}
{data?.candidateTimes.map(
({
date,
dayOfWeek,
startTime,
endTime,
availableParticipantNames,
unavailableParticipantNames,
}: CandidateTimesType) => (
<Candidate
key={`part ${date} ${startTime} ${endTime}`}
date={date}
dayOfWeek={dayOfWeek}
startTime={startTime}
endTime={endTime}
availableParticipantNames={availableParticipantNames}
unavailableParticipantNames={unavailableParticipantNames}
count={participants.length}
defaultOpen={true}
/>
)
)}
</>
)}
</Body>
Expand Down

0 comments on commit dc7eb39

Please sign in to comment.