Skip to content

Commit

Permalink
Fixed EventInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
rishit-singh committed Mar 30, 2024
1 parent 6e280ea commit 9323993
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
7 changes: 2 additions & 5 deletions frontend/src/app/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ export default function Footer()
register: "https://forms.gle/gPdqMB5ijafDMRAY8"
};

// const year = useMemo(() => , []);

const resourcesMap = new Map<string, string>([
["Course Planner", "https://planner.langaracs.tech/" ],
["Transfer Resources", "https://langaracs.notion.site/Transfer-Information-a0548da4b3084681868381310c604c34"],
["Course Resources", "https://langaracs.notion.site/Langara-CS-Resources-12b750af5ecc4eeb86315d3d9fd8f1ce?pvs=4"],
["Feedback", forms.feedback],
["Feedback", forms.feedback]
]);

const linksMap = new Map<string, string>([
Expand Down Expand Up @@ -106,6 +104,5 @@ export default function Footer()
<div className="alignment_div opacity-0">I am not here</div>
</div>
</div>
</>
);
</>);
}
22 changes: 11 additions & 11 deletions frontend/src/app/events/Event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ export default function EventInstance({Event} : EventProps)
<div className={"flex flex-col self-start gap-2 text-sm p-2"}>
<a className={"text-xl font-bold hover:text-lang-orange max-[600px]:text-lg select-none"} >{Event.Title}</a>
<div className={"flex flex-col gap-1 max-[600px]:gap-2"}>
<IconLabel Label={event.CurrentEvent.Start.toDateString()}>
<IconLabel Label={Event.Start.toDateString()}>
<svg fill="#ffffff" width="28px" height="28px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M19,4H17V3a1,1,0,0,0-2,0V4H9V3A1,1,0,0,0,7,3V4H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V7A3,3,0,0,0,19,4Zm1,15a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V12H20Zm0-9H4V7A1,1,0,0,1,5,6H7V7A1,1,0,0,0,9,7V6h6V7a1,1,0,0,0,2,0V6h2a1,1,0,0,1,1,1Z"></path></g></svg>
</IconLabel>

<IconLabel Label={`${getTimeStamp(event.CurrentEvent.Start)} - ${getTimeStamp(event.CurrentEvent.End)}`}>
<IconLabel Label={`${getTimeStamp(Event.Start)} - ${getTimeStamp(Event.End)}`}>
<svg width="28px" height="28px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M12 7V12L14.5 10.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#ffffff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"></path> </g></svg>
</IconLabel>

<IconLabel Label={(event.CurrentEvent.Location != null) ? event.CurrentEvent.Location : "TBD"}>
<IconLabel Label={(Event.Location != null) ? Event.Location : "TBD"}>
<svg width="28px" height="28px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M12 21C15.5 17.4 19 14.1764 19 10.2C19 6.22355 15.866 3 12 3C8.13401 3 5 6.22355 5 10.2C5 14.1764 8.5 17.4 12 21Z" stroke="#ffffff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"></path> <path d="M12 12C13.1046 12 14 11.1046 14 10C14 8.89543 13.1046 8 12 8C10.8954 8 10 8.89543 10 10C10 11.1046 10.8954 12 12 12Z" stroke="#ffffff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"></path> </g></svg>
</IconLabel>
</div>
Expand All @@ -77,36 +77,36 @@ export default function EventInstance({Event} : EventProps)
</DialogTrigger>
<DialogContent className="bg-[#272626] border-0">
<DialogHeader>
<DialogTitle className="text-2xl">{event.CurrentEvent.Title}</DialogTitle>
<DialogTitle className="text-2xl">{Event.Title}</DialogTitle>
</DialogHeader>
<DialogDescription>
<div className="flex flex-col gap-2 max-[600px]:gap-0">
<div className="flex flex-row gap-4 p-8">
<img
alt="event-image"
src={event.CurrentEvent.Image}
src={Event.Image}
height={100}
width={130}
className="rounded"
/>
<div className="flex flex-col text-white">
<IconLabel Label={event.CurrentEvent.Start.toDateString()}>
<IconLabel Label={Event.Start.toDateString()}>
<svg fill="#ffffff" width="28px" height="28px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M19,4H17V3a1,1,0,0,0-2,0V4H9V3A1,1,0,0,0,7,3V4H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V7A3,3,0,0,0,19,4Zm1,15a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V12H20Zm0-9H4V7A1,1,0,0,1,5,6H7V7A1,1,0,0,0,9,7V6h6V7a1,1,0,0,0,2,0V6h2a1,1,0,0,1,1,1Z"></path></g></svg>
</IconLabel>

<IconLabel Label={`${getTimeStamp(event.CurrentEvent.Start)} - ${getTimeStamp(event.CurrentEvent.End)}`}>
<IconLabel Label={`${getTimeStamp(Event.Start)} - ${getTimeStamp(Event.End)}`}>
<svg width="28px" height="28px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M12 7V12L14.5 10.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#ffffff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"></path> </g></svg>
</IconLabel>

<IconLabel Label={(event.CurrentEvent.Location != null) ? event.CurrentEvent.Location : "TBD"}>
<IconLabel Label={(Event.Location != null) ? Event.Location : "TBD"}>
<svg width="28px" height="28px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M12 21C15.5 17.4 19 14.1764 19 10.2C19 6.22355 15.866 3 12 3C8.13401 3 5 6.22355 5 10.2C5 14.1764 8.5 17.4 12 21Z" stroke="#ffffff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"></path> <path d="M12 12C13.1046 12 14 11.1046 14 10C14 8.89543 13.1046 8 12 8C10.8954 8 10 8.89543 10 10C10 11.1046 10.8954 12 12 12Z" stroke="#ffffff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"></path> </g></svg>
</IconLabel></div> </div>
</div>
<div className="flex flex-col w-full flex-wrap items-center gap-3 text-white">
<span className="text-lg font-bold self-center">Description</span>
<div className="text-sm overflow-x-auto max-h-screen">
{event.CurrentEvent.Description != null ? (
<div dangerouslySetInnerHTML={{ __html: event.CurrentEvent.Description }}></div>
{Event.Description != null ? (
<div dangerouslySetInnerHTML={{ __html: Event.Description }}></div>
) : (
"No description."
)}
Expand All @@ -115,7 +115,7 @@ export default function EventInstance({Event} : EventProps)
</DialogDescription>
<DialogFooter>
<div className="flex flex-row gap-3 items-end">
<Button className={"bg-[#4a4949] text-white"} onClick={() => router.push(event.CurrentEvent.Link.Google)}>Add to Calendar</Button>
<Button className={"bg-[#4a4949] text-white"} onClick={() => router.push(Event.Link.Google)}>Add to Calendar</Button>
<DialogClose asChild>
<Button className={"bg-[#4a4949] text-white"}>Close</Button>
</DialogClose>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/events/EventsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export default function EventsPage()

useEffect(() => {
(async () => {
console.log("Fetching events.");
if (event.Events.length < 1)
{
const fetchedEvents: CalendarEvent[] = (await mainDispatch(fetchEventsAsync() as AppDispatch)) as unknown as CalendarEvent[];
Expand Down

0 comments on commit 9323993

Please sign in to comment.