Skip to content

Commit

Permalink
Trailing ? and prop name
Browse files Browse the repository at this point in the history
  • Loading branch information
farisashai committed Mar 30, 2024
1 parent f13e8c3 commit b6df3fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/events/EventCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface EventCarouselProps {
attendances: PublicAttendance[];
placeholder: string;
className?: string;
linkFilters?: FilterEventOptions;
initialEventFilters?: FilterEventOptions;
}

const EventCarousel = ({
Expand All @@ -29,8 +29,10 @@ const EventCarousel = ({
attendances,
placeholder,
className = '',
linkFilters = {},
initialEventFilters = {},
}: EventCarouselProps) => {
const eventQueryParams = new URLSearchParams(initialEventFilters).toString();

return (
<div className={`${styles.wrapper} ${className}`}>
<div className={styles.header}>
Expand All @@ -41,7 +43,7 @@ const EventCarousel = ({
</div>
<Link
className={styles.viewToggle}
href={`${config.eventsRoute}?${new URLSearchParams(linkFilters).toString()}`}
href={`${config.eventsRoute}${eventQueryParams ? `?${eventQueryParams}` : ''}`}
>
See all events &gt;
</Link>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const PortalHomePage = ({

<EventCarousel
title="Upcoming Events"
linkFilters={{ date: 'upcoming' }}
initialEventFilters={{ date: 'upcoming' }}
titleClassName={styles.subheading}
events={upcomingEvents}
attendances={attendance}
Expand All @@ -159,7 +159,7 @@ const PortalHomePage = ({
/>

<EventCarousel
linkFilters={{ attended: 'attended', date: 'all-time' }}
initialEventFilters={{ attended: 'attended', date: 'all-time' }}
title="Recently Attended Events"
titleClassName={styles.subheading}
events={attendedEvents}
Expand Down

0 comments on commit b6df3fa

Please sign in to comment.