-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from osakunta/next-site
Semantic fixes, News page, and Calendar Page
- Loading branch information
Showing
20 changed files
with
965 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<> | ||
<FullCalendar | ||
schedulerLicenseKey={process.env.FULL_CALENDAR_KEY} | ||
plugins={[dayGridPlugin]} | ||
initialView="dayGridMonth" | ||
locale={currentLocale} | ||
/> | ||
<div /> | ||
</> | ||
); | ||
}; | ||
|
||
export default MonthCalendar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<> | ||
<FullCalendar | ||
schedulerLicenseKey={process.env.FULL_CALENDAR_KEY} | ||
plugins={[dayGridPlugin]} | ||
initialView="timeGridWeek" | ||
locale={currentLocale} | ||
/> | ||
<div /> | ||
</> | ||
); | ||
}; | ||
|
||
export default WeekCalendar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<CalendarPageProps> = 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 ( | ||
<> | ||
<Head> | ||
<title>Satakuntalainen Osakunta</title> | ||
<link rel="icon" href="/favicon.ico" type="image/x-icon" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
</Head> | ||
<Navbar links={navBar.links} /> | ||
<header className={styles.header}> | ||
<div className={styles.headerContainer}> | ||
<h1 className={styles.h1}>Kalenteri</h1> | ||
<p className={styles.headerText}> | ||
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? | ||
</p> | ||
</div> | ||
</header> | ||
<main className={styles.main}> | ||
<MonthCalendar /> | ||
</main> | ||
<footer className={styles.footer} /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.