-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
essi1
committed
Oct 12, 2022
1 parent
404092f
commit fab1cf1
Showing
12 changed files
with
225 additions
and
23 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
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,26 @@ | ||
import DynamicComponent from "../components/DynamicComponent/dynamicComponent"; | ||
import Head from "next/head"; | ||
|
||
const Educations = ({ locale, elements }) => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>{titles[locale]}</title> | ||
</Head> | ||
<div> | ||
{elements?.map((element, index) => ( | ||
<DynamicComponent | ||
key={index} | ||
component={element?.acf_fc_layout} | ||
props={element} | ||
locale={locale} | ||
/> | ||
))} | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
const titles = { fi: "Koulutukset", sv: "Träning", en: "Educations" } | ||
|
||
export default Educations |
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,26 @@ | ||
import DynamicComponent from "../components/DynamicComponent/dynamicComponent"; | ||
import Head from "next/head"; | ||
|
||
const Events = ({ locale, elements }) => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>{titles[locale]}</title> | ||
</Head> | ||
<div> | ||
{elements?.map((element, index) => ( | ||
<DynamicComponent | ||
key={index} | ||
component={element?.acf_fc_layout} | ||
props={element} | ||
locale={locale} | ||
/> | ||
))} | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
const titles = { fi: "Tapahtumat", sv: "Evenemang", en: "Events" } | ||
|
||
export default Events |
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 |
---|---|---|
@@ -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 ( | ||
<Layout> | ||
<IndexPage locale={"fi"} elements={elements} /> | ||
<Educations locale={"fi"} elements={elements} /> | ||
</Layout> | ||
) | ||
|
||
} | ||
|
||
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 | ||
|
||
export default EducationsPage |
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,26 @@ | ||
import Layout from "../../components/Layout/Layout"; | ||
import Educations from "../../pageComponents/Educations"; | ||
|
||
const EducationsPage = ({ elements }) => { | ||
return ( | ||
<Layout locale={"en"}> | ||
<Educations locale={"en"} elements={elements} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
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 |
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,26 @@ | ||
import Layout from "../../components/Layout/Layout"; | ||
import Events from "../../pageComponents/Events"; | ||
|
||
const EventsPage = ({ elements }) => { | ||
return ( | ||
<Layout locale={"en"}> | ||
<Events locale={"en"} elements={elements} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
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 |
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,25 @@ | ||
import Layout from "../components/Layout/Layout" | ||
import Events from "../pageComponents/Events" | ||
|
||
const EventsPage = ({ elements }) => { | ||
return ( | ||
<Layout> | ||
<Events locale={"fi"} elements={elements} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
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 |
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,26 @@ | ||
import Layout from "../../components/Layout/Layout"; | ||
import Educations from "../../pageComponents/Educations"; | ||
|
||
const EducationPage = ({ elements }) => { | ||
return ( | ||
<Layout locale={"fi"}> | ||
<Educations locale={"fi"} elements={elements} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
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 |
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,26 @@ | ||
import Layout from "../../components/Layout/Layout"; | ||
import Events from "../../pageComponents/Events"; | ||
|
||
const EventsPage = ({ elements }) => { | ||
return ( | ||
<Layout locale={"sv"}> | ||
<Events locale={"sv"} elements={elements} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
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 |
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,26 @@ | ||
import Layout from "../../components/Layout/Layout"; | ||
import Educations from "../../pageComponents/Educations"; | ||
|
||
const EducationsPage = ({ elements }) => { | ||
return ( | ||
<Layout locale={"sv"}> | ||
<Educations locale={"sv"} elements={elements} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
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 |