Add contact to the website, fix some small things

This commit is contained in:
itsfinniii
2026-03-28 15:38:55 +01:00
parent 5476783e0c
commit ad25836de7
6 changed files with 41 additions and 6 deletions

View File

@@ -0,0 +1,35 @@
---
import { getImageUrl } from '@/lib/images';
import { markdownToHtml } from '@/lib/markdown';
import { Image } from 'astro:assets';
interface Props {
contact: ContactComponent;
}
const contact = Astro.props.contact;
---
<div
id={`contact-${contact.id}`}
class="flex lg:flex-row flex-col lg:justify-center justify-center items-center py-12 px-12 lg:container mx-auto gap-y-8 lg:gap-x-28 gap-x-18 lg:text-left text-center"
>
<div class="flex flex-col gap-1.5">
<h2 class="text-5xl font-bold">{contact.title}</h2>
<div set:html={markdownToHtml(contact.text)}></div>
</div>
<div class="flex flex-col gap-2">
{ contact.methods.map((method) => (
<a href={method.url} target="_blank" style={{ "--sc": method.color }} class="flex flex-row items-center gap-2 text-lg hover:text-(--sc) duration-200">
<Image
src={method.icon.url}
alt={method.title}
width="30"
height="30"
/>
<span>{method.title}</span>
</a>
)) }
</div>
</div>

View File

@@ -9,14 +9,13 @@ import Reviews from '../web/Reviews.astro';
import LastBlogs from '../web/LastBlogs.astro'; import LastBlogs from '../web/LastBlogs.astro';
import LastProjects from '../web/LastProjects.astro'; import LastProjects from '../web/LastProjects.astro';
import LastAlbums from '../web/LastAlbums.astro'; import LastAlbums from '../web/LastAlbums.astro';
import Contact from '../web/Contact.astro';
interface Props { interface Props {
webpage: WebpageComponent[]; webpage: WebpageComponent[];
} }
const components = Astro.props.webpage; const components = Astro.props.webpage;
console.log(Astro.props.webpage);
--- ---
<div class="flex flex-col"> <div class="flex flex-col">
@@ -29,6 +28,7 @@ console.log(Astro.props.webpage);
{ component.component === "FrequentlyAskedQuestions" && <FrequentlyAskedQuestions faq={component} /> } { component.component === "FrequentlyAskedQuestions" && <FrequentlyAskedQuestions faq={component} /> }
{ component.component === "EquipmentTable" && <EquipmentTable equipment={component} /> } { component.component === "EquipmentTable" && <EquipmentTable equipment={component} /> }
{ component.component === "Reviews" && <Reviews reviews={component} /> } { component.component === "Reviews" && <Reviews reviews={component} /> }
{ component.component === "Contact" && <Contact contact={component} /> }
{ component.component === "LastBlogs" && <LastBlogs blogs={component} /> } { component.component === "LastBlogs" && <LastBlogs blogs={component} /> }
{ component.component === "LastProjects" && <LastProjects projects={component} /> } { component.component === "LastProjects" && <LastProjects projects={component} /> }
{ component.component === "LastGalleries" && <LastAlbums albums={component} /> } { component.component === "LastGalleries" && <LastAlbums albums={component} /> }

View File

@@ -213,7 +213,7 @@ export function dataToPage(pageRecord: any): WebPage {
contactComponent.methods.push({ contactComponent.methods.push({
id: contactMethodRecord["id"], id: contactMethodRecord["id"],
title: contactMethodRecord["title"], title: contactMethodRecord["title"],
text: contactMethodRecord["text"], url: contactMethodRecord["url"],
color: contactMethodRecord["color"], color: contactMethodRecord["color"],
icon: { icon: {
url: getImageUrl(contactMethodRecord["icon"]["filename_disk"]), url: getImageUrl(contactMethodRecord["icon"]["filename_disk"]),

View File

@@ -180,7 +180,7 @@ query getAllPages($date: String!) {
date_created, date_created,
date_updated, date_updated,
title, title,
text, url,
icon { icon {
id, id,
created_on, created_on,

View File

@@ -180,7 +180,7 @@ query getAllPages($date: String!, $route: String!) {
date_created, date_created,
date_updated, date_updated,
title, title,
text, url,
icon { icon {
id, id,
created_on, created_on,

View File

@@ -10,7 +10,7 @@ type ContactComponent = {
type ContactMethod = { type ContactMethod = {
id: string; id: string;
title: string; title: string;
text: string; url: string;
color: string; color: string;
icon: PhotoProps; icon: PhotoProps;
} }