From 284481f2f72fa8805b866139d0e34671bc7a3f2a Mon Sep 17 00:00:00 2001 From: Ethan Tiger Wakefield Date: Fri, 23 Jan 2026 15:40:33 -0500 Subject: [PATCH 1/3] fix spacing problem --- src/components/ui/apple-cards-carousel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ui/apple-cards-carousel.tsx b/src/components/ui/apple-cards-carousel.tsx index 26589b7..6dd825d 100644 --- a/src/components/ui/apple-cards-carousel.tsx +++ b/src/components/ui/apple-cards-carousel.tsx @@ -235,19 +235,19 @@ export const Card = ({ className="relative z-10 flex h-[60vh] w-[70vw] flex-col items-start justify-start overflow-hidden rounded-3xl bg-gray-100 md:h-[40rem] md:w-96 dark:bg-neutral-900 hover:cursor-pointer" >
-
+
{card.title} - {card.special && {card.special} - } + } Date: Fri, 23 Jan 2026 16:36:04 -0500 Subject: [PATCH 2/3] split some ui and add uber split type --- src/features/carpool/components/Carpool.tsx | 78 ++++++------------- .../carpool/components/CarpoolCard.tsx | 10 ++- .../carpool/components/CarpoolModal.tsx | 19 +++-- .../ui/CarpoolLoadingPlaceholder.tsx | 24 ++++++ .../components/ui/NoCarpoolsAvailable.tsx | 13 ++++ src/features/carpool/enums/CarpoolTypeEnum.ts | 4 + .../carpool/interfaces/CarpoolPost.ts | 2 + 7 files changed, 89 insertions(+), 61 deletions(-) create mode 100644 src/features/carpool/components/ui/CarpoolLoadingPlaceholder.tsx create mode 100644 src/features/carpool/components/ui/NoCarpoolsAvailable.tsx create mode 100644 src/features/carpool/enums/CarpoolTypeEnum.ts diff --git a/src/features/carpool/components/Carpool.tsx b/src/features/carpool/components/Carpool.tsx index bfb81ad..e1a6dcd 100644 --- a/src/features/carpool/components/Carpool.tsx +++ b/src/features/carpool/components/Carpool.tsx @@ -7,12 +7,16 @@ import CarpoolModal from "./CarpoolModal"; import CarpoolInboxModal from "./CarpoolInboxModal"; import CarpoolCard from "./CarpoolCard"; import { useAuthContext } from "@/hooks/useAuthContext"; +import { CarpoolTypeEnum } from "../enums/CarpoolTypeEnum"; +import NoCarpoolsAvailable from "./ui/NoCarpoolsAvailable"; +import CarpoolLoadingPlaceholder from "./ui/CarpoolLoadingPlaceholder"; export default function Carpool() { const yesterday = new Date(); yesterday.setDate(yesterday.getDate() - 1); const { documents: carpools } = useCollection(collections.carpoolCollection, ['targetDate', '>=', yesterday], ['targetDate', 'asc'], true); const [isCreateModalOpen, setIsCreateModalOpen] = useState(false); + const [createModalType, setCreateModalType] = useState(CarpoolTypeEnum.Carpool); const [isInboxModalOpen, setIsInboxModalOpen] = useState(false); const { user: currentUser } = useAuthContext(); @@ -70,6 +74,11 @@ export default function Carpool() { }, 0); }, [carpools, currentUser]); + const handleOpenCreateModal = (type: CarpoolTypeEnum) => { + setCreateModalType(type); + setIsCreateModalOpen(true); + } + // Render a section of carpools const renderCarpoolSection = (title: string, carpools: CarpoolPost[], ownershipType?: 'owner' | 'member' | 'requested') => { if (carpools.length === 0) return null; @@ -82,7 +91,7 @@ export default function Carpool() { {carpools.length}
-
+
{carpools.map((carpool) => ( )} +
@@ -168,63 +184,14 @@ export default function Carpool() { categorizedCarpools.joinedCarpools.length === 0 && categorizedCarpools.requestedCarpools.length === 0 && categorizedCarpools.availableCarpools.length === 0 && ( -
-
-
-
-

No Carpools Available

-

- There are currently no carpools scheduled. Check back later or create your own! -

- -
+ )}
) : ( -
-
-
-
-

No Carpools Available

-

- There are currently no carpools scheduled. Check back later or create your own! -

- -
+ ) ) : ( -
- {[...Array(8)].map((_, index) => ( -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ))} -
+ )}
@@ -232,6 +199,7 @@ export default function Carpool() { {/* Create Carpool Modal */} setIsCreateModalOpen(false)} // onSuccess={handleCreateSuccess} /> diff --git a/src/features/carpool/components/CarpoolCard.tsx b/src/features/carpool/components/CarpoolCard.tsx index 5e8b537..1ce1b56 100644 --- a/src/features/carpool/components/CarpoolCard.tsx +++ b/src/features/carpool/components/CarpoolCard.tsx @@ -6,6 +6,7 @@ import collections from "@/firebase/collections"; import { useCachedDocument } from "@/hooks/useCachedDocument"; import { IconCrown, IconUser, IconClock } from "@tabler/icons-react"; import { CarpoolStatusEnum } from "../enums/CarpoolStatusEnum"; +import { CarpoolTypeEnum } from "../enums/CarpoolTypeEnum"; interface CarpoolCardProps { carpool: CarpoolPost; @@ -62,6 +63,7 @@ export default function CarpoolCard({ carpool, ownershipType }: CarpoolCardProps }`}> {carpool.status === CarpoolStatusEnum.Closed ? 'Closed' : `${carpool.maxPeople - carpool.people.length} seats`} +
@@ -69,9 +71,15 @@ export default function CarpoolCard({ carpool, ownershipType }: CarpoolCardProps
- Driver: {user ? (user.displayName || user.email || 'Unknown') : carpool.userId} + Creator: {user ? (user.displayName || user.email || 'Unknown') : carpool.userId}
+
+
+ + Type: {carpool.type === CarpoolTypeEnum.Carpool ? 'Carpool' : 'Uber Split'} + +
diff --git a/src/features/carpool/components/CarpoolModal.tsx b/src/features/carpool/components/CarpoolModal.tsx index 637ed6f..0555717 100644 --- a/src/features/carpool/components/CarpoolModal.tsx +++ b/src/features/carpool/components/CarpoolModal.tsx @@ -6,15 +6,17 @@ import { db } from "@/firebase/config"; import collections from "@/firebase/collections"; import { CarpoolStatusEnum } from "../enums/CarpoolStatusEnum"; import CarpoolPost from "../interfaces/CarpoolPost"; +import { CarpoolTypeEnum } from "../enums/CarpoolTypeEnum"; interface CarpoolModalProps { isOpen: boolean; + type?: CarpoolTypeEnum; onClose: () => void; carpool?: CarpoolPost | null; // If provided, it's edit mode onSuccess?: () => void; } -export default function CarpoolModal({ isOpen, onClose, carpool }: CarpoolModalProps) { +export default function CarpoolModal({ isOpen, type, onClose, carpool }: CarpoolModalProps) { const { user } = useAuthContext(); const [isSubmitting, setIsSubmitting] = useState(false); const [message, setMessage] = useState<{ text: string; type: 'success' | 'error' } | null>(null); @@ -95,6 +97,7 @@ export default function CarpoolModal({ isOpen, onClose, carpool }: CarpoolModalP const carpoolData = { location: formData.location, + type: type || CarpoolTypeEnum.Carpool, destination: formData.destination, targetDate: timestamp, maxPeople: formData.maxPeople, @@ -136,9 +139,15 @@ export default function CarpoolModal({ isOpen, onClose, carpool }: CarpoolModalP
-

- {isEditMode ? 'Edit Carpool' : 'Create New Carpool'} -

+ {type === CarpoolTypeEnum.UberSplit ? ( +

+ {isEditMode ? 'Edit Uber Split' : 'Split an Uber'} +

+ ) : ( +

+ {isEditMode ? 'Edit Carpool' : 'Create New Carpool'} +

+ )}
diff --git a/src/features/carpool/components/ui/CarpoolLoadingPlaceholder.tsx b/src/features/carpool/components/ui/CarpoolLoadingPlaceholder.tsx new file mode 100644 index 0000000..2e6f8b7 --- /dev/null +++ b/src/features/carpool/components/ui/CarpoolLoadingPlaceholder.tsx @@ -0,0 +1,24 @@ +export default function CarpoolLoadingPlaceholder() { + return ( +
+ {[...Array(8)].map((_, index) => ( +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))} +
+ ) +} \ No newline at end of file diff --git a/src/features/carpool/components/ui/NoCarpoolsAvailable.tsx b/src/features/carpool/components/ui/NoCarpoolsAvailable.tsx new file mode 100644 index 0000000..2729cef --- /dev/null +++ b/src/features/carpool/components/ui/NoCarpoolsAvailable.tsx @@ -0,0 +1,13 @@ +export default function NoCarpoolsAvailable() { + return ( +
+
+
+
+

No Carpools Available

+

+ There are currently no carpools scheduled. Check back later or create your own! +

+
+ ) +} \ No newline at end of file diff --git a/src/features/carpool/enums/CarpoolTypeEnum.ts b/src/features/carpool/enums/CarpoolTypeEnum.ts new file mode 100644 index 0000000..67ef49b --- /dev/null +++ b/src/features/carpool/enums/CarpoolTypeEnum.ts @@ -0,0 +1,4 @@ +export enum CarpoolTypeEnum { + Carpool = 'Carpool', + UberSplit = 'UberSplit', +} \ No newline at end of file diff --git a/src/features/carpool/interfaces/CarpoolPost.ts b/src/features/carpool/interfaces/CarpoolPost.ts index dfb0a3b..a164a5a 100644 --- a/src/features/carpool/interfaces/CarpoolPost.ts +++ b/src/features/carpool/interfaces/CarpoolPost.ts @@ -1,5 +1,6 @@ import { CarpoolStatusEnum } from "../enums/CarpoolStatusEnum"; import { Timestamp } from "firebase/firestore"; +import { CarpoolTypeEnum } from "../enums/CarpoolTypeEnum"; export default interface CarpoolPost { @@ -10,6 +11,7 @@ export default interface CarpoolPost { description: string; maxPeople: number; carType: string; + type: CarpoolTypeEnum; status: CarpoolStatusEnum; people: string[]; requests: string[]; // Array of user IDs who have requested to join From 8d3b222964ee673c741aa7f85fbd7e6283c8abe7 Mon Sep 17 00:00:00 2001 From: Ethan Tiger Wakefield Date: Fri, 23 Jan 2026 16:41:31 -0500 Subject: [PATCH 3/3] update details page --- src/features/carpool/components/CarpoolDetails.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/features/carpool/components/CarpoolDetails.tsx b/src/features/carpool/components/CarpoolDetails.tsx index 2bc2294..f65efd8 100644 --- a/src/features/carpool/components/CarpoolDetails.tsx +++ b/src/features/carpool/components/CarpoolDetails.tsx @@ -9,6 +9,7 @@ import { db } from "@/firebase/config"; import collections from "@/firebase/collections"; import { useState } from "react"; import CarpoolModal from "./CarpoolModal"; +import { CarpoolTypeEnum } from "../enums/CarpoolTypeEnum"; export default function CarpoolDetails() { const { id } = useParams<{ id: string }>(); @@ -626,7 +627,7 @@ export default function CarpoolDetails() {

- Carpool Details + {carpool.type === CarpoolTypeEnum.Carpool ? 'Carpool Details' : 'Uber Split Details'}

Review and join this carpool @@ -779,7 +780,7 @@ export default function CarpoolDetails() {

-

Driver

+

Creator

@@ -811,10 +812,10 @@ export default function CarpoolDetails() {
)}
-
+ {carpool.type === CarpoolTypeEnum.Carpool && (
Driver -
+
)}
@@ -963,7 +964,7 @@ export default function CarpoolDetails() { : 'bg-slate-100 text-slate-600 dark:bg-slate-700/50 dark:text-slate-400' }`}> {carpool.userId === currentUser.uid - ? '🚗 You are the driver of this carpool' + ? 'You are the creator of this carpool' : carpool.people.includes(currentUser.uid) ? '✅ You are part of this carpool' : '👤 You are not part of this carpool'} @@ -1087,6 +1088,7 @@ export default function CarpoolDetails() { {/* Edit Carpool Modal */} setIsEditModalOpen(false)} carpool={carpool} onSuccess={handleEditSuccess}