Skip to content

Commit

Permalink
feat: add enrollments/availabilities counter to event show page (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruilopesm authored Oct 16, 2023
1 parent 99e3f63 commit 6dae3cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
12 changes: 4 additions & 8 deletions apps/app/components/Availability/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import Link from "next/link";

const { Title } = Typography;

function Availability({
title,
buttonTitle,
mentors,
available,
setAvailable,
}: any) {
function Availability({ title, mentors, available, setAvailable }: any) {
return (
<>
<Row style={{ display: "flex", justifyContent: "space-between" }}>
<Title level={2}>{title}</Title>
<Title level={2}>
{title} ({mentors.length})
</Title>
<Switch
defaultChecked={available}
style={{ float: "right" }}
Expand Down
4 changes: 1 addition & 3 deletions apps/app/pages/admin/event/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ function EventPage() {
{available ? (
<Availability
title="Mentores disponíveis"
buttonTitle="Mentores indisponíveis"
mentors={availableMentors}
available={available}
setAvailable={setAvailable}
/>
) : (
<Availability
title="Mentores indisponíveis"
buttonTitle="Mentores disponíveis"
mentors={unavailableMentors}
available={available}
setAvailable={setAvailable}
Expand All @@ -80,7 +78,7 @@ function EventPage() {
</>
<Divider />
<Col>
<Title level={2}>Ninjas inscritos</Title>
<Title level={2}>Ninjas inscritos ({enrolledNinjas.length})</Title>
<List
itemLayout="vertical"
dataSource={enrolledNinjas}
Expand Down
2 changes: 1 addition & 1 deletion apps/app/pages/event/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function EventPage() {
</>
) : (
<>
<Title level={2}>Ninjas inscritos</Title>
<Title level={2}>Ninjas inscritos ({enrolledNinjas.length})</Title>
<List
itemLayout="vertical"
dataSource={enrolledNinjas}
Expand Down

0 comments on commit 6dae3cb

Please sign in to comment.