-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/UTDNebula/jupiter into d…
…evelop
- Loading branch information
Showing
15 changed files
with
302 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client'; | ||
import { api } from '@src/trpc/react'; | ||
import type { SelectClub as Club } from '@src/server/db/models'; | ||
import { type Session } from 'next-auth'; | ||
import ClubCard from '@src/components/club/ClubCard'; | ||
|
||
interface ClubSearchComponentProps { | ||
userSearch: string; | ||
session: Session | null; | ||
} | ||
|
||
export const ClubSearchComponent = ({ | ||
userSearch, | ||
session, | ||
}: ClubSearchComponentProps) => { | ||
const { data } = api.club.byNameNoLimit.useQuery( | ||
{ name: userSearch }, | ||
{ enabled: !!userSearch }, | ||
); | ||
|
||
if (!data) { | ||
return <p />; | ||
} | ||
if (data.length === 0) { | ||
return ( | ||
<div className="text-center text-4xl font-bold text-slate-500"> | ||
No Search Results Found | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="grid w-full auto-rows-fr grid-cols-[repeat(auto-fill,320px)] justify-center gap-16 pb-4"> | ||
{data.map((club: Club) => ( | ||
<ClubCard key={club.id} club={club} session={session} priority /> | ||
))} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Header from '@src/components/header/BaseHeader'; | ||
import { ClubSearchComponent } from './ClubSearch'; | ||
import { getServerAuthSession } from '@src/server/auth'; | ||
|
||
type Params = { | ||
searchParams: { [key: string]: string | undefined }; | ||
}; | ||
|
||
const clubSearch = async (props: Params) => { | ||
const { searchParams } = props; | ||
const userSearch = searchParams['search'] || ''; | ||
const session = await getServerAuthSession(); | ||
|
||
return ( | ||
<main className="md:pl-72"> | ||
<div> | ||
<Header /> | ||
<ClubSearchComponent userSearch={userSearch} session={session} /> | ||
</div> | ||
</main> | ||
); | ||
}; | ||
|
||
export default clubSearch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.