Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 19, 2024
1 parent b06bb86 commit 8e3ba6e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
7 changes: 5 additions & 2 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ export const Footer = () => {
This website is a non-profit, volunteer run initiative.
<br />
<Link url="/feedback" className={styles.link}>
Leave feedback here
Leave feedback here
</Link>{' '}
or send an email to{' '}
<Link url="mailto:[email protected]" className={styles.link}>
<Link
url="mailto:[email protected]"
className={styles.link}
>
[email protected]
</Link>
.
Expand Down
59 changes: 34 additions & 25 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,22 @@ export default function Home({ groups }: { groups: Group[] }) {
threshold: 0.2,
matchAllTokens: false,
tokenize: true,
keys: ['name', 'description', 'tags', 'details']
}
const fuse = new Fuse(groups, searchOptions)
keys: ['name', 'description', 'tags', 'details'],
};

const fuse = new Fuse(groups, searchOptions);

const filteredGroups = useMemo(() => {
if (searchQuery.length > 2) {
const searchResults = fuse.search(searchQuery);
const searchResultGroups = searchResults.map((result: any) => result.item);
return filterGroups(searchResultGroups, selectedGroupTags, selectedWeekday);
const searchResultGroups = searchResults.map(
(result: any) => result.item,
);
return filterGroups(
searchResultGroups,
selectedGroupTags,
selectedWeekday,
);
}
return filterGroups(groups, selectedGroupTags, selectedWeekday);
}, [groups, selectedGroupTags, selectedWeekday, searchQuery]);
Expand All @@ -97,17 +103,23 @@ export default function Home({ groups }: { groups: Group[] }) {
open to newcomers.
</p>
<div className={styles.searchAndFilterContainer}>
<input className={styles.searchInput} type="text" placeholder="Search" onChange={handleSearch} value={searchQuery} />
<input
className={styles.searchInput}
type="text"
placeholder="Search"
onChange={handleSearch}
value={searchQuery}
/>
<button
className={styles.filterAccordionToggle}
onClick={toggleFilter}
>
{filterIsOpen ? 'Hide' : 'Show'} filter options
<ExpandIcon
className={styles.filterIcon}
pointDownwards={!filterIsOpen}
/>
</button>
className={styles.filterAccordionToggle}
onClick={toggleFilter}
>
{filterIsOpen ? 'Hide' : 'Show'} filter options
<ExpandIcon
className={styles.filterIcon}
pointDownwards={!filterIsOpen}
/>
</button>
</div>
<div className={styles.filterAccordion}>
{filterIsOpen && (
Expand Down Expand Up @@ -193,8 +205,6 @@ export default function Home({ groups }: { groups: Group[] }) {
))}
</div>
</div>


</div>
</div>
)}
Expand All @@ -208,11 +218,10 @@ export default function Home({ groups }: { groups: Group[] }) {
/>

{(selectedGroupTags.length !== 0 ||
selectedWeekday !== 'All' || searchQuery !== '') && (
selectedWeekday !== 'All' ||
searchQuery !== '') && (
<button
className={
styles.clearSelectedTagsButton
}
className={styles.clearSelectedTagsButton}
onClick={clearAllFilters}
>
Clear all filters
Expand All @@ -239,9 +248,9 @@ export default function Home({ groups }: { groups: Group[] }) {
<h2>Ad-hoc groups</h2>
<p className={styles.description}>
These groups may host an event on the day
you&apos;ve specified, on an ad-hoc basis. Please check the groups
website, social media page or group chat for
more information.{' '}
you&apos;ve specified, on an ad-hoc basis.
Please check the groups website, social media
page or group chat for more information.{' '}
</p>
</div>
<GroupListingFeed
Expand Down

0 comments on commit 8e3ba6e

Please sign in to comment.