show opening hours for today in footer
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
import {
|
||||
getOpeningHours,
|
||||
getOpeningHoursForFunction,
|
||||
getPrettyOpeningHoursForFunction,
|
||||
groupOpeningHours,
|
||||
PrettyOpeningHours,
|
||||
} from "@/lib/openinghours";
|
||||
import styles from "./openingHoursSectionBlock.module.scss";
|
||||
|
@ -2,8 +2,37 @@ import Link from "next/link";
|
||||
import styles from "./footer.module.scss";
|
||||
import { NeonChillPig } from "../general/pigs/fun/NeonChillPig";
|
||||
import { ToTop } from "./ToTop";
|
||||
import { LogoNeuf } from "../general/Logo";
|
||||
import Icon from "../general/Icon";
|
||||
import {
|
||||
getOpeningHours,
|
||||
getTodaysOpeningHoursForFunction,
|
||||
} from "@/lib/openinghours";
|
||||
|
||||
async function OpeningHoursTable() {
|
||||
const allOpeningHours = await getOpeningHours();
|
||||
const subsections = [
|
||||
["glassbaren", "Glassbaren"],
|
||||
["bokcafeen", "Bokcaféen"],
|
||||
["ekspedisjonen", "Ekspedisjonen"],
|
||||
];
|
||||
|
||||
return (
|
||||
<table className="openingHours">
|
||||
<tbody>
|
||||
{subsections.map((subsection) => {
|
||||
const [slug, title] = subsection;
|
||||
const hours = getTodaysOpeningHoursForFunction(allOpeningHours, slug);
|
||||
return (
|
||||
<tr key={slug}>
|
||||
<td>{title}</td>
|
||||
<td>{hours}</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
export const Footer = () => {
|
||||
return (
|
||||
@ -84,22 +113,7 @@ export const Footer = () => {
|
||||
|
||||
<div className={styles.openingHoursWrapper}>
|
||||
<h2 className="suphead">Åpningstider i dag</h2>
|
||||
<table className="openingHours">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Glassbaren</td>
|
||||
<td>15:00—00:30</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bokcaféen</td>
|
||||
<td>19:00—23:30</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ekspedisjonen</td>
|
||||
<td>15:00—00:00</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<OpeningHoursTable />
|
||||
<Link href="/praktisk#apningstider">Se alle åpningstider</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user