From 1147b95b2cfec5850bb1b2e8b56f31697ae89de2 Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Fri, 8 Mar 2024 16:18:25 -0600 Subject: [PATCH 01/24] add seperate schema for email contacts --- src/utils/formSchemas.ts | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/utils/formSchemas.ts b/src/utils/formSchemas.ts index 1348f308..d100bf15 100644 --- a/src/utils/formSchemas.ts +++ b/src/utils/formSchemas.ts @@ -1,6 +1,29 @@ -import { selectContact } from '@src/server/db/models'; import { z } from 'zod'; +const genericPlatformSchema = z.object({ + platform: z.enum([ + 'discord', + 'youtube', + 'twitch', + 'facebook', + 'twitter', + 'instagram', + 'website', + 'other', + ]), + clubId: z.string().optional(), + url: z.string().url(), +}); + +const emailSchema = z.object({ + platform: z.literal('email'), + url: z.string().email(), +}); +const contactSchema = z.discriminatedUnion('platform', [ + genericPlatformSchema, + emailSchema, +]); + export const createClubSchema = z.object({ name: z.string().min(3, 'Club name must be at least 3 characters long'), description: z.string().min(1, 'Description is required'), @@ -14,15 +37,10 @@ export const createClubSchema = z.object({ }) .array() .min(1), - contacts: selectContact - .omit({ clubId: true, url: true }) - .extend({ url: z.string().url() }) - .array(), + contacts: contactSchema.array(), }); export const editClubContactSchema = z.object({ - contacts: selectContact - .extend({ clubId: z.string().optional(), url: z.string().url() }) - .array(), + contacts: contactSchema.array(), }); export const editClubSchema = z.object({ From d92234bec4347e675552ce1287f8c7959f51b563 Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Fri, 8 Mar 2024 19:54:36 -0600 Subject: [PATCH 02/24] add seperate Contact button option for emails --- src/components/ContactButtons.tsx | 35 ++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/components/ContactButtons.tsx b/src/components/ContactButtons.tsx index b961ca01..c8fce984 100644 --- a/src/components/ContactButtons.tsx +++ b/src/components/ContactButtons.tsx @@ -2,6 +2,19 @@ import type { SelectContact as Contacts } from '@src/server/db/models'; import { logo } from './ContactIcons'; import Link from 'next/link'; +const EmailButton = ({ item }: { item: Contacts }) => { + return ( + + ); +}; + type contentButtonProps = { contacts: Array; }; @@ -9,14 +22,20 @@ const ContactButtons = ({ contacts }: contentButtonProps) => { return (
{contacts.map((item) => ( - + <> + {item.platform === 'email' ? ( + + ) : ( + + )} + ))}
); From 5f2e01659ca44373850a0eda73007da8a4aba06f Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Sat, 16 Mar 2024 19:06:11 -0500 Subject: [PATCH 03/24] update backend schema --- src/server/api/routers/club.ts | 31 ++++++++++++++----------------- src/utils/formSchemas.ts | 1 + 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/server/api/routers/club.ts b/src/server/api/routers/club.ts index ce62811e..727068e1 100644 --- a/src/server/api/routers/club.ts +++ b/src/server/api/routers/club.ts @@ -11,12 +11,12 @@ import { } from 'drizzle-orm'; import { createTRPCRouter, protectedProcedure, publicProcedure } from '../trpc'; import { z } from 'zod'; -import { selectContact } from '@src/server/db/models'; import { clubEditRouter } from './clubEdit'; import { userMetadataToClubs } from '@src/server/db/schema/users'; import { club } from '@src/server/db/schema/club'; import { contacts } from '@src/server/db/schema/contacts'; import { carousel } from '@src/server/db/schema/admin'; +import { createClubSchema as baseClubSchema } from '@src/utils/formSchemas'; const byNameSchema = z.object({ name: z.string().default(''), }); @@ -35,22 +35,19 @@ const allSchema = z.object({ limit: z.number().min(1).max(50).default(10), initialCursor: z.number().min(0).default(0), }); -const createClubSchema = z.object({ - name: z.string().min(3), - description: z.string().min(1), - officers: z - .object({ - id: z.string().min(1), - position: z.string().min(1), - president: z.boolean(), - }) - .array() - .min(1), - contacts: selectContact - .omit({ clubId: true, url: true }) - .extend({ url: z.string().url() }) - .array(), -}); +const createClubSchema = baseClubSchema + .omit({ clubId: true, officers: true }) + .extend({ + officers: z + .object({ + id: z.string().min(1), + position: z.string(), + president: z.boolean(), + }) + .array() + .min(1), + }); + export const clubRouter = createTRPCRouter({ edit: clubEditRouter, byName: publicProcedure.input(byNameSchema).query(async ({ input, ctx }) => { diff --git a/src/utils/formSchemas.ts b/src/utils/formSchemas.ts index d100bf15..df833524 100644 --- a/src/utils/formSchemas.ts +++ b/src/utils/formSchemas.ts @@ -17,6 +17,7 @@ const genericPlatformSchema = z.object({ const emailSchema = z.object({ platform: z.literal('email'), + clubId: z.string().optional(), url: z.string().email(), }); const contactSchema = z.discriminatedUnion('platform', [ From ae8f6b98023b44fb65bec13ab0d60010069a548c Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Mon, 1 Apr 2024 17:06:20 -0500 Subject: [PATCH 04/24] extract contact schemas to new file and create seperate schemas for better validation --- src/utils/contact.ts | 86 ++++++++++++++++++++++++++++++++++++++++ src/utils/formSchemas.ts | 29 ++------------ 2 files changed, 89 insertions(+), 26 deletions(-) create mode 100644 src/utils/contact.ts diff --git a/src/utils/contact.ts b/src/utils/contact.ts new file mode 100644 index 00000000..002a6c8a --- /dev/null +++ b/src/utils/contact.ts @@ -0,0 +1,86 @@ +import { z } from 'zod'; + +const emailSchema = z.object({ + platform: z.literal('email'), + clubId: z.string().optional(), + url: z.string().email('Must be a valid email'), +}); +const discordSchema = z.object({ + platform: z.literal('discord'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https:\/\/discord\.(gg|com)\/.+/, 'Must be a discord link'), +}); + +const youtubeSchema = z.object({ + platform: z.literal('youtube'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https:\/\/youtube\.(com)\/.+/, 'Must be a youtube link'), +}); + +const twitchSchema = z.object({ + platform: z.literal('twitch'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https:\/\/twitch\.(tv)\/.+/, 'Must be a twitch link'), +}); + +const facebookSchema = z.object({ + platform: z.literal('facebook'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https:\/\/facebook\.(com)\/.+/, 'Must be a facebook link'), +}); + +const twitterSchema = z.object({ + platform: z.literal('twitter'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https:\/\/(twitter|x)\.(com)\/.+/, 'Must be a twitter link'), +}); +const instagramSchema = z.object({ + platform: z.literal('instragram'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https:\/\/instagram\.(com)\/.+/, 'Must be a instagram link'), +}); + +const websiteSchema = z.object({ + platform: z.literal('website'), + clubId: z.string().optional(), + url: z + .string() + .url('Vaid url required') + .regex(/https?:\/\/.*\.?.+\..+\/.+/, 'Must be a valid website link'), +}); + +const otherSchema = z.object({ + platform: z.literal('other'), + clubId: z.string().optional(), + url: z.string().url('must be a valid url'), +}); + +export const contactSchema = z.discriminatedUnion('platform', [ + emailSchema, + discordSchema, + youtubeSchema, + twitchSchema, + facebookSchema, + twitterSchema, + instagramSchema, + websiteSchema, + otherSchema, +]); diff --git a/src/utils/formSchemas.ts b/src/utils/formSchemas.ts index 92f18e35..04b788b7 100644 --- a/src/utils/formSchemas.ts +++ b/src/utils/formSchemas.ts @@ -1,29 +1,5 @@ import { z } from 'zod'; - -const genericPlatformSchema = z.object({ - platform: z.enum([ - 'discord', - 'youtube', - 'twitch', - 'facebook', - 'twitter', - 'instagram', - 'website', - 'other', - ]), - clubId: z.string().optional(), - url: z.string().url(), -}); - -const emailSchema = z.object({ - platform: z.literal('email'), - clubId: z.string().optional(), - url: z.string().email(), -}); -const contactSchema = z.discriminatedUnion('platform', [ - genericPlatformSchema, - emailSchema, -]); +import { contactSchema } from './contact'; export const createClubSchema = z.object({ name: z.string().min(3, 'Club name must be at least 3 characters long'), @@ -67,4 +43,5 @@ export const feedbackFormSchema = z.object({ dislikes: z.string().default(''), features: z.string().default(''), submit_on: z.date().default(new Date()), -}) \ No newline at end of file +}); + From bb8200d09fcc6819ae0262a75d35838c62d0bd9b Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Mon, 1 Apr 2024 17:51:51 -0500 Subject: [PATCH 05/24] fix edit contact form --- src/app/manage/[clubId]/edit/EditContactForm.tsx | 3 ++- src/utils/contact.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/manage/[clubId]/edit/EditContactForm.tsx b/src/app/manage/[clubId]/edit/EditContactForm.tsx index dacce878..4d9edd15 100644 --- a/src/app/manage/[clubId]/edit/EditContactForm.tsx +++ b/src/app/manage/[clubId]/edit/EditContactForm.tsx @@ -4,6 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import EditContactSelector from '@src/components/EditContactSelector'; import { type SelectClub, type SelectContact } from '@src/server/db/models'; import { api } from '@src/trpc/react'; +import { type contact } from '@src/utils/contact'; import { editClubContactSchema } from '@src/utils/formSchemas'; import { useRouter } from 'next/navigation'; import { useReducer } from 'react'; @@ -55,7 +56,7 @@ const deletedReducer = ( export default function EditContactForm({ club, }: { - club: SelectClub & { contacts: SelectContact[] }; + club: SelectClub & { contacts: contact[] }; }) { const { register, diff --git a/src/utils/contact.ts b/src/utils/contact.ts index 002a6c8a..659e1d7e 100644 --- a/src/utils/contact.ts +++ b/src/utils/contact.ts @@ -50,7 +50,7 @@ const twitterSchema = z.object({ .regex(/https:\/\/(twitter|x)\.(com)\/.+/, 'Must be a twitter link'), }); const instagramSchema = z.object({ - platform: z.literal('instragram'), + platform: z.literal('instagram'), clubId: z.string().optional(), url: z .string() @@ -84,3 +84,4 @@ export const contactSchema = z.discriminatedUnion('platform', [ websiteSchema, otherSchema, ]); +export type contact = z.infer; From 1022dbad15490ac32c325bdc841f630ea6c128db Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Tue, 2 Apr 2024 22:15:09 -0500 Subject: [PATCH 06/24] update instagram regex --- src/utils/contact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/contact.ts b/src/utils/contact.ts index 659e1d7e..38e1dce0 100644 --- a/src/utils/contact.ts +++ b/src/utils/contact.ts @@ -55,7 +55,7 @@ const instagramSchema = z.object({ url: z .string() .url('Vaid url required') - .regex(/https:\/\/instagram\.(com)\/.+/, 'Must be a instagram link'), + .regex(/https:\/\/www\.instagram\.(com)\/.+/, 'Must be a instagram link'), }); const websiteSchema = z.object({ From 31df6a1c689cc49e397bcd0ab44ba606b484f97b Mon Sep 17 00:00:00 2001 From: Connor Harris Date: Tue, 1 Oct 2024 15:42:55 -0500 Subject: [PATCH 07/24] detailed commit message (oopsie) --- src/app/clubSearch/page.tsx | 22 ++++++++++++++++ src/components/ClubSearchComponent.tsx | 35 ++++++++++++++++++++++++++ src/components/SearchBar.tsx | 9 +++++++ src/server/api/routers/club.ts | 9 +++++++ 4 files changed, 75 insertions(+) create mode 100644 src/app/clubSearch/page.tsx create mode 100644 src/components/ClubSearchComponent.tsx diff --git a/src/app/clubSearch/page.tsx b/src/app/clubSearch/page.tsx new file mode 100644 index 00000000..080ec094 --- /dev/null +++ b/src/app/clubSearch/page.tsx @@ -0,0 +1,22 @@ +import Header from '@src/components/BaseHeader'; +import { ClubSearchComponent } from '@src/components/ClubSearchComponent'; + +type Params = { + searchParams: { [key: string]: string | undefined }; +}; + +const clubSearch = async (props: Params) => { + const { searchParams } = props; + const userSearch = searchParams['search'] || ''; + + return ( +
+
+
+ +
+
+ ); +}; + +export default clubSearch; diff --git a/src/components/ClubSearchComponent.tsx b/src/components/ClubSearchComponent.tsx new file mode 100644 index 00000000..0e0b113a --- /dev/null +++ b/src/components/ClubSearchComponent.tsx @@ -0,0 +1,35 @@ +'use client'; +import { api } from '@src/trpc/react'; +import DirectoryOrgs from './DirectoryOrgs'; +import type { SelectClub as Club } from '@src/server/db/models'; // Assuming you use this type +import { type Session } from 'next-auth'; + +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

; + } + if (data.length === 0) { + return

No results found for "{userSearch}".

; + } + + return ( +
+ {data.map((club: Club, index: number) => ( + + ))} +
+ ); +}; \ No newline at end of file diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index fb219eb2..85be4083 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -25,6 +25,7 @@ type SearchBarProps = { setSearch: Dispatch>; searchResults?: Array; onClick?: (input: T) => void; + handleKeyDown?: (e: React.KeyboardEvent) => void; }; export const SearchBar = ({ @@ -33,6 +34,7 @@ export const SearchBar = ({ setSearch, searchResults, onClick, + handleKeyDown, }: SearchBarProps) => { const [input, setInput] = useState(value ?? ''); const [focused, setFocused] = useState(false); @@ -62,6 +64,7 @@ export const SearchBar = ({ onChange={handleSearch} onFocus={() => setFocused(true)} onBlur={() => setTimeout(() => setFocused(false), 300)} + onKeyDown={handleKeyDown} /> {input && focused && searchResults && searchResults.length > 0 && (
@@ -92,12 +95,18 @@ export const ClubSearchBar = () => { const onClickSearchResult = (club: Club) => { router.push(`/directory/${club.id}`); }; + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + router.push(`/clubSearch?search=${encodeURIComponent(search)}`); + } + }; return ( ); }; diff --git a/src/server/api/routers/club.ts b/src/server/api/routers/club.ts index ee13dbdb..8154451c 100644 --- a/src/server/api/routers/club.ts +++ b/src/server/api/routers/club.ts @@ -64,6 +64,15 @@ export const clubRouter = createTRPCRouter({ return clubs.slice(0, 5); }), + byNameNoLimit: publicProcedure.input(byNameSchema).query(async ({ input, ctx }) => { + const { name } = input; + const clubs = await ctx.db.query.club.findMany({ + where: (club) => + and(ilike(club.name, `%${name}%`), eq(club.approved, 'approved')), + }); + + return clubs; + }), byId: publicProcedure.input(byIdSchema).query(async ({ input, ctx }) => { const { id } = input; try { From 1cabb03efe5baa80585bb3e52447495407647dfb Mon Sep 17 00:00:00 2001 From: Connor Harris Date: Tue, 1 Oct 2024 16:57:43 -0500 Subject: [PATCH 08/24] added session stuff --- src/app/clubSearch/page.tsx | 4 +++- src/components/ClubSearchComponent.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/clubSearch/page.tsx b/src/app/clubSearch/page.tsx index 080ec094..3f79726e 100644 --- a/src/app/clubSearch/page.tsx +++ b/src/app/clubSearch/page.tsx @@ -1,5 +1,6 @@ import Header from '@src/components/BaseHeader'; import { ClubSearchComponent } from '@src/components/ClubSearchComponent'; +import { getServerAuthSession } from '@src/server/auth'; type Params = { searchParams: { [key: string]: string | undefined }; @@ -8,12 +9,13 @@ type Params = { const clubSearch = async (props: Params) => { const { searchParams } = props; const userSearch = searchParams['search'] || ''; + const session = await getServerAuthSession(); return (
- +
); diff --git a/src/components/ClubSearchComponent.tsx b/src/components/ClubSearchComponent.tsx index 0e0b113a..ad6084a0 100644 --- a/src/components/ClubSearchComponent.tsx +++ b/src/components/ClubSearchComponent.tsx @@ -1,7 +1,7 @@ 'use client'; import { api } from '@src/trpc/react'; import DirectoryOrgs from './DirectoryOrgs'; -import type { SelectClub as Club } from '@src/server/db/models'; // Assuming you use this type +import type { SelectClub as Club } from '@src/server/db/models'; import { type Session } from 'next-auth'; interface ClubSearchComponentProps { From a1690d72126b5c2ede56887dffe7953f0373efc5 Mon Sep 17 00:00:00 2001 From: Connor Harris Date: Tue, 1 Oct 2024 17:42:40 -0500 Subject: [PATCH 09/24] make vercel stop yelling at me hopefully --- src/components/ClubSearchComponent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ClubSearchComponent.tsx b/src/components/ClubSearchComponent.tsx index ad6084a0..eb0198a8 100644 --- a/src/components/ClubSearchComponent.tsx +++ b/src/components/ClubSearchComponent.tsx @@ -22,12 +22,12 @@ export const ClubSearchComponent = ({ return

; } if (data.length === 0) { - return

No results found for "{userSearch}".

; + return

No results found

; } return (
- {data.map((club: Club, index: number) => ( + {data.map((club: Club) => ( ))}
From 2a65541f7223fb7156cd4d364d29e5b781ac63e3 Mon Sep 17 00:00:00 2001 From: Ninad-S <144244166+Ninad-S@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:53:04 -0500 Subject: [PATCH 10/24] Updated the about page --- src/app/about/page.tsx | 86 +++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 30 deletions(-) diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 2a0e1b80..af774c62 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -1,4 +1,4 @@ -import Header from '@src/components/header/BaseHeader'; +import Header from '@src/components/BaseHeader'; import type { Metadata } from 'next'; export const metadata: Metadata = { @@ -14,40 +14,48 @@ export const metadata: Metadata = { }; const About = () => { + const teamMembers = [ + { name: "Ethan Bickel", position: "Project Lead" }, + { name: "Braeden Kotko", position: "Engineer" }, + { name: "Connor Harris", position: "Engineer" }, + { name: "Jonathan Le", position: "Engineer" }, + { name: "Alex Vazquez", position: "Engineer" }, + { name: "Ishaan Gupta", position: "Engineer" }, + { name: "Ritvik Thota", position: "Engineer" } + + ]; + const recruits= [ + { name: "Jordan Joelson", position: "Engineer" }, + { name: "Mansi Cherukupally", position: "Engineer" }, + { name: "Aryav Rastogi", position: "Engineer" }, + { name: "Sreevasan Siasubramanian", position: "Engineer" }, + { name: "Ninad Sudarsanam", position: "Engineer" }, + { name: "Shivesh Gupta", position: "Engineer" }, + { name: "Natalia Sekulic", position: "Engineer" }, + { name: "Mamoun Elmamoun", position: "Engineer" }, + { name: "Chloe Alzaga", position: "Engineer" }, + { name: "Joshua Perez", position: "Engineer" }, + { name: "Ankith Ganji", position: "Engineer" }, + { name: "Valeria Gallardo", position: "Designer" }, + { name: "Waseef Kabir", position: "Designer" }, + { name: "Ved Mahant", position: "Designer" } + ]; return (
-

- About us -

+

- Project Jupiter + About Jupiter

-

Our Goal

+

- Jupiter is a user-friendly platform that can be utilized by students - to seamlessly join school clubs. This tool allows students to browse - through the list of available clubs, their activities, and - objectives, all in one place. Students can easily sign up for clubs - that interest them and receive real-time updates on events, - meetings, and other activities organized by the clubs. The platform - also enables club leaders to manage and promote their clubs more - efficiently, keeping members informed about important details and - facilitating communication between members. -
-
- Jupiter comes with several features that make it an ideal tool for - school club management. For instance, the platform provides a - comprehensive dashboard that enables club leaders to track - attendance, monitor club performance, and collect feedback from - members. The tool also integrates with the school's social - media pages and website, making it easy for students to discover - clubs that match their interests. With Jupiter, students can easily - find and join clubs, and club leaders can manage their clubs more - effectively, leading to more successful and fulfilling club - experiences for everyone involved. + Jupiter is a platform being developed by nebula labs in order to help students find organizations and events on and around campus. + + Jupiter let's you track organizations you're interested in, find new organizations, and keep up to date on events you want to attend. + + For organizations we offer a better way to keep your info up to date, and for people well suited for your organization to find out about you and your events.

@@ -55,18 +63,36 @@ const About = () => { Our Team
- {Array.from({ length: 8 }).map((_, key) => ( + {teamMembers.map((member, key) => (

- Name + {member.name}

-

Position

+

{member.position}

))}
+
+

+ Recruits +

+
+ {recruits.map((member, key) => ( +
+

+ {member.name} +

+

{member.position}

+
+ ))} +
+
From 3ccdaa962b6367381e3a304c1b43cc4e9508f753 Mon Sep 17 00:00:00 2001 From: MamounE1 Date: Tue, 1 Oct 2024 18:03:37 -0500 Subject: [PATCH 11/24] make event countdown work --- src/components/events/EventTimeAlert.tsx | 45 +++++++++++++++++++----- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/src/components/events/EventTimeAlert.tsx b/src/components/events/EventTimeAlert.tsx index c027f020..a0eee0fe 100644 --- a/src/components/events/EventTimeAlert.tsx +++ b/src/components/events/EventTimeAlert.tsx @@ -10,6 +10,7 @@ import { type ReactNode } from 'react'; type EventTimeAlertProps = { event: SelectEvent; }; + type BaseProps = { children: ReactNode; className?: string }; const Base = ({ children, className }: BaseProps) => { return ( @@ -22,19 +23,43 @@ const Base = ({ children, className }: BaseProps) => {
); }; -const EventTimeAlert = ({ event }: EventTimeAlertProps) => { - const now = new Date(); + +import React, {useState, useEffect} from 'react'; + +const EventTimeAlert = ({ event }: EventTimeAlertProps) => +{ + const [now, setNow] = useState(new Date()); + + useEffect(() => { + const intervalId = setInterval(() => + { + setNow (new Date()); + }, 1000); + + return () => clearInterval(intervalId); + + }, []); + const start = event.startTime; const hourDiff = differenceInHours(start, now); - if (event.startTime.getTime() < Date.now()) { - if (event.endTime.getTime() < Date.now()) { + + if (event.startTime.getTime() < Date.now()) + { + if (event.endTime.getTime() < Date.now()) + { return over :(; - } else { + } + else + { return NOW; } - } else { - if (differenceInDays(start, now) < 1) { - if (hourDiff < 1) { + } + else + { + if (differenceInDays(start, now) < 1) + { + if (hourDiff < 1) + { return ( {differenceInMinutes(start, now)} minutes @@ -45,7 +70,9 @@ const EventTimeAlert = ({ event }: EventTimeAlertProps) => { } else { return {hourDiff} hours; } - } else { + } + else + { return ( {differenceInDays(start, now)} days ); From 090abc1a54ded1eb9455de507bf471e37788c8d9 Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Tue, 8 Oct 2024 14:35:08 -0500 Subject: [PATCH 12/24] Fix Import on about page --- src/app/about/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index af774c62..b2e356f8 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -1,4 +1,4 @@ -import Header from '@src/components/BaseHeader'; +import Header from '@src/components/header/BaseHeader'; import type { Metadata } from 'next'; export const metadata: Metadata = { From b7a9e23061a8baa3f18a0361508bedac3b298dfc Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Tue, 8 Oct 2024 14:44:41 -0500 Subject: [PATCH 13/24] formatting fixes --- src/app/about/page.tsx | 111 ++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 46 deletions(-) diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index b2e356f8..1b0b80fb 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -15,47 +15,66 @@ export const metadata: Metadata = { const About = () => { const teamMembers = [ - { name: "Ethan Bickel", position: "Project Lead" }, - { name: "Braeden Kotko", position: "Engineer" }, - { name: "Connor Harris", position: "Engineer" }, - { name: "Jonathan Le", position: "Engineer" }, - { name: "Alex Vazquez", position: "Engineer" }, - { name: "Ishaan Gupta", position: "Engineer" }, - { name: "Ritvik Thota", position: "Engineer" } - + { name: 'Ethan Bickel', position: 'Project Lead' }, + { name: 'Braeden Kotko', position: 'Engineer' }, + { name: 'Connor Harris', position: 'Engineer' }, + { name: 'Jonathan Le', position: 'Engineer' }, + { name: 'Alex Vazquez', position: 'Engineer' }, + { name: 'Ishaan Gupta', position: 'Engineer' }, + { name: 'Ritvik Thota', position: 'Engineer' }, ]; - const recruits= [ - { name: "Jordan Joelson", position: "Engineer" }, - { name: "Mansi Cherukupally", position: "Engineer" }, - { name: "Aryav Rastogi", position: "Engineer" }, - { name: "Sreevasan Siasubramanian", position: "Engineer" }, - { name: "Ninad Sudarsanam", position: "Engineer" }, - { name: "Shivesh Gupta", position: "Engineer" }, - { name: "Natalia Sekulic", position: "Engineer" }, - { name: "Mamoun Elmamoun", position: "Engineer" }, - { name: "Chloe Alzaga", position: "Engineer" }, - { name: "Joshua Perez", position: "Engineer" }, - { name: "Ankith Ganji", position: "Engineer" }, - { name: "Valeria Gallardo", position: "Designer" }, - { name: "Waseef Kabir", position: "Designer" }, - { name: "Ved Mahant", position: "Designer" } + const recruits = [ + { name: 'Jordan Joelson', position: 'Engineer' }, + { name: 'Mansi Cherukupally', position: 'Engineer' }, + { name: 'Aryav Rastogi', position: 'Engineer' }, + { name: 'Sreevasan Siasubramanian', position: 'Engineer' }, + { name: 'Ninad Sudarsanam', position: 'Engineer' }, + { name: 'Shivesh Gupta', position: 'Engineer' }, + { name: 'Natalia Sekulic', position: 'Engineer' }, + { name: 'Mamoun Elmamoun', position: 'Engineer' }, + { name: 'Chloe Alzaga', position: 'Engineer' }, + { name: 'Joshua Perez', position: 'Engineer' }, + { name: 'Ankith Ganji', position: 'Engineer' }, + { name: 'Valeria Gallardo', position: 'Designer' }, + { name: 'Waseef Kabir', position: 'Designer' }, + { name: 'Ved Mahant', position: 'Designer' }, ]; return (
-

About Jupiter

- + +

+ Jupiter is a platform being developed by nebula labs in order to + help students find organizations and events on and around campus. +
+ You're able to track organizations you're interested in, + find new organizations, and keep up to date on events you want to + attend. +
+ For organizations we offer a better way to keep your info up to + date, and for people well suited for your organization to find out + about you and your events. +

- Jupiter is a platform being developed by nebula labs in order to help students find organizations and events on and around campus. - - Jupiter let's you track organizations you're interested in, find new organizations, and keep up to date on events you want to attend. - - For organizations we offer a better way to keep your info up to date, and for people well suited for your organization to find out about you and your events. + If you're interested in contributing to Jupiter check out the{' '} + + Nebula Discord + + , or our{' '} + + Github +

@@ -76,22 +95,22 @@ const About = () => { ))}
-

- Recruits -

-
- {recruits.map((member, key) => ( -
-

- {member.name} -

-

{member.position}

-
- ))} -
+

+ Recruits +

+
+ {recruits.map((member, key) => ( +
+

+ {member.name} +

+

{member.position}

+
+ ))} +
From d30664e560c5423568e774d4235797433645d634 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Tue, 8 Oct 2024 15:25:13 -0500 Subject: [PATCH 14/24] Add Google Analytics --- .env.example | 1 + src/app/layout.tsx | 2 ++ src/components/googleAnalytics.tsx | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 src/components/googleAnalytics.tsx diff --git a/.env.example b/.env.example index c34412fe..39f85b99 100644 --- a/.env.example +++ b/.env.example @@ -7,4 +7,5 @@ PSQL_PASS= DATABASE_URL= DISCORD_CLIENT_ID= DISCORD_CLIENT_SECRET= +NEXT_PUBLIC_MEASUREMENT_ID= ``` \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4a14d4fb..d37bc80a 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -8,6 +8,7 @@ import Sidebar from '@src/components/nav/Sidebar'; import { type Metadata } from 'next'; import { Analytics } from '@vercel/analytics/react'; +import GoogleAnalytics from '@src/components/googleAnalytics'; const inter = Inter({ subsets: ['latin'], @@ -43,6 +44,7 @@ export default function RootLayout({ }) { return ( + diff --git a/src/components/googleAnalytics.tsx b/src/components/googleAnalytics.tsx new file mode 100644 index 00000000..ea23b9ae --- /dev/null +++ b/src/components/googleAnalytics.tsx @@ -0,0 +1,26 @@ +import Script from 'next/script'; +import React from 'react'; + +const GoogleAnalytics = () => { + return ( + <> + + + ); +}; + +export default GoogleAnalytics; From 64b41d69b27c3e9e2afabe69c5a1662de6b3b9c8 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Tue, 8 Oct 2024 16:15:23 -0500 Subject: [PATCH 15/24] Remove Vercel Analytics --- package-lock.json | 26 -------------------------- package.json | 1 - src/app/layout.tsx | 2 -- 3 files changed, 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 37697006..6d4fb4dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,6 @@ "@trpc/client": "^11.0.0-rc.340", "@trpc/react-query": "^11.0.0-rc.340", "@trpc/server": "^11.0.0-rc.340", - "@vercel/analytics": "^1.3.1", "date-fns": "^2.30.0", "dotenv": "^16.0.3", "drizzle-orm": "^0.28.5", @@ -3309,26 +3308,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@vercel/analytics": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.3.1.tgz", - "integrity": "sha512-xhSlYgAuJ6Q4WQGkzYTLmXwhYl39sWjoMA3nHxfkvG+WdBT25c563a7QhwwKivEOZtPJXifYHR1m2ihoisbWyA==", - "dependencies": { - "server-only": "^0.0.1" - }, - "peerDependencies": { - "next": ">= 13", - "react": "^18 || ^19" - }, - "peerDependenciesMeta": { - "next": { - "optional": true - }, - "react": { - "optional": true - } - } - }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -10826,11 +10805,6 @@ "optional": true, "peer": true }, - "node_modules/server-only": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz", - "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==" - }, "node_modules/set-function-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", diff --git a/package.json b/package.json index d48fa4d3..8d0fffcf 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "@trpc/client": "^11.0.0-rc.340", "@trpc/react-query": "^11.0.0-rc.340", "@trpc/server": "^11.0.0-rc.340", - "@vercel/analytics": "^1.3.1", "date-fns": "^2.30.0", "dotenv": "^16.0.3", "drizzle-orm": "^0.28.5", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d37bc80a..ba913c25 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,7 +7,6 @@ import { TRPCReactProvider } from '@src/trpc/react'; import Sidebar from '@src/components/nav/Sidebar'; import { type Metadata } from 'next'; -import { Analytics } from '@vercel/analytics/react'; import GoogleAnalytics from '@src/components/googleAnalytics'; const inter = Inter({ @@ -50,7 +49,6 @@ export default function RootLayout({
{children}
- ); From 1785cc4e7fe80b1f8e3ef5b9e847f314b4d0b417 Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Tue, 8 Oct 2024 18:09:49 -0500 Subject: [PATCH 16/24] Use @next/third-parties --- .env.example | 1 - package-lock.json | 20 ++++++++++++++++++++ package.json | 1 + src/app/layout.tsx | 4 ++-- src/components/googleAnalytics.tsx | 26 -------------------------- 5 files changed, 23 insertions(+), 29 deletions(-) delete mode 100644 src/components/googleAnalytics.tsx diff --git a/.env.example b/.env.example index 39f85b99..c34412fe 100644 --- a/.env.example +++ b/.env.example @@ -7,5 +7,4 @@ PSQL_PASS= DATABASE_URL= DISCORD_CLIENT_ID= DISCORD_CLIENT_SECRET= -NEXT_PUBLIC_MEASUREMENT_ID= ``` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6d4fb4dc..c9037fd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@auth/drizzle-adapter": "^0.3.2", "@hookform/resolvers": "^3.3.2", + "@next/third-parties": "^14.2.15", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", @@ -1993,6 +1994,19 @@ "node": ">= 10" } }, + "node_modules/@next/third-parties": { + "version": "14.2.15", + "resolved": "https://registry.npmjs.org/@next/third-parties/-/third-parties-14.2.15.tgz", + "integrity": "sha512-15CvipE1p1GtlzVfbDfXPrAGIhzJJe75Yy6+GIBRTd36lu95BegRsUJwCxJYoKz47Q09stcU2gJDMduMGqrikw==", + "license": "MIT", + "dependencies": { + "third-party-capital": "1.0.20" + }, + "peerDependencies": { + "next": "^13.0.0 || ^14.0.0", + "react": "^18.2.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -11520,6 +11534,12 @@ "node": ">=0.8" } }, + "node_modules/third-party-capital": { + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/third-party-capital/-/third-party-capital-1.0.20.tgz", + "integrity": "sha512-oB7yIimd8SuGptespDAZnNkzIz+NWaJCu2RMsbs4Wmp9zSDUM8Nhi3s2OOcqYuv3mN4hitXc8DVx+LyUmbUDiA==", + "license": "ISC" + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", diff --git a/package.json b/package.json index 8d0fffcf..1c4b94b2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "dependencies": { "@auth/drizzle-adapter": "^0.3.2", "@hookform/resolvers": "^3.3.2", + "@next/third-parties": "^14.2.15", "@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ba913c25..d2bee2c4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,7 +7,7 @@ import { TRPCReactProvider } from '@src/trpc/react'; import Sidebar from '@src/components/nav/Sidebar'; import { type Metadata } from 'next'; -import GoogleAnalytics from '@src/components/googleAnalytics'; +import { GoogleAnalytics } from '@next/third-parties/google' const inter = Inter({ subsets: ['latin'], @@ -43,12 +43,12 @@ export default function RootLayout({ }) { return ( -
{children}
+ ); diff --git a/src/components/googleAnalytics.tsx b/src/components/googleAnalytics.tsx deleted file mode 100644 index ea23b9ae..00000000 --- a/src/components/googleAnalytics.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import Script from 'next/script'; -import React from 'react'; - -const GoogleAnalytics = () => { - return ( - <> - - - ); -}; - -export default GoogleAnalytics; From 0fa39ba433f80a71f2648ee28c371cee826db7dd Mon Sep 17 00:00:00 2001 From: MamounE1 Date: Tue, 8 Oct 2024 18:37:54 -0500 Subject: [PATCH 17/24] Fixed the suggesions --- src/components/events/EventTimeAlert.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/events/EventTimeAlert.tsx b/src/components/events/EventTimeAlert.tsx index a0eee0fe..2dab2161 100644 --- a/src/components/events/EventTimeAlert.tsx +++ b/src/components/events/EventTimeAlert.tsx @@ -6,6 +6,7 @@ import { differenceInMinutes, } from 'date-fns'; import { type ReactNode } from 'react'; +import {useState, useEffect} from 'react'; type EventTimeAlertProps = { event: SelectEvent; @@ -24,16 +25,16 @@ const Base = ({ children, className }: BaseProps) => { ); }; -import React, {useState, useEffect} from 'react'; + const EventTimeAlert = ({ event }: EventTimeAlertProps) => { - const [now, setNow] = useState(new Date()); + const [now, setNow] = useState(Date.now()); useEffect(() => { const intervalId = setInterval(() => { - setNow (new Date()); + setNow (Date.now()); }, 1000); return () => clearInterval(intervalId); @@ -43,9 +44,9 @@ const EventTimeAlert = ({ event }: EventTimeAlertProps) => const start = event.startTime; const hourDiff = differenceInHours(start, now); - if (event.startTime.getTime() < Date.now()) + if (event.startTime.getTime() < now) { - if (event.endTime.getTime() < Date.now()) + if (event.endTime.getTime() < now) { return over :(; } From 0c485c3e4b0ddfbd42d95ff2c52f18a40cdc7d28 Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Mon, 14 Oct 2024 09:28:55 -0500 Subject: [PATCH 18/24] fix format check output (#249) * fix format check output * fix passing badly formatted files * attempt at fixing output * attempt 2 at fixing bad output * attempt 3 at fixing bad output * add quotes * fix where it outputs * test env * remove quotes so that stuff gets passed right, maybe * i don't * remove sed cause not needed in ci env * test something * export instead * combine scripts * fix bad formatting * bad variable * Revert "fix bad formatting" This reverts commit e9843c34ab0a4ea9e3d5e8f4550875c103500660. * Revert "Revert "fix bad formatting"" This reverts commit 5ccab2b3fb51732b6684a0728da40ef89c564f71. --- .github/workflows/generateCheck.sh | 4 +++- .github/workflows/prettierCheck.yml | 10 +--------- src/app/layout.tsx | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/generateCheck.sh b/.github/workflows/generateCheck.sh index 8d1ba0b0..f073a72c 100755 --- a/.github/workflows/generateCheck.sh +++ b/.github/workflows/generateCheck.sh @@ -1,4 +1,6 @@ -if [ $status == 'success' ]; then +files=$(npx prettier . -l) +status=$? +if [ $status == 0 ]; then echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY exit 0 diff --git a/.github/workflows/prettierCheck.yml b/.github/workflows/prettierCheck.yml index 108ca2ca..d248dbe9 100644 --- a/.github/workflows/prettierCheck.yml +++ b/.github/workflows/prettierCheck.yml @@ -12,13 +12,5 @@ jobs: cache: 'npm' - name: Run npm install run: npm ci - - name: Run prettier - id: prettier - continue-on-error: true - run: | - files=`npx prettier . -l` - echo files=$files >> "$GITHUB_ENV" - - name: generate errors/summary + - name: Run prettier & generate problems run: .github/workflows/generateCheck.sh - env: - status: ${{ steps.prettier.outcome }} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d2bee2c4..52a741a0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,7 +7,7 @@ import { TRPCReactProvider } from '@src/trpc/react'; import Sidebar from '@src/components/nav/Sidebar'; import { type Metadata } from 'next'; -import { GoogleAnalytics } from '@next/third-parties/google' +import { GoogleAnalytics } from '@next/third-parties/google'; const inter = Inter({ subsets: ['latin'], From 70d5cb87c217d4656bd1206ed96a3e786dc46116 Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Tue, 22 Oct 2024 12:53:51 -0500 Subject: [PATCH 19/24] fix formatting --- src/components/events/EventTimeAlert.tsx | 39 ++++++++---------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/src/components/events/EventTimeAlert.tsx b/src/components/events/EventTimeAlert.tsx index 2dab2161..be18211d 100644 --- a/src/components/events/EventTimeAlert.tsx +++ b/src/components/events/EventTimeAlert.tsx @@ -6,7 +6,7 @@ import { differenceInMinutes, } from 'date-fns'; import { type ReactNode } from 'react'; -import {useState, useEffect} from 'react'; +import { useState, useEffect } from 'react'; type EventTimeAlertProps = { event: SelectEvent; @@ -25,42 +25,29 @@ const Base = ({ children, className }: BaseProps) => { ); }; +const EventTimeAlert = ({ event }: EventTimeAlertProps) => { + const [now, setNow] = useState(Date.now()); - -const EventTimeAlert = ({ event }: EventTimeAlertProps) => -{ - const [now, setNow] = useState(Date.now()); - useEffect(() => { - const intervalId = setInterval(() => - { - setNow (Date.now()); + const intervalId = setInterval(() => { + setNow(Date.now()); }, 1000); return () => clearInterval(intervalId); - }, []); const start = event.startTime; const hourDiff = differenceInHours(start, now); - if (event.startTime.getTime() < now) - { - if (event.endTime.getTime() < now) - { + if (event.startTime.getTime() < now) { + if (event.endTime.getTime() < now) { return over :(; - } - else - { + } else { return NOW; } - } - else - { - if (differenceInDays(start, now) < 1) - { - if (hourDiff < 1) - { + } else { + if (differenceInDays(start, now) < 1) { + if (hourDiff < 1) { return ( {differenceInMinutes(start, now)} minutes @@ -71,9 +58,7 @@ const EventTimeAlert = ({ event }: EventTimeAlertProps) => } else { return {hourDiff} hours; } - } - else - { + } else { return ( {differenceInDays(start, now)} days ); From 9ab979ca277146854f1a33c4e0ab8a1b43874e02 Mon Sep 17 00:00:00 2001 From: Connor Harris Date: Tue, 22 Oct 2024 13:17:35 -0500 Subject: [PATCH 20/24] i h8 vercel --- src/components/ClubSearchComponent.tsx | 2 +- src/server/api/routers/club.ts | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/ClubSearchComponent.tsx b/src/components/ClubSearchComponent.tsx index f8ca65e0..2b4c8c4e 100644 --- a/src/components/ClubSearchComponent.tsx +++ b/src/components/ClubSearchComponent.tsx @@ -32,4 +32,4 @@ export const ClubSearchComponent = ({ ))} ); -}; \ No newline at end of file +}; diff --git a/src/server/api/routers/club.ts b/src/server/api/routers/club.ts index 8154451c..4f9d6ef6 100644 --- a/src/server/api/routers/club.ts +++ b/src/server/api/routers/club.ts @@ -64,15 +64,17 @@ export const clubRouter = createTRPCRouter({ return clubs.slice(0, 5); }), - byNameNoLimit: publicProcedure.input(byNameSchema).query(async ({ input, ctx }) => { - const { name } = input; - const clubs = await ctx.db.query.club.findMany({ - where: (club) => - and(ilike(club.name, `%${name}%`), eq(club.approved, 'approved')), - }); + byNameNoLimit: publicProcedure + .input(byNameSchema) + .query(async ({ input, ctx }) => { + const { name } = input; + const clubs = await ctx.db.query.club.findMany({ + where: (club) => + and(ilike(club.name, `%${name}%`), eq(club.approved, 'approved')), + }); - return clubs; - }), + return clubs; + }), byId: publicProcedure.input(byIdSchema).query(async ({ input, ctx }) => { const { id } = input; try { From 21c5895ba96b5402369eee4734f6c647e91a1a7f Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Tue, 22 Oct 2024 13:32:10 -0500 Subject: [PATCH 21/24] move routes --- .../directory/search/ClubSearch.tsx} | 2 +- src/app/{clubSearch => directory/search}/page.tsx | 2 +- src/components/searchBar/ClubSearchBar.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/{components/ClubSearchComponent.tsx => app/directory/search/ClubSearch.tsx} (93%) rename src/app/{clubSearch => directory/search}/page.tsx (88%) diff --git a/src/components/ClubSearchComponent.tsx b/src/app/directory/search/ClubSearch.tsx similarity index 93% rename from src/components/ClubSearchComponent.tsx rename to src/app/directory/search/ClubSearch.tsx index 2b4c8c4e..cf9a4073 100644 --- a/src/components/ClubSearchComponent.tsx +++ b/src/app/directory/search/ClubSearch.tsx @@ -2,7 +2,7 @@ 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 './club/ClubCard'; +import ClubCard from '@src/components/club/ClubCard'; interface ClubSearchComponentProps { userSearch: string; diff --git a/src/app/clubSearch/page.tsx b/src/app/directory/search/page.tsx similarity index 88% rename from src/app/clubSearch/page.tsx rename to src/app/directory/search/page.tsx index a40a0a8d..8542f9b8 100644 --- a/src/app/clubSearch/page.tsx +++ b/src/app/directory/search/page.tsx @@ -1,5 +1,5 @@ import Header from '@src/components/header/BaseHeader'; -import { ClubSearchComponent } from '@src/components/ClubSearchComponent'; +import { ClubSearchComponent } from './ClubSearch'; import { getServerAuthSession } from '@src/server/auth'; type Params = { diff --git a/src/components/searchBar/ClubSearchBar.tsx b/src/components/searchBar/ClubSearchBar.tsx index 9112234c..8b02f613 100644 --- a/src/components/searchBar/ClubSearchBar.tsx +++ b/src/components/searchBar/ClubSearchBar.tsx @@ -23,7 +23,7 @@ export const ClubSearchBar = () => { onClick={onClickSearchResult} submitButton submitLogic={() => { - router.push(`/clubSearch?search=${encodeURIComponent(search)}`); + router.push(`/directory/search?search=${encodeURIComponent(search)}`); }} /> ); From 2f12c586a26d25861e75e8e8825cd62c5e1f988d Mon Sep 17 00:00:00 2001 From: Ethan Bickel Date: Tue, 22 Oct 2024 14:52:55 -0500 Subject: [PATCH 22/24] remove regex --- src/utils/contact.ts | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/src/utils/contact.ts b/src/utils/contact.ts index 38e1dce0..06fd9a59 100644 --- a/src/utils/contact.ts +++ b/src/utils/contact.ts @@ -8,63 +8,42 @@ const emailSchema = z.object({ const discordSchema = z.object({ platform: z.literal('discord'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https:\/\/discord\.(gg|com)\/.+/, 'Must be a discord link'), + url: z.string().url('Valid url required'), }); const youtubeSchema = z.object({ platform: z.literal('youtube'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https:\/\/youtube\.(com)\/.+/, 'Must be a youtube link'), + url: z.string().url('Valid url required'), }); const twitchSchema = z.object({ platform: z.literal('twitch'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https:\/\/twitch\.(tv)\/.+/, 'Must be a twitch link'), + url: z.string().url('Valid url required'), }); const facebookSchema = z.object({ platform: z.literal('facebook'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https:\/\/facebook\.(com)\/.+/, 'Must be a facebook link'), + url: z.string().url('Valid url required'), }); const twitterSchema = z.object({ platform: z.literal('twitter'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https:\/\/(twitter|x)\.(com)\/.+/, 'Must be a twitter link'), + url: z.string().url('Valid url required'), }); const instagramSchema = z.object({ platform: z.literal('instagram'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https:\/\/www\.instagram\.(com)\/.+/, 'Must be a instagram link'), + url: z.string().url('Valid url required'), }); const websiteSchema = z.object({ platform: z.literal('website'), clubId: z.string().optional(), - url: z - .string() - .url('Vaid url required') - .regex(/https?:\/\/.*\.?.+\..+\/.+/, 'Must be a valid website link'), + url: z.string().url('Valid url required'), }); const otherSchema = z.object({ From 7923b461f3f29ed24d705d34a961bab4676ba16c Mon Sep 17 00:00:00 2001 From: Connor Harris Date: Tue, 22 Oct 2024 17:54:43 -0500 Subject: [PATCH 23/24] made it so that no search results found is displayed when applicable --- src/app/directory/search/ClubSearch.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/directory/search/ClubSearch.tsx b/src/app/directory/search/ClubSearch.tsx index cf9a4073..4cabebf3 100644 --- a/src/app/directory/search/ClubSearch.tsx +++ b/src/app/directory/search/ClubSearch.tsx @@ -22,7 +22,11 @@ export const ClubSearchComponent = ({ return

; } if (data.length === 0) { - return

No results found

; + return ( +
+ No Search Results Found +
+ ); } return ( From 2a1746de7193457443108c8b3899220c6c83425b Mon Sep 17 00:00:00 2001 From: Connor Harris Date: Tue, 22 Oct 2024 17:58:52 -0500 Subject: [PATCH 24/24] ran prettier on the code --- src/app/directory/search/ClubSearch.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/directory/search/ClubSearch.tsx b/src/app/directory/search/ClubSearch.tsx index 4cabebf3..3845275f 100644 --- a/src/app/directory/search/ClubSearch.tsx +++ b/src/app/directory/search/ClubSearch.tsx @@ -23,7 +23,7 @@ export const ClubSearchComponent = ({ } if (data.length === 0) { return ( -
+
No Search Results Found
);