Skip to content

Commit

Permalink
added new element & 404 pages
Browse files Browse the repository at this point in the history
  • Loading branch information
essi1 committed Oct 14, 2022
1 parent fab1cf1 commit 39285bc
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 18 deletions.
11 changes: 11 additions & 0 deletions components/Custom404/Custom404.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const Custom404 = () => {
return (
<div>
<h1>404</h1>
<p>Sivua ei löytynyt.</p>
</div>

)
}

export default Custom404
22 changes: 22 additions & 0 deletions components/EventPick/EventPick.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Link from "next/link";

const EventPick = ({ props, locale }) => {

console.log('eventpick', props)

return (
<div style={{ display: "flex", justifyContent: "center", margin: "80px 0" }}>
<Link href={props.event_item.url[locale]}>
<div style={{ position: "relative", width: "100%", maxWidth: "900px", height: "100%", minHeight: "320px" }}>
<img src={props.event_item.image} width={700} height={500} style={{ width: "100%", display: "block" }} />
<div style={{ position: "absolute", textAlign: "center", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }}>
<h2 style={{ fontSize: 30 }}>{props.event_item.title[locale]}</h2>
<p style={{ fontFamily: "Forma DJR Micro", fontSize: 20, fontWeight: 300 }}>{props.event_item.short_desc[locale]}</p>
</div>
</div>
</Link>
</div>
)
}

export default EventPick
14 changes: 0 additions & 14 deletions components/TopPicks/TopPick.jsx

This file was deleted.

1 change: 0 additions & 1 deletion components/TopPicks/TopPicks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import styles from '../../styles/Home.module.css'

const TopPicks = ({ props, locale }) => {

console.log(props)
return (
<div style={{ display: "flex", justifyContent: "center", margin: "80px 0" }}>
<div className={styles.topPicksGrid} >
Expand Down
2 changes: 2 additions & 0 deletions components/lookUp.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import topPicks from "./TopPicks/TopPicks";
import LocalPicks from "./LocalPicks/LocalPicks";
import Calendar from "./Calendar/Calendar";
import EventPick from "./EventPick/EventPick";

const LookUp = {
"top_picks": topPicks,
"event_pick": EventPick,
"local_picks": LocalPicks,
"calendar": Calendar
}
Expand Down
21 changes: 21 additions & 0 deletions pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Head from "next/head"
import Layout from "../components/Layout/Layout"
import Custom404 from "../components/Custom404/Custom404"

const Custom404Page = () => {

return (
<>
<Head>
<title>404</title>
</Head>

<Layout locale={"fi"}>
<Custom404 />
</Layout>
</>

)
}

export default Custom404Page
6 changes: 3 additions & 3 deletions pages/fi/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import styles from "../../styles/Home.module.css";
import Typography from "@mui/material/Typography";


const Home = ({ elements, footerProps }) => {
const Home = ({ elements }) => {

const theme = useTheme();

Expand All @@ -19,8 +19,8 @@ const Home = ({ elements, footerProps }) => {
};

return (
<Layout locale={"fi"} footerProps={footerProps}>
<IndexPage locale={"fi"} elements={elements} footerProps={footerProps} />
<Layout locale={"fi"}>
<IndexPage locale={"fi"} elements={elements} />

<Box style={{ backgroundColor: "#f2ca99", color: "#ffffff", padding: 12 }}>
<div style={{ display: "flex", justifyContent: "center" }}>
Expand Down

0 comments on commit 39285bc

Please sign in to comment.