component formatting and types

This commit is contained in:
Julian Krauser 2025-02-14 13:57:55 +01:00
parent c2a7d15eeb
commit ce745c06e5
60 changed files with 464 additions and 301 deletions

23
app.vue
View file

@ -3,24 +3,19 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type SEOComponent from "./types/component/seoComponent"; import calculateTitle from "./composables/calculateTitle";
import type Global from "./types/single/global"; import provideGlobal from "./composables/provideGlobal";
const runtimeConfig = useRuntimeConfig(); const { SEO } = await provideGlobal();
const appTitle = runtimeConfig.public.app.title; const title = await calculateTitle();
const { findOne, find } = useStrapi(); const { metaDescription, keywords } = SEO ?? {};
const { data: global } = await useAsyncData("global", () => findOne<Global>("global"));
const {
metaTitle, metaDescription, keywords,
} = global.value?.data?.SEO ?? ({} as SEOComponent);
useHead({ useHead({
title: metaTitle ?? appTitle, title: title,
meta: [ meta: [
{name: "description", content: metaDescription}, { name: "description", content: metaDescription },
{name: "keywords", content: keywords}, { name: "keywords", content: keywords },
] ],
}); });
</script> </script>

View file

@ -44,5 +44,13 @@ a[primary-sublink].active {
} }
h1 { h1 {
@apply text-2xl;
}
h2 {
@apply text-xl; @apply text-xl;
} }
h3 {
@apply text-lg;
}

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="min-h-[calc(100vh-9rem)] h-fit container mx-auto py-12 px-2"> <div class="min-h-[calc(100vh-9rem)] h-fit container mx-auto py-12 px-2">
<h1>{{ data?.title }}</h1> <h1>{{ data?.title }}</h1>
<p v-if="data?.date"> <p v-if="data?.date && data.date.includes('T')">
{{ {{
new Date(data?.date ?? "").toLocaleString("de-DE", { new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit", day: "2-digit",
@ -12,6 +12,15 @@
}) })
}} }}
</p> </p>
<p v-else-if="data?.date">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
month: "long",
year: "numeric",
})
}}
</p>
<br /> <br />
<p>{{ data?.description }}</p> <p>{{ data?.description }}</p>
<br /> <br />

View file

@ -1,17 +1,19 @@
<template> <template>
<div class="min-h-[calc(100vh-9rem)] w-full"> <div class="min-h-[calc(100vh-9rem)] w-full">
<SharedHero v-if="hero" :data="hero" /> <ItemsHero v-if="hero" :data="hero" />
<div class="container mx-auto py-12 px-2 min-h-[50vh] flex flex-col gap-2"> <div class="container mx-auto py-12 px-2 min-h-[50vh] flex flex-col gap-2">
<div v-for="item in content" class="contents"> <div v-for="item in content" class="contents">
<DynamicZoneColumnImageText v-if="item.__component == 'dynamic-zone.column-image-text'" :data="item" /> <DynamicZoneSection v-if="item.__component == 'dynamic-zone.section'" :data="item" />
<DynamicZoneSpacer v-else-if="item.__component == 'dynamic-zone.spacer'" :data="item" />
<DynamicZoneColumnImageText v-else-if="item.__component == 'dynamic-zone.column-image-text'" :data="item" />
<DynamicZoneDualColumnText v-else-if="item.__component == 'dynamic-zone.dual-column-text'" :data="item" /> <DynamicZoneDualColumnText v-else-if="item.__component == 'dynamic-zone.dual-column-text'" :data="item" />
<DynamicZoneEmphasiseArticle v-else-if="item.__component == 'dynamic-zone.emphasise-article'" :data="item" />
<DynamicZoneFullImage v-else-if="item.__component == 'dynamic-zone.full-image'" :data="item" /> <DynamicZoneFullImage v-else-if="item.__component == 'dynamic-zone.full-image'" :data="item" />
<DynamicZoneFullText v-else-if="item.__component == 'dynamic-zone.full-text'" :data="item" /> <DynamicZoneFullText v-else-if="item.__component == 'dynamic-zone.full-text'" :data="item" />
<DynamicZoneGallery v-else-if="item.__component == 'dynamic-zone.gallery'" :data="item" /> <DynamicZoneGallery v-else-if="item.__component == 'dynamic-zone.gallery'" :data="item" />
<DynamicZoneFileDownload v-else-if="item.__component == 'dynamic-zone.file-download'" :data="item" /> <DynamicZoneFileDownload v-else-if="item.__component == 'dynamic-zone.file-download'" :data="item" />
<DynamicZoneEmbedding v-else-if="item.__component == 'dynamic-zone.embedding'" :data="item" /> <DynamicZoneEmbedding v-else-if="item.__component == 'dynamic-zone.embedding'" :data="item" />
<SharedList v-else-if="item.__component == 'shared.list'" :data="item" /> <SharedList v-else-if="item.__component == 'shared.list'" :data="item" />
<SharedEmphasiseArticle v-else-if="item.__component == 'shared.emphasise-article'" :data="item" />
<br /> <br />
</div> </div>
</div> </div>
@ -20,11 +22,11 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type SharedHero from "../types/component/sharedHero"; import type ItemsHero from "../types/component/items/hero";
import type { ComponentTypes } from "../types/component/baseComponent"; import type { ComponentTypes } from "../types/component/baseComponent";
defineProps({ defineProps({
hero: { type: Object as PropType<SharedHero>, required: false, default: null }, hero: { type: Object as PropType<ItemsHero>, required: false, default: null },
content: Array<ComponentTypes>, content: Array<ComponentTypes>,
}); });
</script> </script>

View file

@ -1,7 +1,10 @@
<template> <template>
<footer darkgray class="h-48 min-h-fit w-full px-5 py-10 flex-col justify-center items-center flex gap-2"> <footer darkgray class="h-48 min-h-fit w-full p-5 pt-10 flex-col justify-center items-center flex gap-2">
<div class="self-stretch py-5 justify-center items-center gap-4 md:gap-10 inline-flex flex-wrap"> <div
<div v-for="link in footer.links" :key="link.id" class="contents"> v-if="links && links.length != 0"
class="self-stretch py-5 justify-center items-center gap-4 md:gap-10 inline-flex flex-wrap"
>
<div v-for="link in links" :key="link.id" class="contents">
<a v-if="link.URL.startsWith('http')" :href="link.URL" :target="link.target" class="text-base">{{ <a v-if="link.URL.startsWith('http')" :href="link.URL" :target="link.target" class="text-base">{{
link.text link.text
}}</a> }}</a>
@ -15,9 +18,9 @@
</NuxtLink> </NuxtLink>
</div> </div>
</div> </div>
<p class="text-base text-center">@Copyright {{ new Date().getFullYear() }} {{ footer.copyright }}</p> <p class="text-base text-center">@Copyright {{ new Date().getFullYear() }} {{ copyright ?? title }}</p>
<p class="text-base text-center">Inhalte verwaltet von {{ footer?.maintained ?? footer.copyright }}</p> <p class="text-base text-center">Inhalte verwaltet von {{ maintained_by ?? copyright ?? title }}</p>
<p> <p class="text-sm text-gray-400 pt-2">
<a href="https://ff-admin.de/webpage" target="_blank">FF Webpage</a> <a href="https://ff-admin.de/webpage" target="_blank">FF Webpage</a>
entwickelt von entwickelt von
<a href="https://jk-effects.com" target="_blank">JK Effects</a> <a href="https://jk-effects.com" target="_blank">JK Effects</a>
@ -26,10 +29,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type Global from "../types/single/global"; const title = await calculateTitle();
const { footer } = await provideGlobal();
const { findOne } = useStrapi(); const { links, maintained_by, copyright } = footer ?? {};
const { data: global } = await useAsyncData("global", () => findOne<Global>("global"));
const { footer } = global.value?.data ?? ({} as Global);
</script> </script>

View file

@ -5,9 +5,11 @@
class="h-24 min-h-fit w-full px-4 md:px-12 py-2.5 justify-between items-center gap-5 flex overflow-hidden" class="h-24 min-h-fit w-full px-4 md:px-12 py-2.5 justify-between items-center gap-5 flex overflow-hidden"
> >
<NuxtLink to="/"> <NuxtLink to="/">
<img class="h-16" :src="baseUrl + navbar.logo.url" /> <img v-if="logo" class="h-16" :src="baseUrl + logo.url" />
<img v-else class="h-16" src="/favicon.png" />
</NuxtLink> </NuxtLink>
<div class="md:hidden">
<div v-if="navbar" class="md:hidden">
<svg <svg
v-if="!open" v-if="!open"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@ -27,6 +29,7 @@
</div> </div>
<div <div
v-if="navbar"
class="w-fit max-w-full p-2.5 justify-center items-center gap-7 flex flex-col md:flex-row md:flex-wrap" class="w-fit max-w-full p-2.5 justify-center items-center gap-7 flex flex-col md:flex-row md:flex-wrap"
:class="open ? 'max-md:absolute top-24 left-0 max-md:w-full bg-primary' : 'max-md:hidden'" :class="open ? 'max-md:absolute top-24 left-0 max-md:w-full bg-primary' : 'max-md:hidden'"
> >
@ -34,7 +37,7 @@
primary-link primary-link
v-for="link in navbar.navbar_items" v-for="link in navbar.navbar_items"
:key="link.id" :key="link.id"
:to="`/${link.URL}/${link.default_active_child ?? ''}`" :to="`/${link.URL}${link.default_active_child ? '/' + link.default_active_child : ''}`"
:class="link.URL == params?.[0] ? 'active' : ''" :class="link.URL == params?.[0] ? 'active' : ''"
> >
{{ link.name }} {{ link.name }}
@ -61,21 +64,21 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type Global from "../types/single/global"; import provideGlobal from "../composables/provideGlobal";
const { const {
params: { slug: params }, params: { slug: params },
} = useRoute(); } = useRoute();
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;
const { findOne } = useStrapi();
const { data: global } = await useAsyncData("global", () => findOne<Global>("global")); const { logo, navbar } = await provideGlobal();
const { navbar } = global.value?.data ?? ({} as Global);
const open = ref(false); const open = ref(false);
const navbar_sub_items = computed(() => { const navbar_sub_items = computed(() => {
if (!navbar) return [];
return navbar.navbar_items.find((ni) => ni.URL == params?.[0])?.navbar_sub_items; return navbar.navbar_items.find((ni) => ni.URL == params?.[0])?.navbar_sub_items;
}); });
</script> </script>

View file

@ -4,41 +4,30 @@
:class="allowNavigation ? '' : 'pointer-events-none'" :class="allowNavigation ? '' : 'pointer-events-none'"
:to="`${urlOverwrite ?? $route.path}/${data?.slug}`" :to="`${urlOverwrite ?? $route.path}/${data?.slug}`"
> >
<NuxtPicture <div class="w-full h-56 relative">
loading="lazy" <NuxtPicture
class="w-full h-56 object-cover object-center" loading="lazy"
:src="baseUrl + data?.image?.url" class="w-full h-full object-cover object-center"
:imgAttrs="{ class: 'w-full h-56 object-cover object-center' }" :src="data?.image?.url || logo?.url ? baseUrl + (data?.image?.url ?? logo?.url) : '/favicon.png'"
/> :imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
/>
<h1
v-if="itemIndex"
class="text-center text-black text-4xl my-auto absolute bottom-2 left-2"
style="text-shadow: 2px 2px 4px white"
>
{{ itemIndex }}.
</h1>
</div>
<div class="w-full h-44 relative bg-white px-2 py-5 flex flex-col justify-start items-start gap-2 overflow-y-auto"> <div class="w-full h-44 relative bg-white px-2 py-5 flex flex-col justify-start items-start gap-2 overflow-y-auto">
<h1> <h1>
<span v-if="numberOverwrite != undefined" class="w-24 text-center text-black text-4xl my-auto">
{{ numberOverwrite }}.
</span>
{{ data?.title }} {{ data?.title }}
</h1> </h1>
<p v-if="numberOverwrite != undefined && data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]"> <p v-if="itemDate" class="w-full text-[#5c5c5c]">
{{ {{ itemDate }}
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
month: "long",
year: "numeric",
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
</p> </p>
<p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]"> <p class="w-full text-[#5c5c5c] line-clamp-2 overflow-hidden">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
</p>
<p class="w-full text-[#5c5c5c]">
{{ data?.description }} {{ data?.description }}
</p> </p>
</div> </div>
@ -48,14 +37,59 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type BaseCollection from "~/types/collection/baseCollection"; import type BaseCollection from "~/types/collection/baseCollection";
import type Lookup from "../../types/collection/lookup";
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;
defineProps({ const { logo } = await provideGlobal();
const props = defineProps({
data: Object as PropType<BaseCollection>, data: Object as PropType<BaseCollection>,
lookup: Object as PropType<Lookup>,
numberOverwrite: { type: Number, default: undefined }, numberOverwrite: { type: Number, default: undefined },
allowNavigation: { type: Boolean, default: false }, allowNavigation: { type: Boolean, default: false },
urlOverwrite: { type: String, default: undefined }, urlOverwrite: { type: String, default: undefined },
}); });
const itemIndex = computed(() => {
if (props.lookup?.items_with_number != "none") {
return props.numberOverwrite;
} else if (props.lookup?.list_with_date != "none") {
return new Date(props.data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
});
} else {
return undefined;
}
});
const itemDate = computed(() => {
let config = {
year:
props.lookup?.list_with_date == "none" || props.lookup?.items_with_number != "none"
? ("numeric" as const)
: undefined,
month:
props.lookup?.list_with_date != "by-month" || props.lookup?.items_with_number != "none"
? ("long" as const)
: undefined,
day:
props.lookup?.list_with_date == "none" || props.lookup?.items_with_number != "none"
? ("2-digit" as const)
: undefined,
minute:
props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
hour:
props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
};
if (Object.values(config).filter((c) => c).length != 0) {
//(props.lookup?.list_with_date != "none" || props.lookup?.show_date)
return (
new Date(props.data?.date ?? "").toLocaleString("de-DE", config) + (props.data?.date.includes("T") ? "Uhr" : "")
);
} else {
return undefined;
}
});
</script> </script>

View file

@ -1,43 +1,19 @@
<template> <template>
<NuxtLink <NuxtLink
class="w-full h-fit py-2 bg-white shadow-md border border-gray-200 rounded-md justify-start items-start flex" class="w-full h-fit p-2 bg-white shadow-md border border-gray-200 rounded-md justify-start items-start flex"
:class="allowNavigation ? '' : 'pointer-events-none'" :class="allowNavigation ? '' : 'pointer-events-none'"
:to="`${urlOverwrite ?? $route.path}/${data?.slug}`" :to="`${urlOverwrite ?? $route.path}/${data?.slug}`"
> >
<h1 v-if="numberOverwrite != undefined" class="w-24 text-center text-black text-4xl my-auto"> <h1 v-if="itemIndex" class="min-w-20 w-20 sm:min-w-24 sm:w-24 text-center text-black text-4xl my-auto">
{{ numberOverwrite }}. {{ itemIndex }}.
</h1> </h1>
<h1 v-else class="w-24 text-center text-black text-4xl my-auto">
{{ <div class="grow shrink basis-0 flex-col justify-center items-center flex overflow-hidden">
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
})
}}.
</h1>
<div class="grow shrink basis-0 flex-col justify-center items-center flex">
<h1 class="w-full">{{ data?.title }}</h1> <h1 class="w-full">{{ data?.title }}</h1>
<p v-if="numberOverwrite != undefined && data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]"> <p v-if="itemDate" class="w-full text-[#5c5c5c]">
{{ {{ itemDate }}
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
month: "long",
year: "numeric",
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
</p> </p>
<p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]"> <p class="w-full text-[#5c5c5c] line-clamp-2 overflow-hidden">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
</p>
<p class="w-full text-[#5c5c5c]">
{{ data?.description }} {{ data?.description }}
</p> </p>
</div> </div>
@ -47,11 +23,54 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type BaseCollection from "../../types/collection/baseCollection"; import type BaseCollection from "../../types/collection/baseCollection";
import type Lookup from "../../types/collection/lookup";
defineProps({ const props = defineProps({
data: Object as PropType<BaseCollection>, data: Object as PropType<BaseCollection>,
lookup: Object as PropType<Lookup>,
numberOverwrite: { type: Number, default: undefined }, numberOverwrite: { type: Number, default: undefined },
allowNavigation: { type: Boolean, default: false }, allowNavigation: { type: Boolean, default: false },
urlOverwrite: { type: String, default: undefined }, urlOverwrite: { type: String, default: undefined },
}); });
const itemIndex = computed(() => {
if (props.lookup?.items_with_number != "none") {
return props.numberOverwrite;
} else if (props.lookup?.list_with_date != "none") {
return new Date(props.data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
});
} else {
return undefined;
}
});
const itemDate = computed(() => {
let config = {
year:
props.lookup?.list_with_date == "none" || props.lookup?.items_with_number != "none"
? ("numeric" as const)
: undefined,
month:
props.lookup?.list_with_date != "by-month" || props.lookup?.items_with_number != "none"
? ("long" as const)
: undefined,
day:
props.lookup?.list_with_date == "none" || props.lookup?.items_with_number != "none"
? ("2-digit" as const)
: undefined,
minute:
props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
hour:
props.data?.date.includes("T") && props.lookup?.items_with_number != "none" ? ("2-digit" as const) : undefined,
};
if (Object.values(config).filter((c) => c).length != 0) {
//(props.lookup?.list_with_date != "none" || props.lookup?.show_date)
return (
new Date(props.data?.date ?? "").toLocaleString("de-DE", config) + (props.data?.date.includes("T") ? "Uhr" : "")
);
} else {
return undefined;
}
});
</script> </script>

View file

@ -13,7 +13,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneColumnImageText from "../../types/component/dynamicZoneColumnImageText"; import type DynamicZoneColumnImageText from "../../types/component/dynamic-zone/columnImageText";
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;

View file

@ -7,7 +7,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneDualColumnText from "../../types/component/dynamicZoneDualColumnText"; import type DynamicZoneDualColumnText from "../../types/component/dynamic-zone/dualColumnText";
defineProps({ defineProps({
data: Object as PropType<DynamicZoneDualColumnText>, data: Object as PropType<DynamicZoneDualColumnText>,

View file

@ -1,13 +1,12 @@
<template> <template>
<div class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto"> <div class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto">
<h1 class="text-center">{{ data.title }}</h1> <iframe :src="data?.link" class="w-full h-[90vh]"></iframe>
<iframe :src="data.link" class="w-full h-[90vh]"></iframe>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneEmbedding from "../../types/component/dynamicZoneEmbedding"; import type DynamicZoneEmbedding from "../../types/component/dynamic-zone/embedding";
const props = defineProps({ const props = defineProps({
data: Object as PropType<DynamicZoneEmbedding>, data: Object as PropType<DynamicZoneEmbedding>,

View file

@ -1,21 +0,0 @@
<template>
<div class="w-full flex flex-col justify-center">
<h1 class="text-center">{{ data?.titel }}</h1>
<p class="text-center text-[#5c5c5c]">{{ data?.description }}</p>
<br />
<div class="flex gap-2 w-full max-w-4xl mx-auto flex-row flex-wrap justify-center">
<div v-for="item in data?.articles" :key="item.slug" class="contents">
<BaseListImageItem :data="item" :allow-navigation="true" :url-overwrite="data?.base_url" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneEmphasiseArticle from "../../types/component/dynamicZoneEmphasiseArticle";
defineProps({
data: Object as PropType<DynamicZoneEmphasiseArticle>,
});
</script>

View file

@ -1,18 +1,17 @@
<template> <template>
<div v-if="showComponent" class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto"> <div v-if="showComponent" class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto">
<h1 class="text-center">{{ data.title }}</h1> <iframe v-if="data?.file.mime == 'application/pdf'" :src="baseUrl + data.file.url" class="w-full h-[90vh]"></iframe>
<iframe v-if="data.file.mime == 'application/pdf'" :src="baseUrl + data.file.url" class="w-full h-[90vh]"></iframe>
<NuxtPicture <NuxtPicture
v-if="data.file.mime.includes('image')" v-if="data?.file.mime.includes('image')"
loading="lazy" loading="lazy"
class="w-full object-cover object-center mx-auto" class="w-full object-cover object-center mx-auto"
:src="baseUrl + data?.file.url" :src="baseUrl + data?.file.url"
:imgAttrs="{ class: 'w-full h-full object-cover object-center' }" :imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
/> />
<a <a
v-if="data.enable_download" v-if="data?.enable_download"
:href="baseUrl + data.file.url" :href="baseUrl + data?.file.url"
:download="data.file.name" :download="data?.file.name"
target="_blank" target="_blank"
class="w-fit text-primary underline" class="w-fit text-primary underline"
> >
@ -23,7 +22,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneFileDownload from "../../types/component/dynamicZoneFileDownload"; import type DynamicZoneFileDownload from "../../types/component/dynamic-zone/fileDownload";
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;
@ -33,10 +32,10 @@ const props = defineProps({
}); });
const showComponent = computed(() => { const showComponent = computed(() => {
if (props.data.file.mime == "application/pdf" || props.data.file.mime.includes("image")) { if (props.data?.file.mime == "application/pdf" || props.data?.file.mime.includes("image")) {
return true; return true;
} else { } else {
return props.data.enable_download; return props.data?.enable_download;
} }
}); });
</script> </script>

View file

@ -9,7 +9,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneFullImage from "../../types/component/dynamicZoneFullImage"; import type DynamicZoneFullImage from "../../types/component/dynamic-zone/fullImage";
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;

View file

@ -4,7 +4,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneFullText from "../../types/component/dynamicZoneFullText"; import type DynamicZoneFullText from "../../types/component/dynamic-zone/fullText";
defineProps({ defineProps({
data: Object as PropType<DynamicZoneFullText>, data: Object as PropType<DynamicZoneFullText>,

View file

@ -12,7 +12,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type DynamicZoneGallery from "../../types/component/dynamicZoneGallery"; import type DynamicZoneGallery from "../../types/component/dynamic-zone/gallery";
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;

View file

@ -0,0 +1,13 @@
<template>
<h1 class="text-center">{{ data?.title }}</h1>
<p v-if="data?.description" class="text-center text-[#5c5c5c]">{{ data?.description }}</p>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneSection from "../../types/component/dynamic-zone/section";
defineProps({
data: Object as PropType<DynamicZoneSection>,
});
</script>

View file

@ -0,0 +1,12 @@
<template>
<div class="bg-primary h-2 rounded-full w-48 mx-auto"></div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneSpacer from "../../types/component/dynamic-zone/spacer";
defineProps({
data: Object as PropType<DynamicZoneSpacer>,
});
</script>

View file

@ -1,9 +1,15 @@
<template> <template>
<div class="w-full h-fit flex flex-col gap-2"> <div class="w-full h-fit flex flex-col gap-2">
<div v-for="item in data" :key="item.type" class="contents"> <div v-for="item in data" :key="item.type" class="contents">
<h1 v-if="item.type == 'heading'" class="w-full"> <h1 v-if="item.type == 'heading' && item?.level == 1" class="w-full">
<FieldType v-for="child in item.children" :data="child" /> <FieldType v-for="child in item.children" :data="child" />
</h1> </h1>
<h2 v-else-if="item.type == 'heading' && item?.level == 2" class="w-full">
<FieldType v-for="child in item.children" :data="child" />
</h2>
<h3 v-else-if="item.type == 'heading'" class="w-full">
<FieldType v-for="child in item.children" :data="child" />
</h3>
<p v-else-if="item.type == 'paragraph'" class="w-full"> <p v-else-if="item.type == 'paragraph'" class="w-full">
<FieldType v-for="child in item.children" :data="child" /> <FieldType v-for="child in item.children" :data="child" />
</p> </p>

View file

@ -1,23 +1,24 @@
<template> <template>
<div class="flex flex-col w-full max-h-72 h-72 overflow-hidden"> <div class="flex flex-col w-full max-h-72 h-fit overflow-hidden">
<NuxtPicture <NuxtPicture
v-if="data?.banner"
loading="lazy" loading="lazy"
class="w-full h-60 object-cover object-center" class="w-full h-60 object-cover object-center"
:src="baseUrl + data?.banner.url" :src="baseUrl + data?.banner.url"
:imgAttrs="{ class: 'w-full h-60 object-cover object-center' }" :imgAttrs="{ class: 'w-full h-60 object-cover object-center' }"
/> />
<div primary class="h-12 min-h-12 w-full px-12 justify-center items-center gap-5 flex"> <div v-if="data?.title" primary class="h-12 min-h-12 w-full px-12 justify-center items-center gap-5 flex">
<p>{{ data?.title }}</p> <p>{{ data.title }}</p>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type SharedHero from "../../types/component/sharedHero"; import type ItemsHero from "../../types/component/items/hero";
defineProps({ defineProps({
data: Object as PropType<SharedHero>, data: Object as PropType<ItemsHero>,
}); });
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();

View file

@ -0,0 +1,40 @@
<template>
<div class="w-full flex flex-col justify-center">
<div class="flex gap-2 w-full max-w-4xl mx-auto flex-row flex-wrap justify-center">
<div v-for="item in data?.articles" :key="item.slug" class="contents">
<BaseListImageItem
v-if="articleLookup?.show_image"
:data="item"
:allow-navigation="articleLookup.enable_detail"
:url-overwrite="data?.link_to_articles"
/>
<BaseListItem
v-else-if="articleLookup"
:data="item"
:allow-navigation="articleLookup.enable_detail"
:url-overwrite="data?.link_to_articles"
/>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type SharedEmphasiseArticle from "../../types/component/shared/emphasiseArticle";
import type Lookup from "../../types/collection/lookup";
const { find } = useStrapi();
const { data: lookup } = await useAsyncData("lookup", () =>
find<Lookup>("collection-lookups", {
filters: {
collection: "articles",
},
})
);
const articleLookup = ref(lookup.value?.data[0]);
defineProps({
data: Object as PropType<SharedEmphasiseArticle>,
});
</script>

View file

@ -1,5 +1,5 @@
<template> <template>
<div v-if="data?.lookup.date_list" class="flex flex-row justify-between w-full max-w-4xl mx-auto"> <div v-if="data?.lookup.list_with_date != 'none'" class="flex flex-row justify-between w-full max-w-4xl mx-auto">
<svg <svg
viewBox="0 0 24 24" viewBox="0 0 24 24"
class="h-5 w-5 cursor-pointer fill-none stroke-2 stroke-black" class="h-5 w-5 cursor-pointer fill-none stroke-2 stroke-black"
@ -20,26 +20,25 @@
</div> </div>
<div <div
class="flex gap-2 w-full max-w-4xl mx-auto" class="flex gap-2 w-full max-w-4xl mx-auto"
:class="data?.lookup.image_item ? 'flex-row flex-wrap justify-center' : ' flex-col'" :class="data?.lookup.show_image ? 'flex-row flex-wrap justify-center' : ' flex-col'"
> >
<div v-for="(item, index) in collection" :key="item.slug" class="contents"> <div v-for="(item, index) in collection" :key="item.slug" class="contents">
<p <p v-if="data?.lookup.list_with_date == 'by-month' && getDate(index) != ''" class="w-full text-center">
v-if="data?.lookup.date_list && data?.lookup.numbered_item == false && getDate(index) != ''"
class="w-full text-center"
>
{{ getDate(index) }} {{ getDate(index) }}
</p> </p>
<BaseListImageItem <BaseListImageItem
v-if="data?.lookup.image_item" v-if="data?.lookup.show_image"
:data="item" :data="item"
:number-overwrite="data.lookup.numbered_item ? getNumber(index) : undefined" :lookup="data?.lookup"
:allow-navigation="data.enable_detail" :number-overwrite="getNumber(index)"
:allow-navigation="data.lookup.enable_detail"
/> />
<BaseListItem <BaseListItem
v-else-if="data?.lookup" v-else-if="data?.lookup"
:data="item" :data="item"
:number-overwrite="data.lookup.numbered_item ? getNumber(index) : undefined" :lookup="data?.lookup"
:allow-navigation="data.enable_detail" :number-overwrite="getNumber(index)"
:allow-navigation="data.lookup.enable_detail"
/> />
</div> </div>
</div> </div>
@ -91,7 +90,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PropType } from "vue"; import type { PropType } from "vue";
import type SharedList from "../../types/component/sharedList"; import type SharedList from "../../types/component/shared/list";
import type BaseCollection from "~/types/collection/baseCollection"; import type BaseCollection from "~/types/collection/baseCollection";
interface Meta { interface Meta {
@ -113,7 +112,7 @@ const years = ref<Array<number>>([]);
const pagination = ref<Meta>({ page: 0, pageSize: 0, pageCount: 0, total: 0 }); const pagination = ref<Meta>({ page: 0, pageSize: 0, pageCount: 0, total: 0 });
const activeYear = ref<number>(0); const activeYear = ref<number>(0);
if (props.data?.lookup.date_list) { if (props.data?.lookup.list_with_date) {
const { data: year } = await useAsyncData<Array<number>>("distinct-years", () => const { data: year } = await useAsyncData<Array<number>>("distinct-years", () =>
$fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`) $fetch(`${baseUrl}/api/custom/${props.data?.lookup.collection}/distinct-years`)
); );
@ -122,7 +121,7 @@ if (props.data?.lookup.date_list) {
} }
const { data: collections } = await useAsyncData("collection", () => const { data: collections } = await useAsyncData("collection", () =>
find<BaseCollection>(props.data?.lookup.collection ?? "", { find<BaseCollection>(props.data?.lookup.collection ?? "", {
...(props.data?.lookup?.date_list ...(props.data?.lookup?.list_with_date
? { ? {
sort: "date:desc", sort: "date:desc",
filters: { filters: {
@ -200,7 +199,7 @@ const displayedPagesNumbers = computed(() => {
}); });
function getNumber(index: number): number { function getNumber(index: number): number {
if (props.data?.lookup.inverse_count) { if (props.data?.lookup.items_with_number == "inverted") {
return pagination.value.total - numberOffset.value - index; return pagination.value.total - numberOffset.value - index;
} else { } else {
return numberOffset.value + index + 1; return numberOffset.value + index + 1;

View file

@ -0,0 +1,11 @@
import provideGlobal from "./provideGlobal";
export default async function () {
const runtimeConfig = useRuntimeConfig();
const appTitle = runtimeConfig.public.app.title;
const { SEO } = await provideGlobal();
const { metaTitle } = SEO ?? {};
return metaTitle ?? appTitle;
}

View file

@ -0,0 +1,9 @@
import type Global from "../types/single/global";
export default async function () {
const { findOne } = useStrapi();
const { data: global } = await useAsyncData("global", () => findOne<Global>("global"));
const { logo, navbar, footer, SEO } = global.value?.data ?? {};
return { logo, navbar, footer, SEO };
}

View file

@ -1,14 +1,17 @@
<template> <template>
<div v-if="!hide_backdrop" class="relative h-[calc(100svh-6rem)] max-h-[calc(100svh-6rem)] w-full overflow-hidden"> <div v-if="backdrop" class="relative h-[calc(100svh-6rem)] max-h-[calc(100svh-6rem)] w-full overflow-hidden">
<NuxtPicture <NuxtPicture
loading="lazy" loading="lazy"
class="w-full h-full object-cover object-center" class="w-full h-full object-cover object-center"
:src="baseUrl + backdrop.url" :src="baseUrl + backdrop.url"
:imgAttrs="{ class: 'w-full h-full object-cover object-center' }" :imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
/> />
<img class="absolute p-4 max-sm:w-full sm:h-40 bottom-5" :src="baseUrl + navbar.logo.url" />
<img v-if="logo" class="absolute p-4 max-sm:w-full sm:h-40 bottom-5" :src="baseUrl + logo.url" />
<img v-else class="absolute p-4 max-sm:w-full sm:h-40 bottom-5" src="/favicon.png" />
<img <img
class="absolute h-5 w-5 left-1/2 -translate-y-1/2 bottom-5 text-gray-400 cursor-pointer" class="absolute h-5 w-5 left-1/2 -translate-y-1/2 bottom-5 text-gray-400 p-2 box-content rounded-full bg-white cursor-pointer"
src="/chevrons-down.svg" src="/chevrons-down.svg"
@click="scroll()" @click="scroll()"
/> />
@ -19,21 +22,17 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type Global from "../types/single/global"; import provideGlobal from "../composables/provideGlobal";
import type Homepage from "../types/single/homepage"; import type Homepage from "../types/single/homepage";
const {
params: { slug: params },
} = useRoute();
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url; const baseUrl = runtimeConfig.public.strapi.url;
const { findOne } = useStrapi(); const { findOne } = useStrapi();
const { data: global } = await useAsyncData("global", () => findOne<Global>("global")); const { logo } = await provideGlobal();
const { navbar } = global.value?.data as unknown as Global;
const { data: homepage } = await useAsyncData("homepage", () => findOne<Homepage>("homepage")); const { data: homepage } = await useAsyncData("homepage", () => findOne<Homepage>("homepage"));
const { backdrop, hide_backdrop } = homepage.value?.data as unknown as Homepage; const { backdrop } = homepage.value?.data ?? {};
function scroll() { function scroll() {
window.scrollTo({ top: window.innerHeight - 96, behavior: "smooth" }); window.scrollTo({ top: window.innerHeight - 96, behavior: "smooth" });

View file

@ -9,27 +9,32 @@
<script setup lang="ts"> <script setup lang="ts">
import type Article from "../types/collection/article"; import type Article from "../types/collection/article";
import type Event from "../types/collection/event"; import type Event from "../types/collection/event";
import type Lookup from "../types/collection/lookup";
import type Operation from "../types/collection/operation"; import type Operation from "../types/collection/operation";
import type Vehicle from "../types/collection/vehicle"; import type Vehicle from "../types/collection/vehicle";
import type Page from "../types/collection/page"; import type Page from "../types/collection/page";
import type NavbarSubItem from "../types/component/itemsNavbarSubItem"; import provideGlobal from "../composables/provideGlobal";
import type Global from "../types/single/global";
const { const {
params: { slug: params }, params: { slug: params },
} = useRoute(); } = useRoute();
const { findOne, find } = useStrapi(); const { findOne, find } = useStrapi();
const { data: global } = await useAsyncData("global", () => findOne<Global>("global")); const { navbar } = await provideGlobal();
const { const navbar_items = computed(() => {
navbar: { navbar_items }, return navbar?.navbar_items ?? [];
} = global.value?.data ?? ({} as Global); });
const navbar_sub_items = computed(() => {
const navbar_sub_items = ref<NavbarSubItem[]>(navbar_items.find((ni) => ni.URL == params[0])?.navbar_sub_items ?? []); return navbar_items.value.find((ni) => ni.URL == params[0])?.navbar_sub_items ?? [];
const active_item = ref<Page | null | undefined>(navbar_items.find((ni) => ni.URL == params[0])?.page); });
const active_sub_item = ref<Page | null | undefined>(navbar_sub_items.value.find((si) => si.URL == params[1])?.page); const active_item = computed(() => {
const active_page_id = ref<string>(active_sub_item.value?.documentId ?? active_item.value?.documentId ?? ""); return navbar_items.value.find((ni) => ni.URL == params[0])?.page;
});
const active_sub_item = computed(() => {
return navbar_sub_items.value.find((si) => si.URL == params[1])?.page;
});
const active_page_id = computed(() => {
return active_sub_item.value?.documentId ?? active_item.value?.documentId ?? "";
});
const { data: pages } = await useAsyncData("pages", () => const { data: pages } = await useAsyncData("pages", () =>
findOne<Page | Array<Page>>("pages", active_page_id.value, { findOne<Page | Array<Page>>("pages", active_page_id.value, {
@ -47,32 +52,48 @@ const { data: pages } = await useAsyncData("pages", () =>
}, },
}) })
); );
const page = ref<Page | undefined>(Array.isArray(pages.value?.data) ? pages.value.data[0] : pages.value?.data); const page = computed(() => {
return Array.isArray(pages.value?.data) ? pages.value.data[0] : pages.value?.data;
});
let detail = ref<Article | Operation | Event | Vehicle | undefined>(undefined); let detail = ref<Article | Operation | Event | Vehicle | undefined>(undefined);
const searchDetail = params[2] || (params[1] && navbar_sub_items.value.length == 0); const searchDetail = computed(() => {
if (searchDetail) { if (!active_sub_item.value) return params[1];
const paramsFind = params[2] ? [params[0], params[1]] : [params[0]]; return params[2];
const { data: lookup } = await useAsyncData("lookup", () => find<Lookup>("collection-lookups")); });
const activeLookup: Lookup | undefined = lookup.value?.data.find((l) => paramsFind.includes(l.reference)); if (searchDetail.value) {
const { data: details } = await useAsyncData("detail", () => let collectionOfDetail = [
find<Article | Operation | Event | Vehicle>(activeLookup?.collection ?? "", { ...new Set(
populate: "*", page.value?.content
filters: { .filter((c) => c.__component == "shared.list")
slug: params[2] ?? params[1], .filter((c) => c.lookup.enable_detail)
}, .map((c) => c.lookup.collection)
}) ),
); ];
detail.value = details.value?.data[0];
for (const element of collectionOfDetail) {
const { data: details } = await useAsyncData("detail", () =>
find<Article | Operation | Event | Vehicle>(element ?? "", {
populate: "*",
filters: {
slug: params[2] ?? params[1],
},
})
);
if (details.value?.data[0]) {
detail.value = details.value?.data[0];
break;
}
}
} }
const notFound = computed(() => { const notFound = computed(() => {
if (searchDetail) return !detail.value; if (searchDetail.value) return !detail.value;
else return active_page_id.value == "" && !page.value?.content && !page.value?.hero; else return active_page_id.value == "" && !page.value?.content && !page.value?.hero;
}); });
const showContentBuilder = computed(() => { const showContentBuilder = computed(() => {
if (searchDetail) return !detail.value; if (searchDetail.value) return !detail.value;
else return !!page.value?.content || !!page.value?.hero; else return !!page.value?.content || !!page.value?.hero;
}); });
</script> </script>

View file

@ -1,4 +1,3 @@
import type BaseFile from "../component/baseFile";
import type BaseCollection from "./baseCollection"; import type BaseCollection from "./baseCollection";
export default interface Article extends BaseCollection {} export default interface Article extends BaseCollection {}

View file

@ -12,7 +12,7 @@ export default interface BaseCollection {
title: string; title: string;
description: string; description: string;
date: string | undefined; date: string;
content: ContentField | undefined; content: ContentField | undefined;
image: BaseFile | undefined; image: BaseFile | undefined;
attachment: Array<BaseFile>; attachment: Array<BaseFile>;

View file

@ -1,6 +1,3 @@
import type BaseCollection from "./baseCollection"; import type BaseCollection from "./baseCollection";
export default interface Event extends BaseCollection { export default interface Event extends BaseCollection {}
image: undefined;
content: undefined;
}

View file

@ -1,13 +1,15 @@
export default interface Lookup { export default interface Lookup {
id: number; id: number;
documentId: string; documentId: string;
collection: string;
image_item: boolean;
date_list: boolean;
numbered_item: boolean;
inverse_count: boolean;
reference: string;
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
publishedAt: string; publishedAt: string;
reference: string;
collection: "events" | "vehicles" | "articles" | "operations";
show_image: boolean;
show_date: boolean;
list_with_date: "none" | "by-year" | "by-month";
items_with_number: "none" | "numbered" | "inverted";
enable_detail: boolean;
} }

View file

@ -1,5 +1,3 @@
import type BaseCollection from "./baseCollection"; import type BaseCollection from "./baseCollection";
export default interface Operation extends BaseCollection { export default interface Operation extends BaseCollection {}
image: undefined;
}

View file

@ -1,5 +1,5 @@
import type { ComponentTypes } from "../component/baseComponent"; import type { ComponentTypes } from "../component/baseComponent";
import type SharedHero from "../component/sharedHero"; import type ItemsHero from "../component/items/hero";
export default interface Page { export default interface Page {
id: number; id: number;
@ -10,7 +10,7 @@ export default interface Page {
publishedAt: string; publishedAt: string;
locale: string; locale: string;
slug: string; slug: string;
hero: SharedHero; hero: ItemsHero;
content: Array<ComponentTypes>; content: Array<ComponentTypes>;
localizations: any[]; localizations: any[];
} }

View file

@ -1,6 +1,3 @@
import type BaseFile from "../component/baseFile";
import type BaseCollection from "./baseCollection"; import type BaseCollection from "./baseCollection";
export default interface Vehicle extends BaseCollection { export default interface Vehicle extends BaseCollection {}
date: undefined;
}

View file

@ -1,12 +1,14 @@
import type DynamicZoneColumnImageText from "./dynamicZoneColumnImageText"; import type SharedEmphasiseArticle from "./shared/emphasiseArticle";
import type DynamicZoneDualColumnText from "./dynamicZoneDualColumnText"; import type SharedList from "./shared/list";
import type DynamicZoneEmphasiseArticle from "./dynamicZoneEmphasiseArticle"; import type DynamicZoneColumnImageText from "./dynamic-zone/columnImageText";
import type DynamicZoneFullImage from "./dynamicZoneFullImage"; import type DynamicZoneDualColumnText from "./dynamic-zone/dualColumnText";
import type DynamicZoneFullText from "./dynamicZoneFullText"; import type DynamicZoneFullImage from "./dynamic-zone/fullImage";
import type DynamicZoneGallery from "./dynamicZoneGallery"; import type DynamicZoneFullText from "./dynamic-zone/fullText";
import type DynamicZoneFileDownload from "./dynamicZoneFileDownload"; import type DynamicZoneGallery from "./dynamic-zone/gallery";
import type SharedList from "./sharedList"; import type DynamicZoneFileDownload from "./dynamic-zone/fileDownload";
import type DynamicZoneEmbedding from "./dynamicZoneEmbedding"; import type DynamicZoneEmbedding from "./dynamic-zone/embedding";
import type DynamicZoneSection from "./dynamic-zone/section";
import type DynamicZoneSpacer from "./dynamic-zone/spacer";
export default interface BaseComponent { export default interface BaseComponent {
__component: ComponentNames; __component: ComponentNames;
@ -15,10 +17,12 @@ export default interface BaseComponent {
export type ComponentNames = export type ComponentNames =
| "shared.list" | "shared.list"
| "shared.emphasise-article"
| "dynamic-zone.section"
| "dynamic-zone.spacer"
| "dynamic-zone.gallery" | "dynamic-zone.gallery"
| "dynamic-zone.full-text" | "dynamic-zone.full-text"
| "dynamic-zone.full-image" | "dynamic-zone.full-image"
| "dynamic-zone.emphasise-article"
| "dynamic-zone.dual-column-text" | "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text" | "dynamic-zone.column-image-text"
| "dynamic-zone.file-download" | "dynamic-zone.file-download"
@ -26,10 +30,12 @@ export type ComponentNames =
export type ComponentTypes = export type ComponentTypes =
| SharedList | SharedList
| SharedEmphasiseArticle
| DynamicZoneSection
| DynamicZoneSpacer
| DynamicZoneGallery | DynamicZoneGallery
| DynamicZoneFullText | DynamicZoneFullText
| DynamicZoneFullImage | DynamicZoneFullImage
| DynamicZoneEmphasiseArticle
| DynamicZoneDualColumnText | DynamicZoneDualColumnText
| DynamicZoneColumnImageText | DynamicZoneColumnImageText
| DynamicZoneFileDownload | DynamicZoneFileDownload

View file

@ -1,6 +1,6 @@
import type ContentField from "../field/content"; import type ContentField from "../../field/content";
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
import type BaseFile from "./baseFile"; import type BaseFile from "../baseFile";
export default interface DynamicZoneColumnImageText extends BaseComponent { export default interface DynamicZoneColumnImageText extends BaseComponent {
__component: "dynamic-zone.column-image-text"; __component: "dynamic-zone.column-image-text";

View file

@ -1,5 +1,5 @@
import type ContentField from "../field/content"; import type ContentField from "../../field/content";
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
export default interface DynamicZoneDualColumnText extends BaseComponent { export default interface DynamicZoneDualColumnText extends BaseComponent {
__component: "dynamic-zone.dual-column-text"; __component: "dynamic-zone.dual-column-text";

View file

@ -1,7 +1,6 @@
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
export default interface DynamicZoneEmbedding extends BaseComponent { export default interface DynamicZoneEmbedding extends BaseComponent {
__component: "dynamic-zone.embedding"; __component: "dynamic-zone.embedding";
title: string;
link: string; link: string;
} }

View file

@ -1,9 +1,8 @@
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
import type BaseFile from "./baseFile"; import type BaseFile from "../baseFile";
export default interface DynamicZoneFileDownload extends BaseComponent { export default interface DynamicZoneFileDownload extends BaseComponent {
__component: "dynamic-zone.file-download"; __component: "dynamic-zone.file-download";
enable_download: boolean; enable_download: boolean;
title: string;
file: BaseFile; file: BaseFile;
} }

View file

@ -1,5 +1,5 @@
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
import type BaseFile from "./baseFile"; import type BaseFile from "../baseFile";
export default interface DynamicZoneFullImage extends BaseComponent { export default interface DynamicZoneFullImage extends BaseComponent {
__component: "dynamic-zone.full-image"; __component: "dynamic-zone.full-image";

View file

@ -1,5 +1,5 @@
import type ContentField from "../field/content"; import type ContentField from "../../field/content";
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
export default interface DynamicZoneFullText extends BaseComponent { export default interface DynamicZoneFullText extends BaseComponent {
__component: "dynamic-zone.full-text"; __component: "dynamic-zone.full-text";

View file

@ -1,5 +1,5 @@
import type BaseComponent from "./baseComponent"; import type BaseComponent from "../baseComponent";
import type BaseFile from "./baseFile"; import type BaseFile from "../baseFile";
export default interface DynamicZoneGallery extends BaseComponent { export default interface DynamicZoneGallery extends BaseComponent {
__component: "dynamic-zone.gallery"; __component: "dynamic-zone.gallery";

View file

@ -0,0 +1,7 @@
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneSection extends BaseComponent {
__component: "dynamic-zone.section";
title: string;
description: string;
}

View file

@ -0,0 +1,5 @@
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneSpacer extends BaseComponent {
__component: "dynamic-zone.spacer";
}

View file

@ -1,10 +0,0 @@
import type Article from "../collection/article";
import type BaseComponent from "./baseComponent";
export default interface DynamicZoneEmphasiseArticle extends BaseComponent {
__component: "dynamic-zone.emphasise-article";
titel: string;
description: string;
articles: Array<Article>;
base_url: string;
}

View file

@ -0,0 +1,8 @@
import type FooterLink from "../items/footerLink";
export default interface Footer {
id: number;
copyright: undefined | string;
maintained_by: undefined | string;
links: FooterLink[];
}

View file

@ -0,0 +1,6 @@
import type NavbarItem from "../items/navbarItem";
export default interface Navbar {
id: number;
navbar_items: NavbarItem[];
}

View file

@ -1,4 +1,4 @@
export default interface SEOComponent { export default interface SEO {
metaTitle: string; metaTitle: string;
metaDescription: string; metaDescription: string;
keywords: string; keywords: string;

View file

@ -1,8 +0,0 @@
import type FooterLink from "./itemsFooterLink";
export default interface Footer {
id: number;
copyright: string;
maintained?: string;
links: FooterLink[];
}

View file

@ -1,8 +0,0 @@
import type BaseFile from "./baseFile";
import type NavbarItem from "./itemsNavbarItem";
export default interface Navbar {
id: number;
logo: BaseFile;
navbar_items: NavbarItem[];
}

View file

@ -0,0 +1,7 @@
import type BaseFile from "../baseFile";
export default interface ItemsHero {
id: number;
title: string | undefined;
banner: BaseFile | undefined;
}

View file

@ -1,4 +1,4 @@
import type NavbarSubItem from "./itemsNavbarSubItem"; import type NavbarSubItem from "./navbarSubItem";
export default interface NavbarItem { export default interface NavbarItem {
id: number; id: number;

View file

@ -1,4 +1,4 @@
import type Page from "../collection/page"; import type Page from "../../collection/page";
export default interface NavbarSubItem { export default interface NavbarSubItem {
id: number; id: number;

View file

@ -0,0 +1,8 @@
import type Article from "../../collection/article";
import type BaseComponent from "../baseComponent";
export default interface SharedEmphasiseArticle extends BaseComponent {
__component: "shared.emphasise-article";
articles: Array<Article>;
link_to_articles: string;
}

View file

@ -0,0 +1,7 @@
import type Lookup from "../../collection/lookup";
import type BaseComponent from "../baseComponent";
export default interface SharedList extends BaseComponent {
__component: "shared.list";
lookup: Lookup;
}

View file

@ -1,7 +0,0 @@
import type BaseFile from "./baseFile";
export default interface SharedHero {
id: number;
title: string;
banner: BaseFile;
}

View file

@ -1,8 +0,0 @@
import type Lookup from "../collection/lookup";
import type BaseComponent from "./baseComponent";
export default interface SharedList extends BaseComponent {
__component: "shared.list";
enable_detail: boolean;
lookup: Lookup;
}

View file

@ -1,6 +1,7 @@
import type Footer from "../component/globalFooter"; import type BaseFile from "../component/baseFile";
import type Navbar from "../component/globalNavbar"; import type Footer from "../component/global/footer";
import type SEOComponent from "../component/seoComponent"; import type Navbar from "../component/global/navbar";
import type SEO from "../component/global/seo";
export default interface Global { export default interface Global {
id: number; id: number;
@ -9,7 +10,8 @@ export default interface Global {
updatedAt: string; updatedAt: string;
publishedAt: string; publishedAt: string;
locale: string; locale: string;
navbar: Navbar; logo: BaseFile;
footer: Footer; navbar: Navbar | undefined;
SEO: SEOComponent; footer: Footer | undefined;
SEO: SEO | undefined;
} }

View file

@ -8,7 +8,6 @@ export default interface Homepage {
updatedAt: string; updatedAt: string;
publishedAt: string; publishedAt: string;
locale: string; locale: string;
backdrop: BaseFile; backdrop: undefined | BaseFile;
hide_backdrop: boolean;
content: Array<ComponentTypes>; content: Array<ComponentTypes>;
} }