Skip to content

Commit

Permalink
fix: 개요 내 합계 표시
Browse files Browse the repository at this point in the history
  • Loading branch information
FourwingsY committed Apr 6, 2024
1 parent c714cc6 commit f236389
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/modals/QuestSummarySheet/QuestSummarySheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ export default function QuestSummarySheet({ questId, visible, close }: Props) {
<S.Cell>{building.places.filter((p) => p.isClosed || p.isNotAccessible).length}</S.Cell>
</tr>
))}
<tr style={{ fontWeight: "bold" }}>
<S.Cell style={{ textAlign: "left", lineHeight: 1.5 }}>합계</S.Cell>
<S.Cell>{quest?.buildings.reduce((acc, b) => acc + b.places.length, 0)}</S.Cell>
<S.Cell>
{quest?.buildings.reduce((acc, b) => acc + b.places.filter((p) => p.isConquered).length, 0)}
</S.Cell>
<S.Cell>
{quest?.buildings.reduce(
(acc, b) => acc + b.places.filter((p) => p.isClosed || p.isNotAccessible).length,
0,
)}
</S.Cell>
</tr>
</tbody>
</S.BuildingTable>
</S.TableWrapper>
Expand Down

0 comments on commit f236389

Please sign in to comment.