diff --git a/public/sponsors/2fast.png b/public/sponsors/2fast.png new file mode 100644 index 0000000..f07d4af Binary files /dev/null and b/public/sponsors/2fast.png differ diff --git a/public/sponsors/Artis_logo_white_text.png b/public/sponsors/Artis_logo_white_text.png new file mode 100644 index 0000000..ce86a6d Binary files /dev/null and b/public/sponsors/Artis_logo_white_text.png differ diff --git a/public/sponsors/Global-productions.png b/public/sponsors/Global-productions.png deleted file mode 100644 index a3ae3dc..0000000 Binary files a/public/sponsors/Global-productions.png and /dev/null differ diff --git a/public/sponsors/Global-productions.svg b/public/sponsors/Global-productions.svg new file mode 100644 index 0000000..1297096 --- /dev/null +++ b/public/sponsors/Global-productions.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/sponsors/MANK.png b/public/sponsors/MANK.png new file mode 100644 index 0000000..d01cff0 Binary files /dev/null and b/public/sponsors/MANK.png differ diff --git a/public/sponsors/TS_InLine_BlueLight.svg b/public/sponsors/TS_InLine_BlueLight.svg new file mode 100644 index 0000000..b14063e --- /dev/null +++ b/public/sponsors/TS_InLine_BlueLight.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/public/sponsors/arvutitark.svg b/public/sponsors/arvutitark.svg new file mode 100644 index 0000000..317f63c --- /dev/null +++ b/public/sponsors/arvutitark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/app/[locale]/ajakava/page.tsx b/src/app/[locale]/ajakava/page.tsx index e32f55f..abbe0f0 100644 --- a/src/app/[locale]/ajakava/page.tsx +++ b/src/app/[locale]/ajakava/page.tsx @@ -1,27 +1,198 @@ -import { vipnagorgialla } from "@/components/Vipnagorgialla"; -import { getTranslations, setRequestLocale } from "next-intl/server"; +"use client"; -export default async function Timetable({ - params, -}: { - params: Promise<{ locale: string }>; -}) { - const { locale } = await params; - setRequestLocale(locale); - const t = await getTranslations({ locale }); +import { useState } from "react"; +import { useSearchParams } from "next/navigation"; +import { vipnagorgialla } from "@/components/Vipnagorgialla"; +import { scheduleData, type ScheduleItem } from "@/data/timetable"; +import { useTranslations, useLocale } from "next-intl"; + +const tabs = Object.keys(scheduleData); + +// Map of filter shorthand to location key suffixes +const FILTER_MAP: Record = { + aula: ['auditorium'], + auditorium: ['auditorium'], + tudengimaja: ['studentHouse'], + studenthouse: ['studentHouse'], + fuajee: ['lobbyAndLanArea'], + foyer: ['lobbyAndLanArea'], + lan: ['lobbyAndLanArea'], + lanarea: ['lobbyAndLanArea'], + lobby: ['lobbyAndLanArea'], +}; + +function matchesFilter(item: ScheduleItem, filter: string): boolean { + const normalizedFilter = filter.toLowerCase(); + const locationKeys = Array.isArray(item.locationKey) ? item.locationKey : [item.locationKey]; + + // Get the matching location suffixes from the filter map, or use the filter directly + const filterSuffixes = FILTER_MAP[normalizedFilter] || [normalizedFilter]; + + // Check if any of the item's location keys contain any of the filter suffixes + return locationKeys.some(key => + filterSuffixes.some(suffix => + key.toLowerCase().includes(suffix.toLowerCase()) + ) + ); +} + +function formatLocationKeys(keys: string[], t: (key: string) => string, locale: string): string { + const translated = keys.map(k => t(k)); + if (translated.length === 1) return translated[0]; + + const isEstonian = locale === 'et'; + const and = isEstonian ? ' ja ' : ' and '; + + if (translated.length === 2) { + return translated.join(and); + } + + if (isEstonian) { + return translated.slice(0, -1).join(', ') + and + translated[translated.length - 1]; + } + + return translated.slice(0, -1).join(', ') + ', and ' + translated[translated.length - 1]; +} + +export default function Timetable() { + const searchParams = useSearchParams(); + const filter = searchParams.get('filter') || ''; + const [activeTab, setActiveTab] = useState(tabs[0]); + const schedule = scheduleData[activeTab]; + const t = useTranslations(); + const locale = useLocale(); + + // Filter schedule items based on the filter parameter + const filteredSchedule = filter + ? schedule.filter(item => matchesFilter(item, filter)) + : schedule; return ( -
-

- {t("schedule.title")} -

-

- {t("schedule.comingSoon")} -

+
+
+

+ {t("schedule.title")} +

+ + {/* Tab menu */} +
+ {tabs.map((tab) => ( + + ))} +
+ + {/* Filter buttons */} +
+

+ {t("schedule.location")} +

+
+
+ + + + +
+ + {/* Schedule entries */} +
+ {filteredSchedule.map((item, idx) => ( +
+
+ {item.time} +
+
+
+ {t(item.titleKey)} +
+ {item.description && ( +
+ {item.description} +
+ )} +
+ {Array.isArray(item.locationKey) + ? formatLocationKeys(item.locationKey, t, locale) + : t(item.locationKey) + } +
+
+
+ ))} +
+

{t("schedule.transportInfo")}

+
); } diff --git a/src/app/[locale]/kodukord/page.tsx b/src/app/[locale]/kodukord/page.tsx index e05517c..a1e2456 100644 --- a/src/app/[locale]/kodukord/page.tsx +++ b/src/app/[locale]/kodukord/page.tsx @@ -32,7 +32,7 @@ export default async function Page({ return (
-
+
{/* Main content */}
{/* Page title */} diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 74d8751..d8bfdd3 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -41,7 +41,7 @@ const Header = ({ navItems }: HeaderProps) => { const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); // Header navigation should include all options except homepage and hidden items - const hiddenNavHrefs: NavItem["href"][] = ["/messiala", "/ajakava"]; + const hiddenNavHrefs: NavItem["href"][] = ["/messiala"]; const mainNavItems = navItems.filter( (item) => item.href !== "/" && !hiddenNavHrefs.includes(item.href), ); diff --git a/src/components/Sponsors.tsx b/src/components/Sponsors.tsx index 62dd8a9..e3593d0 100644 --- a/src/components/Sponsors.tsx +++ b/src/components/Sponsors.tsx @@ -54,23 +54,23 @@ const sponsors: Sponsor[] = [ href: "https://k-space.ee/", src: "/sponsors/k-space_ee-white.png", alt: "K-Space", - width: 200, - height: 200, + width: 244, + height: 244, className: "not-dark:invert", }, { href: "https://globalproductions.ee/", - src: "/sponsors/Global-productions.png", + src: "/sponsors/Global-productions.svg", alt: "Global Productions", - width: 200, - height: 200, + width: 244, + height: 244, }, { href: "https://www.linkedin.com/company/gamedev-guild/", src: "/sponsors/estonian_gamedev_guild.png", alt: "Estonian Gamedev Guild", - width: 200, - height: 200, + width: 244, + height: 244, className: "not-dark:invert", }, { @@ -84,15 +84,15 @@ const sponsors: Sponsor[] = [ href: "https://ingame.ee/", src: "/sponsors/ingame.png", alt: "iNGAME", - width: 200, - height: 200, + width: 164, + height: 164, }, { href: "https://www.tallinn.ee/et/haridusamet", src: "/sponsors/Tallinna_Haridusamet_logo_RGB.svg", alt: "Tallinna Haridusamet", - width: 200, - height: 200, + width: 244, + height: 244, }, { href: "https://parkminigolf.ee/", @@ -105,15 +105,15 @@ const sponsors: Sponsor[] = [ href: "https://www.lemongym.ee/", src: "/sponsors/lemongym.png", alt: "Lemongym", - width: 200, - height: 200, + width: 144, + height: 144, }, { href: "https://www.elamusgolf.eu/", src: "/sponsors/elamusgolf.png", alt: "Elamusgolf", - width: 200, - height: 200, + width: 164, + height: 164, }, { href: "https://www.egda.ee/", @@ -121,7 +121,42 @@ const sponsors: Sponsor[] = [ alt: "Estonian Game Developers Association", width: 344, height: 344, - } + }, + { + href: "https://www.teamspeak.com/", + src: "/sponsors/TS_InLine_BlueLight.svg", + alt: "TeamSpeak", + width: 344, + height: 344, + }, + { + href: "https://arvutitark.ee/", + src: "/sponsors/arvutitark.svg", + alt: "Arvutitark", + width: 344, + height: 344, + }, + { + href: "https://www.kino.ee/", + src: "/sponsors/Artis_logo_white_text.png", + alt: "Artis Kino", + width: 344, + height: 344, + }, + { + href: "https://www.tallinn.ee/et/mank", + src: "/sponsors/MANK.png", + alt: "Mustamäe Avatud Noortekeskus", + width: 200, + height: 244, + }, + { + href: "https://2fast.ee/", + src: "/sponsors/2fast.png", + alt: "2FAST", + width: 244, + height: 244, + }, ]; interface SponsorsProps { diff --git a/src/components/SwitchableTicketCard.tsx b/src/components/SwitchableTicketCard.tsx index 58c48b4..62d210c 100644 --- a/src/components/SwitchableTicketCard.tsx +++ b/src/components/SwitchableTicketCard.tsx @@ -288,14 +288,14 @@ export default function SwitchableTicketCard({ {/* Chevron buttons on left/right sides */}