tidy up, add section header component with links + make breadcrumb component
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import { getClient } from "@/app/client";
|
import { getClient } from "@/app/client";
|
||||||
import { Blocks } from "@/components/blocks/Blocks";
|
import { Blocks } from "@/components/blocks/Blocks";
|
||||||
|
import { Breadcrumb } from "@/components/general/Breadcrumb";
|
||||||
import { ImageFigure } from "@/components/general/Image";
|
import { ImageFigure } from "@/components/general/Image";
|
||||||
import { graphql } from "@/gql";
|
import { graphql } from "@/gql";
|
||||||
import { NewsFragment } from "@/gql/graphql";
|
import { NewsFragment } from "@/gql/graphql";
|
||||||
@ -51,9 +52,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
|||||||
return (
|
return (
|
||||||
<main className="site-main" id="main">
|
<main className="site-main" id="main">
|
||||||
<section className="news-header">
|
<section className="news-header">
|
||||||
<p className="suphead news-details">
|
<Breadcrumb link="/aktuelt" text="Nyhet" date={formatDate(news.firstPublishedAt, "d. MMMM yyyy")} />
|
||||||
Nyhet — {formatDate(news.firstPublishedAt, "d. MMMM yyyy")}
|
|
||||||
</p>
|
|
||||||
<h1 className="news-title">{news.title}</h1>
|
<h1 className="news-title">{news.title}</h1>
|
||||||
{news.lead && (
|
{news.lead && (
|
||||||
<div
|
<div
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { getClient } from "@/app/client";
|
import { getClient } from "@/app/client";
|
||||||
import { Blocks } from "@/components/blocks/Blocks";
|
import { Blocks } from "@/components/blocks/Blocks";
|
||||||
|
import { Breadcrumb } from "@/components/general/Breadcrumb";
|
||||||
import Icon from "@/components/general/Icon";
|
import Icon from "@/components/general/Icon";
|
||||||
import { Image } from "@/components/general/Image";
|
import { Image } from "@/components/general/Image";
|
||||||
import { graphql } from "@/gql";
|
import { graphql } from "@/gql";
|
||||||
@ -53,9 +54,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="site-main" id="main">
|
<main className="site-main" id="main">
|
||||||
<span className="suphead breadcrumb">
|
<Breadcrumb link="/foreninger" text={association.associationType ? association.associationType : "Foreninger"} />
|
||||||
<Link href="/foreninger">{association.associationType}</Link>
|
|
||||||
</span>
|
|
||||||
<section className="page-header">
|
<section className="page-header">
|
||||||
<h1>{association.title}</h1>
|
<h1>{association.title}</h1>
|
||||||
{association.websiteUrl && (
|
{association.websiteUrl && (
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { getClient } from "@/app/client";
|
import { getClient } from "@/app/client";
|
||||||
import { Blocks } from "@/components/blocks/Blocks";
|
import { Blocks } from "@/components/blocks/Blocks";
|
||||||
import { ImageSliderBlock } from "@/components/blocks/ImageSliderBlock";
|
import { ImageSliderBlock } from "@/components/blocks/ImageSliderBlock";
|
||||||
|
import { Breadcrumb } from "@/components/general/Breadcrumb";
|
||||||
import { Image } from "@/components/general/Image";
|
import { Image } from "@/components/general/Image";
|
||||||
import { NeufMap } from "@/components/venues/NeufMap";
|
import { NeufMap } from "@/components/venues/NeufMap";
|
||||||
import { VenueInfo } from "@/components/venues/VenueInfo";
|
import { VenueInfo } from "@/components/venues/VenueInfo";
|
||||||
@ -102,6 +103,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
|||||||
return (
|
return (
|
||||||
<main className="site-main" id="main">
|
<main className="site-main" id="main">
|
||||||
<ImageSliderBlock block={placeholderBlock} hero />
|
<ImageSliderBlock block={placeholderBlock} hero />
|
||||||
|
<Breadcrumb link="/utleie" text="Lokale" />
|
||||||
<h1 className="page-title">{venue.title}</h1>
|
<h1 className="page-title">{venue.title}</h1>
|
||||||
{/*featuredImage && (
|
{/*featuredImage && (
|
||||||
<Image
|
<Image
|
||||||
|
@ -42,7 +42,7 @@ export default async function Page() {
|
|||||||
<main className="site-main" id="main">
|
<main className="site-main" id="main">
|
||||||
<PageHeader heading={index.title} lead={index.lead} />
|
<PageHeader heading={index.title} lead={index.lead} />
|
||||||
{index.body && <Blocks blocks={index.body} />}
|
{index.body && <Blocks blocks={index.body} />}
|
||||||
<VenueList venues={bookableVenues} />
|
<VenueList venues={bookableVenues} heading="Våre lokaler" />
|
||||||
<BgPig type="key" />
|
<BgPig type="key" />
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
@ -4,6 +4,7 @@ import { Image } from "@/components/general/Image";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { OrganizerList } from "./OrganizerList";
|
import { OrganizerList } from "./OrganizerList";
|
||||||
import Icon from "../general/Icon";
|
import Icon from "../general/Icon";
|
||||||
|
import { Breadcrumb } from "../general/Breadcrumb";
|
||||||
|
|
||||||
function formatPrice(price: number): string {
|
function formatPrice(price: number): string {
|
||||||
if (price === null) {
|
if (price === null) {
|
||||||
@ -24,9 +25,7 @@ export const EventHeader = ({ event }: { event: EventFragment }) => {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.eventHeader}>
|
<div className={styles.eventHeader}>
|
||||||
<div className={styles.text}>
|
<div className={styles.text}>
|
||||||
<span className="suphead breadcrumb">
|
<Breadcrumb link="/arrangementer" text="Arrangement" />
|
||||||
<Link href="/arrangementer">Arrangement</Link>
|
|
||||||
</span>
|
|
||||||
<h1 className={styles.title}>{event.title}</h1>
|
<h1 className={styles.title}>{event.title}</h1>
|
||||||
<div className={styles.eventDetails}>
|
<div className={styles.eventDetails}>
|
||||||
<div className={styles.prices}>
|
<div className={styles.prices}>
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
import { EventFragment } from "@/gql/graphql";
|
import { EventFragment } from "@/gql/graphql";
|
||||||
import { EventItem } from "./EventItem";
|
import { EventItem } from "./EventItem";
|
||||||
import styles from "./featuredEvents.module.scss";
|
import styles from "./featuredEvents.module.scss";
|
||||||
|
import { SectionHeader } from "../general/SectionHeader";
|
||||||
|
|
||||||
export const FeaturedEvents = ({ events }: { events: EventFragment[] }) => {
|
export const FeaturedEvents = ({ events }: { events: EventFragment[] }) => {
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<h2 className="circlehead">
|
<SectionHeader heading="Arrangementer" link="/arrangementer" linkText="Se alle arrangementer" />
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
Arrangementer
|
|
||||||
</h2>
|
|
||||||
<ul className={styles.eventList}>
|
<ul className={styles.eventList}>
|
||||||
{events.slice(0, 3).map((event) => (
|
{events.slice(0, 3).map((event) => (
|
||||||
<EventItem key={event.id} event={event} mode="list" />
|
<EventItem key={event.id} event={event} mode="list" />
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { EventItem } from "./EventItem";
|
import { EventItem } from "./EventItem";
|
||||||
import styles from "./upcomingEvents.module.scss";
|
import styles from "./upcomingEvents.module.scss";
|
||||||
|
import { SectionHeader } from "../general/SectionHeader";
|
||||||
|
|
||||||
export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
||||||
const upcomingSingularEvents = sortSingularEvents(
|
const upcomingSingularEvents = sortSingularEvents(
|
||||||
@ -21,12 +22,7 @@ export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={styles.upcomingWrapper}>
|
<section className={styles.upcomingWrapper}>
|
||||||
<h2 className="circlehead">
|
<SectionHeader heading="Dette skjer på Neuf" link="/arrangementer?mode=calendar" linkText="Vis kalender" />
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
Denne uka på Chateau Neuf
|
|
||||||
</h2>
|
|
||||||
<div className={styles.eventList}>
|
<div className={styles.eventList}>
|
||||||
{Object.keys(eventsByDate).map((day) => {
|
{Object.keys(eventsByDate).map((day) => {
|
||||||
const eventsThisDay = eventsByDate[day];
|
const eventsThisDay = eventsByDate[day];
|
||||||
@ -52,9 +48,6 @@ export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.calendarLink}>
|
|
||||||
<Link href="/arrangementer?mode=calendar">Vis kalender →</Link>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
11
web/src/components/general/Breadcrumb.tsx
Normal file
11
web/src/components/general/Breadcrumb.tsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import styles from "./breadcrumb.module.scss";
|
||||||
|
|
||||||
|
export const Breadcrumb = ({ link, text, date }: { link: string, text: string, date?: string }) => {
|
||||||
|
return (
|
||||||
|
<div className={styles.breadcrumb}>
|
||||||
|
<Link href={link}>{text}</Link>
|
||||||
|
{date && <span className={styles.date}>{date}</span>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
16
web/src/components/general/SectionHeader.tsx
Normal file
16
web/src/components/general/SectionHeader.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import styles from "./sectionHeader.module.scss";
|
||||||
|
|
||||||
|
export const SectionHeader = ({ heading, link, linkText }: { heading: string, link?: string, linkText?: string }) => {
|
||||||
|
return (
|
||||||
|
<header className={styles.sectionHeader}>
|
||||||
|
<h2 className="circlehead">
|
||||||
|
<span className="circle"></span>
|
||||||
|
<span className="circle"></span>
|
||||||
|
<span className="circle"></span>
|
||||||
|
{heading}
|
||||||
|
</h2>
|
||||||
|
{link && linkText && <Link href={link}>{linkText}</Link>}
|
||||||
|
</header>
|
||||||
|
);
|
||||||
|
};
|
26
web/src/components/general/breadcrumb.module.scss
Normal file
26
web/src/components/general/breadcrumb.module.scss
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.breadcrumb {
|
||||||
|
display: block;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: var(--font-size-xs);
|
||||||
|
margin-bottom: var(--spacing-s);
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: var(--font-size-caption);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: .05em;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
font-size: var(--font-size-caption);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: .05em;
|
||||||
|
font-weight: 400;
|
||||||
|
&:before {
|
||||||
|
content: "—";
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 .25rem;
|
||||||
|
}
|
||||||
|
}
|
20
web/src/components/general/sectionHeader.module.scss
Normal file
20
web/src/components/general/sectionHeader.module.scss
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
.sectionHeader {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: block;
|
||||||
|
font-family: var(--font-serif);
|
||||||
|
margin-bottom: var(--spacing-s);
|
||||||
|
position: relative;
|
||||||
|
/*padding-left: 1.6rem;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: "→";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
|||||||
|
import { SectionHeader } from "../general/SectionHeader";
|
||||||
import { NewsItem } from "./NewsItem";
|
import { NewsItem } from "./NewsItem";
|
||||||
import styles from "./newsList.module.scss";
|
import styles from "./newsList.module.scss";
|
||||||
import { NewsFragment } from "@/lib/news";
|
import { NewsFragment } from "@/lib/news";
|
||||||
@ -18,12 +19,7 @@ export const NewsList = ({
|
|||||||
return (
|
return (
|
||||||
<section className={styles.newsWrapper}>
|
<section className={styles.newsWrapper}>
|
||||||
{heading && (
|
{heading && (
|
||||||
<h2 className="circlehead">
|
<SectionHeader heading={heading} link="/aktuelt" linkText="Se flere artikler" />
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
{heading}
|
|
||||||
</h2>
|
|
||||||
)}
|
)}
|
||||||
<ul className={`${styles.newsList} ${featured && styles.featured}`}>
|
<ul className={`${styles.newsList} ${featured && styles.featured}`}>
|
||||||
{filteredNews.map((singleNews) => (
|
{filteredNews.map((singleNews) => (
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { VenueFragment } from "@/gql/graphql";
|
import { VenueFragment } from "@/gql/graphql";
|
||||||
import { VenueItem } from "./VenueItem";
|
import { VenueItem } from "./VenueItem";
|
||||||
import styles from "./venueList.module.scss";
|
import styles from "./venueList.module.scss";
|
||||||
|
import { SectionHeader } from "../general/SectionHeader";
|
||||||
|
|
||||||
export const VenueList = ({
|
export const VenueList = ({
|
||||||
venues,
|
venues,
|
||||||
@ -12,12 +13,7 @@ export const VenueList = ({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{heading && (
|
{heading && (
|
||||||
<h2 className="circlehead">
|
<SectionHeader heading={heading} />
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
<span className="circle"></span>
|
|
||||||
{heading}
|
|
||||||
</h2>
|
|
||||||
)}
|
)}
|
||||||
<ul className={styles.venueList}>
|
<ul className={styles.venueList}>
|
||||||
{venues.map((venue) => (
|
{venues.map((venue) => (
|
||||||
|
@ -110,17 +110,6 @@ h6 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
|
||||||
display: block;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: var(--font-size-xs);
|
|
||||||
margin-bottom: var(--spacing-s);
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
Reference in New Issue
Block a user