diff --git a/components/Navbar/Navbar.jsx b/components/Navbar/Navbar.jsx index 53010f0..3ed1beb 100644 --- a/components/Navbar/Navbar.jsx +++ b/components/Navbar/Navbar.jsx @@ -66,7 +66,7 @@ const Navbar = ({ locale }) => { - + Vink logo diff --git a/components/Navbar/Navbar.module.css b/components/Navbar/Navbar.module.css index 4ae5e7e..893aaa5 100644 --- a/components/Navbar/Navbar.module.css +++ b/components/Navbar/Navbar.module.css @@ -14,8 +14,11 @@ border-radius: 5px; } +.link:hover { + background-color: #fff; +} -.link:after { +/* .link:after { position: absolute; content: ''; display: block; @@ -25,18 +28,13 @@ background-color: transparent; } -.link:hover { - background-color: #fff; - -} - .activeLink { background-color: #fff; } .activeLink:after { color: black -} +} */ .linkContainer { display: flex; diff --git a/pageComponents/Educations.jsx b/pageComponents/Educations.jsx new file mode 100644 index 0000000..6557223 --- /dev/null +++ b/pageComponents/Educations.jsx @@ -0,0 +1,26 @@ +import DynamicComponent from "../components/DynamicComponent/dynamicComponent"; +import Head from "next/head"; + +const Educations = ({ locale, elements }) => { + return ( + <> + + {titles[locale]} + +
+ {elements?.map((element, index) => ( + + ))} +
+ + ) +} + +const titles = { fi: "Koulutukset", sv: "Träning", en: "Educations" } + +export default Educations \ No newline at end of file diff --git a/pageComponents/Events.jsx b/pageComponents/Events.jsx new file mode 100644 index 0000000..063f514 --- /dev/null +++ b/pageComponents/Events.jsx @@ -0,0 +1,26 @@ +import DynamicComponent from "../components/DynamicComponent/dynamicComponent"; +import Head from "next/head"; + +const Events = ({ locale, elements }) => { + return ( + <> + + {titles[locale]} + +
+ {elements?.map((element, index) => ( + + ))} +
+ + ) +} + +const titles = { fi: "Tapahtumat", sv: "Evenemang", en: "Events" } + +export default Events \ No newline at end of file diff --git a/pages/educations.jsx b/pages/educations.js similarity index 58% rename from pages/educations.jsx rename to pages/educations.js index 0dbfefb..45f5472 100644 --- a/pages/educations.jsx +++ b/pages/educations.js @@ -1,27 +1,25 @@ -import Layout from "../components/Layout/Layout"; -import IndexPage from "../pageComponents/Index"; +import Layout from "../components/Layout/Layout" +import Educations from "../pageComponents/Educations" -const Educations = ({ locale, elements }) => { +const EducationsPage = ({ elements }) => { return ( - + ) - } export const getStaticProps = async () => { const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=educations&acf_format=standard").then(r => r.json()) const elements = res[0]?.acf?.elements - + console.log(elements); return { props: { elements: elements } - } - } -export default Educations \ No newline at end of file + +export default EducationsPage \ No newline at end of file diff --git a/pages/en/educations.jsx b/pages/en/educations.jsx new file mode 100644 index 0000000..263e40f --- /dev/null +++ b/pages/en/educations.jsx @@ -0,0 +1,26 @@ +import Layout from "../../components/Layout/Layout"; +import Educations from "../../pageComponents/Educations"; + +const EducationsPage = ({ elements }) => { + return ( + + + + ) +} + +export const getStaticProps = async () => { + + const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=educations-en&acf_format=standard").then(r => r.json()) + const elements = res[0]?.acf?.elements + + return { + props: { + elements: elements + } + + } + +} + +export default EducationsPage \ No newline at end of file diff --git a/pages/en/events.jsx b/pages/en/events.jsx new file mode 100644 index 0000000..c063285 --- /dev/null +++ b/pages/en/events.jsx @@ -0,0 +1,26 @@ +import Layout from "../../components/Layout/Layout"; +import Events from "../../pageComponents/Events"; + +const EventsPage = ({ elements }) => { + return ( + + + + ) +} + +export const getStaticProps = async () => { + + const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=events-en&acf_format=standard").then(r => r.json()) + const elements = res[0]?.acf?.elements + + return { + props: { + elements: elements + } + + } + +} + +export default EventsPage \ No newline at end of file diff --git a/pages/events.js b/pages/events.js new file mode 100644 index 0000000..f5cdcc3 --- /dev/null +++ b/pages/events.js @@ -0,0 +1,25 @@ +import Layout from "../components/Layout/Layout" +import Events from "../pageComponents/Events" + +const EventsPage = ({ elements }) => { + return ( + + + + ) +} + +export const getStaticProps = async () => { + + const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=events&acf_format=standard").then(r => r.json()) + const elements = res[0]?.acf?.elements + console.log(elements); + return { + props: { + elements: elements + } + } +} + + +export default EventsPage \ No newline at end of file diff --git a/pages/fi/koulutukset.jsx b/pages/fi/koulutukset.jsx new file mode 100644 index 0000000..c01cb2f --- /dev/null +++ b/pages/fi/koulutukset.jsx @@ -0,0 +1,26 @@ +import Layout from "../../components/Layout/Layout"; +import Educations from "../../pageComponents/Educations"; + +const EducationPage = ({ elements }) => { + return ( + + + + ) +} + +export const getStaticProps = async () => { + + const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=educations&acf_format=standard").then(r => r.json()) + const elements = res[0]?.acf?.elements + + return { + props: { + elements: elements + } + + } + +} + +export default EducationPage \ No newline at end of file diff --git a/pages/events.jsx b/pages/fi/tapahtumat.jsx similarity index 60% rename from pages/events.jsx rename to pages/fi/tapahtumat.jsx index bc917eb..127e478 100644 --- a/pages/events.jsx +++ b/pages/fi/tapahtumat.jsx @@ -1,11 +1,10 @@ -import Layout from "../components/Layout/Layout"; -import IndexPage from "../pageComponents/Index"; -import Link from 'next/link' +import Layout from "../../components/Layout/Layout"; +import Events from "../../pageComponents/Events"; -const Events = ({ locale, elements }) => { +const EventsPage = ({ elements }) => { return ( - + ) } @@ -24,4 +23,4 @@ export const getStaticProps = async () => { } -export default Events \ No newline at end of file +export default EventsPage \ No newline at end of file diff --git a/pages/sv/evenemang.jsx b/pages/sv/evenemang.jsx new file mode 100644 index 0000000..cb5f04a --- /dev/null +++ b/pages/sv/evenemang.jsx @@ -0,0 +1,26 @@ +import Layout from "../../components/Layout/Layout"; +import Events from "../../pageComponents/Events"; + +const EventsPage = ({ elements }) => { + return ( + + + + ) +} + +export const getStaticProps = async () => { + + const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=events-sv&acf_format=standard").then(r => r.json()) + const elements = res[0]?.acf?.elements + + return { + props: { + elements: elements, + } + + } + +} + +export default EventsPage \ No newline at end of file diff --git a/pages/sv/traning.jsx b/pages/sv/traning.jsx new file mode 100644 index 0000000..643cdf0 --- /dev/null +++ b/pages/sv/traning.jsx @@ -0,0 +1,26 @@ +import Layout from "../../components/Layout/Layout"; +import Educations from "../../pageComponents/Educations"; + +const EducationsPage = ({ elements }) => { + return ( + + + + ) +} + +export const getStaticProps = async () => { + + const res = await fetch(process.env.NEXT_PUBLIC_WP_URL + "/wp-json/wp/v2/pages?slug=educations-sv&acf_format=standard").then(r => r.json()) + const elements = res[0]?.acf?.elements + + return { + props: { + elements: elements, + } + + } + +} + +export default EducationsPage \ No newline at end of file