Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event metadata #925

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
21 changes: 17 additions & 4 deletions apps/web/src/app/events/components/EventInfoBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Committee, Company, Event } from "@dotkomonline/types"
import { formatDate } from "@dotkomonline/utils"
import Image from "next/image"
import type { FC } from "react"

Expand All @@ -18,11 +19,23 @@ const mapToImageAndName = (item: Committee | Company) => (
export const EventInfoBox: FC<Props> = ({ event, committees, companies }) => {
const committeeList = committees.map(mapToImageAndName)
const companyList = companies.map(mapToImageAndName)
// TODO - implement event organizers
const eventOrganizers = ["Ola", "Kari"]

const listFormat = new Intl.ListFormat("no-NB", { type: "conjunction" })

return (
<div className="mr-10 w-full flex flex-col gap-8 md:w-[60%]">
<div className="flex flex-row gap-8">{[...committeeList, ...companyList]}</div>
<p className="bg-slate-2 p-5 text-[18px] rounded-2xl">{event.description}</p>
</div>
<section className="mr-10 w-full flex flex-col space-y-8 md:w-[60%]">
<section className="flex flex-row space-x-8">
<div className="flex flex-row space-x-4">{[...committeeList, ...companyList]}</div>
<div className="flex flex-row space-x-4 text-slate-9 items-center">
<span>Lagt ut {formatDate(event.createdAt)}</span>
<span>Organisert av {listFormat.format(eventOrganizers)}</span>
</div>
</section>
<div className="bg-slate-2 p-5 text-[18px] rounded-2xl">
<p>{event.description}</p>
</div>
</section>
)
}
Loading