diff --git a/components/MonthCalendar.tsx b/components/MonthCalendar.tsx new file mode 100644 index 0000000..9ef0a01 --- /dev/null +++ b/components/MonthCalendar.tsx @@ -0,0 +1,34 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +// remove this later^ +import FullCalendar from "@fullcalendar/react"; +import dayGridPlugin from "@fullcalendar/daygrid"; +import resourceTimelinePlugin from "@fullcalendar/resource-timeline"; +import resourceTimeGridPlugin from "@fullcalendar/resource-timegrid"; +import interactionPlugin from "@fullcalendar/interaction"; +import { useLanguage } from "@/lib/LanguageContext"; +import fiLocale from "@fullcalendar/core/locales/fi"; +import svLocale from "@fullcalendar/core/locales/sv"; +import enLocale from "@fullcalendar/core/locales/en-gb"; + +const MonthCalendar = () => { + const { language } = useLanguage(); + const localeMap = { + fi: fiLocale, + sv: svLocale, + en: enLocale, + }; + const currentLocale = localeMap[language] || enLocale; + return ( + <> + +
+ + ); +}; + +export default MonthCalendar; diff --git a/components/WeekCalendar.tsx b/components/WeekCalendar.tsx new file mode 100644 index 0000000..dc4abc5 --- /dev/null +++ b/components/WeekCalendar.tsx @@ -0,0 +1,31 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +// remove this later^ +import { useLanguage } from "@/lib/LanguageContext"; +import enLocale from "@fullcalendar/core/locales/en-gb"; +import fiLocale from "@fullcalendar/core/locales/fi"; +import svLocale from "@fullcalendar/core/locales/sv"; +import FullCalendar from "@fullcalendar/react"; +import dayGridPlugin from "@fullcalendar/timegrid"; + +const WeekCalendar = () => { + const { language } = useLanguage(); + const localeMap = { + fi: fiLocale, + sv: svLocale, + en: enLocale, + }; + const currentLocale = localeMap[language] || enLocale; + return ( + <> + +
+ + ); +}; + +export default WeekCalendar; diff --git a/hooks/translations.json b/hooks/translations.json index 383c14d..8e9af09 100644 --- a/hooks/translations.json +++ b/hooks/translations.json @@ -4,6 +4,8 @@ "en": "Satakunta Nation", "sv": "Satakunta Nation" }, + "nav:calendar": { "fi": "Kalenteri", "en": "Calendar", "sv": "Kalender" }, + "nav:events": { "fi": "Tapahtumat", "en": "Events", "sv": "Evenemang" }, "nav:forMembers": { "fi": "Jäsenille", "en": "For Members", @@ -21,6 +23,7 @@ "en": "Nation Info", "sv": "Samma på svenska" }, + "nav:news": { "fi": "Uutiset", "en": "News", "sv": "Nyheter" }, "nav:officialDocuments": { "fi": "Viralliset Dokumentit", "en": "Official Documents", diff --git a/package-lock.json b/package-lock.json index 1a0ea6c..8c68408 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,14 @@ "@directus/sdk": "^17.0.0", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", + "@fullcalendar/core": "^6.1.15", + "@fullcalendar/daygrid": "^6.1.15", + "@fullcalendar/interaction": "^6.1.15", + "@fullcalendar/react": "^6.1.15", + "@fullcalendar/resource": "^6.1.15", + "@fullcalendar/resource-timegrid": "^6.1.15", + "@fullcalendar/resource-timeline": "^6.1.15", + "@fullcalendar/timegrid": "^6.1.15", "@mui/material": "^5.15.20", "dotenv": "^16.4.5", "embla-carousel": "^8.1.6", @@ -1156,6 +1164,146 @@ "integrity": "sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==", "license": "MIT" }, + "node_modules/@fullcalendar/core": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.15.tgz", + "integrity": "sha512-BuX7o6ALpLb84cMw1FCB9/cSgF4JbVO894cjJZ6kP74jzbUZNjtwffwRdA+Id8rrLjT30d/7TrkW90k4zbXB5Q==", + "license": "MIT", + "dependencies": { + "preact": "~10.12.1" + } + }, + "node_modules/@fullcalendar/daygrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/daygrid/-/daygrid-6.1.15.tgz", + "integrity": "sha512-j8tL0HhfiVsdtOCLfzK2J0RtSkiad3BYYemwQKq512cx6btz6ZZ2RNc/hVnIxluuWFyvx5sXZwoeTJsFSFTEFA==", + "license": "MIT", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/interaction": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/interaction/-/interaction-6.1.15.tgz", + "integrity": "sha512-DOTSkofizM7QItjgu7W68TvKKvN9PSEEvDJceyMbQDvlXHa7pm/WAVtAc6xSDZ9xmB1QramYoWGLHkCYbTW1rQ==", + "license": "MIT", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/premium-common": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-6.1.15.tgz", + "integrity": "sha512-IwUHptHNzWDOgAsXLoBntGxmbfCKvUy6iYFMCP3F3ahbG58E0PJMYsXvgw+NaA7Cz4gcQoVHioGjIFgQqs3Keg==", + "license": "SEE LICENSE IN LICENSE.md", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/react": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/react/-/react-6.1.15.tgz", + "integrity": "sha512-L0b9hybS2J4e7lq6G2CD4nqriyLEqOH1tE8iI6JQjAMTVh5JicOo5Mqw+fhU5bJ7hLfMw2K3fksxX3Ul1ssw5w==", + "license": "MIT", + "peerDependencies": { + "@fullcalendar/core": "~6.1.15", + "react": "^16.7.0 || ^17 || ^18 || ^19", + "react-dom": "^16.7.0 || ^17 || ^18 || ^19" + } + }, + "node_modules/@fullcalendar/resource": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource/-/resource-6.1.15.tgz", + "integrity": "sha512-s9Rz3HNDQWBYCG+V4wqg8x5+UTD5kC3S2poq+5zwbPeyWT8+FEILikQZIgfESX70Z4fn8bBlLJ04Jd/LijfqWw==", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "@fullcalendar/premium-common": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/resource-daygrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-daygrid/-/resource-daygrid-6.1.15.tgz", + "integrity": "sha512-4SVfr2Gf0KtLkW56U9gCXf8Jrug8CDJ81g0KMCTbTsaqrIdQ0DKWc0O5+4UVvibwUeh2jWQNIVXXOoPQ5lDHhQ==", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "@fullcalendar/daygrid": "~6.1.15", + "@fullcalendar/premium-common": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15", + "@fullcalendar/resource": "~6.1.15" + } + }, + "node_modules/@fullcalendar/resource-timegrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timegrid/-/resource-timegrid-6.1.15.tgz", + "integrity": "sha512-nT3aT8WGm4zSek1zcGCm4NRmuBdAhl+Tpod/NH8N5ZcN3A490GdT7J3uDK1KzPb+5kQ/RlW0Pzj0hF4B5BkBwg==", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "@fullcalendar/premium-common": "~6.1.15", + "@fullcalendar/resource-daygrid": "~6.1.15", + "@fullcalendar/timegrid": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15", + "@fullcalendar/resource": "~6.1.15" + } + }, + "node_modules/@fullcalendar/resource-timeline": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-6.1.15.tgz", + "integrity": "sha512-3bvGNDE84ZEV6RLZcYWvMWaViLm22Uw182PMXmFjvq2Vh/bPrrzeLkmyocPsyiT2Bbv5THxwLyzMd7X3Qi/v3Q==", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "@fullcalendar/premium-common": "~6.1.15", + "@fullcalendar/scrollgrid": "~6.1.15", + "@fullcalendar/timeline": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15", + "@fullcalendar/resource": "~6.1.15" + } + }, + "node_modules/@fullcalendar/scrollgrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-6.1.15.tgz", + "integrity": "sha512-z7q6eh9bUSQ60YwgztPlJzQAMr6XQgky6bxNQR9cMqfzcwyo/ww11G7OZUp840VIXyqT3g8XPziEDbS5zB4VVQ==", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "@fullcalendar/premium-common": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/timegrid": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.15.tgz", + "integrity": "sha512-61ORr3A148RtxQ2FNG7JKvacyA/TEVZ7z6I+3E9Oeu3dqTf6M928bFcpehRTIK6zIA6Yifs7BeWHgOE9dFnpbw==", + "license": "MIT", + "dependencies": { + "@fullcalendar/daygrid": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, + "node_modules/@fullcalendar/timeline": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-6.1.15.tgz", + "integrity": "sha512-VWylStpFFS8lZVUqu0c1b0MF5gkuVH2lzyCK/gopMsbrppqr97sHDTfWEYDHaQXCeO7cd4gKXSliQ0dc9GMlUw==", + "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "@fullcalendar/premium-common": "~6.1.15", + "@fullcalendar/scrollgrid": "~6.1.15" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.15" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -6414,6 +6562,16 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/preact": { + "version": "10.12.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz", + "integrity": "sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", diff --git a/package.json b/package.json index dabe2e1..90a8c3a 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,14 @@ "@directus/sdk": "^17.0.0", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", + "@fullcalendar/core": "^6.1.15", + "@fullcalendar/daygrid": "^6.1.15", + "@fullcalendar/interaction": "^6.1.15", + "@fullcalendar/react": "^6.1.15", + "@fullcalendar/resource": "^6.1.15", + "@fullcalendar/resource-timegrid": "^6.1.15", + "@fullcalendar/resource-timeline": "^6.1.15", + "@fullcalendar/timegrid": "^6.1.15", "@mui/material": "^5.15.20", "dotenv": "^16.4.5", "embla-carousel": "^8.1.6", diff --git a/pages/calendar.tsx b/pages/calendar.tsx new file mode 100644 index 0000000..0af5838 --- /dev/null +++ b/pages/calendar.tsx @@ -0,0 +1,51 @@ +import Navbar, { NavbarProps } from "@/components/Navbar"; +import createClient from "@/lib/cmsClient"; +import styles from "@/styles/calendar.module.css"; +import { readItems } from "@directus/sdk"; +import { GetStaticProps } from "next"; +import Head from "next/head"; +import MonthCalendar from "@/components/MonthCalendar"; + +export const getStaticProps: GetStaticProps = async () => { + const client = createClient(); + const links = await client.request(readItems("NavigationLink")); + return { + props: { + navBar: { + links, + }, + }, + }; +}; + +type CalendarPageProps = { + navBar: NavbarProps; +}; + +export default function News({ navBar }: CalendarPageProps) { + return ( + <> + + Satakuntalainen Osakunta + + + + +
+
+

Kalenteri

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem odit + distinctio, ullam doloremque provident voluptas illo quaerat ex + saepe voluptate reiciendis rerum fuga obcaecati esse sit cum maxime, + dolorem facilis? +

+
+
+
+ +
+