Skip to content

Commit

Permalink
Added support for Event attachments to give each event an image
Browse files Browse the repository at this point in the history
  • Loading branch information
rishit-singh committed Dec 30, 2023
1 parent dadd900 commit 03926ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/events/Event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function EventInstance({Event} : EventProps)
return (<>
<div className="flex flex-row bg-[#272626] h-[20vh] w-[50vw] max-[600px]:w-[90vw] rounded-lg items-center">
<div className={"basis-1/6 self-center m-5"}>
<Image alt={"event-image"} loader={({ src } ) => Event.Image} src={Event.Image} height={100} width={130} className={"rounded"}/>
<Image alt={"event-image"} src={Event.Image} height={100} width={130} className={"rounded"}/>
</div>
<div className={"flex flex-col self-start mt-2 gap-3"}>
<div className={"text-xl font-bold"}>{Event.Title}</div>
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 @@ -14,7 +14,6 @@ export default function EventsPage()

const [events, setEvents] = useState(new Array<CalendarEvent>());


useEffect(() => {
(async () => {
setEvents((await mainDispatch(fetchEventsAsync() as AppDispatch)) as unknown as CalendarEvent[]);
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/app/thunks/EventThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ export const fetchEventsAsync = () => async (state: RootState, dispatch: AppDisp
}
}))).json();

console.log(response);

return response["Payload"].map((item: any) => {
return {
Title: item.Title,
Start: new Date(item.Start),
End: new Date(item.End),
Description: item.Description,
Location: item.Location,
Image: "https://langaracpsc.github.io/assets/social.png"
Image: (item.Image != null) ? `data:image/png;base64, ${item.Image}` : ""
} as CalendarEvent;
});
};
};

0 comments on commit 03926ce

Please sign in to comment.