make separate component for section footer to show links below section content on mobile
This commit is contained in:
@ -10,6 +10,7 @@ import { Pig } from "@/components/general/Pig";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Icon } from "@/components/general/Icon";
|
import { Icon } from "@/components/general/Icon";
|
||||||
import { SectionHeader } from "@/components/general/SectionHeader";
|
import { SectionHeader } from "@/components/general/SectionHeader";
|
||||||
|
import { SectionFooter } from "@/components/general/SectionFooter";
|
||||||
|
|
||||||
const HomeFragmentDefinition = graphql(`
|
const HomeFragmentDefinition = graphql(`
|
||||||
fragment Home on HomePage {
|
fragment Home on HomePage {
|
||||||
@ -61,7 +62,7 @@ export default async function Home() {
|
|||||||
<FeaturedEvents events={featuredEvents} />
|
<FeaturedEvents events={featuredEvents} />
|
||||||
<UpcomingEvents events={events} />
|
<UpcomingEvents events={events} />
|
||||||
<div className="infoBlock">
|
<div className="infoBlock">
|
||||||
<SectionHeader heading="Besøk oss"link="/praktisk" linkText="Praktisk info" />
|
<SectionHeader heading="Besøk oss" link="/praktisk" linkText="Praktisk info" />
|
||||||
<div>
|
<div>
|
||||||
<h2 className="title">Skal du besøke Chateau Neuf?</h2>
|
<h2 className="title">Skal du besøke Chateau Neuf?</h2>
|
||||||
<p>
|
<p>
|
||||||
@ -84,6 +85,7 @@ export default async function Home() {
|
|||||||
<div className="pig">
|
<div className="pig">
|
||||||
<Pig type="point" />
|
<Pig type="point" />
|
||||||
</div>
|
</div>
|
||||||
|
<SectionFooter link="/praktisk" linkText="Praktisk info" />
|
||||||
</div>
|
</div>
|
||||||
<NewsList heading="Siste nytt" featured news={news} />
|
<NewsList heading="Siste nytt" featured news={news} />
|
||||||
</main>
|
</main>
|
||||||
|
@ -2,16 +2,18 @@ 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";
|
import { SectionHeader } from "../general/SectionHeader";
|
||||||
|
import { SectionFooter } from "../general/SectionFooter";
|
||||||
|
|
||||||
export const FeaturedEvents = ({ events }: { events: EventFragment[] }) => {
|
export const FeaturedEvents = ({ events }: { events: EventFragment[] }) => {
|
||||||
return (
|
return (
|
||||||
<section>
|
<section className={styles.featuredEvents}>
|
||||||
<SectionHeader heading="Arrangementer" link="/arrangementer" linkText="Se alle arrangementer" />
|
<SectionHeader heading="Arrangementer" link="/arrangementer" linkText="Se alle arrangementer" />
|
||||||
<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" />
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
<SectionFooter link="/arrangementer" linkText="Se alle arrangementer" />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -10,6 +10,7 @@ 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";
|
import { SectionHeader } from "../general/SectionHeader";
|
||||||
|
import { SectionFooter } from "../general/SectionFooter";
|
||||||
|
|
||||||
export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
||||||
const upcomingSingularEvents = sortSingularEvents(
|
const upcomingSingularEvents = sortSingularEvents(
|
||||||
@ -50,6 +51,7 @@ export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<SectionFooter link="/arrangementer?mode=calendar" linkText="Vis kalender" />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
|
.featuredEvents {
|
||||||
|
padding-bottom: var(--spacing-section-bottom);
|
||||||
|
}
|
||||||
|
|
||||||
.eventList {
|
.eventList {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
column-gap: var(--spacing-gap-column);
|
column-gap: var(--spacing-gap-column);
|
||||||
row-gap: var(--spacing-gap-row);
|
row-gap: var(--spacing-gap-row);
|
||||||
padding-bottom: var(--spacing-section-bottom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
|
@ -6,11 +6,15 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
header {
|
header, footer {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer, footer a {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin-bottom: var(--spacing-xs);
|
margin-bottom: var(--spacing-xs);
|
||||||
}
|
}
|
||||||
@ -53,3 +57,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
.upcomingContent {
|
||||||
|
margin-top: var(--spacing-s);
|
||||||
|
}
|
||||||
|
}
|
10
web/src/components/general/SectionFooter.tsx
Normal file
10
web/src/components/general/SectionFooter.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import styles from "./sectionFooter.module.scss";
|
||||||
|
|
||||||
|
export const SectionFooter = ({ link, linkText }: { link: string, linkText: string }) => {
|
||||||
|
return (
|
||||||
|
<footer className={styles.sectionFooter}>
|
||||||
|
{link && linkText && <Link href={link}>{linkText}</Link>}
|
||||||
|
</footer>
|
||||||
|
);
|
||||||
|
};
|
25
web/src/components/general/sectionFooter.module.scss
Normal file
25
web/src/components/general/sectionFooter.module.scss
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
.sectionFooter {
|
||||||
|
margin-top: var(--spacing-s);
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: block;
|
||||||
|
font-family: var(--font-serif);
|
||||||
|
position: relative;
|
||||||
|
padding-right: 1.4rem;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: "→";
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
display: none;
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
@ -17,4 +17,10 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
a {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ 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";
|
||||||
|
import { SectionFooter } from "../general/SectionFooter";
|
||||||
|
|
||||||
export const NewsList = ({
|
export const NewsList = ({
|
||||||
news,
|
news,
|
||||||
@ -36,6 +37,9 @@ export const NewsList = ({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{heading && (
|
||||||
|
<SectionFooter link="/aktuelt" linkText="Se flere artikler" />
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user