Compare commits

..

No commits in common. "main" and "v1.0.0" have entirely different histories.
main ... v1.0.0

38 changed files with 79 additions and 252 deletions

View file

@ -2,5 +2,4 @@
node_modules/
.git/
.nuxt/
.env
.output/
.env

View file

@ -1,12 +1,12 @@
# ff-webpage
Feuerwehr Webseite zu Strapi Content Management
Feuerwehr Webseite zu Strapi Contnet Management
## Einleitung
Dieses Repository dient zur dynamischen Erstellung von Webseiten. Es ist ein Frontend-Client, der auf die Daten des [Strapi Content Management Systems (CMS)](https://forgejo.jk-effects.cloud/Ehrenamt/ff-webpage-cms) zugreift. Die Webseite wird mit Nuxt.js erstellt und bietet eine benutzerfreundliche Oberfläche für die Anzeige von Inhalten. Die Webseite ist für Feuerwehren konzipiert und bietet eine einfache Möglichkeit, Informationen zu veröffentlichen und zu verwalten.
Eine Demo dieser Seite finden Sie unter [https://webpage-demo.ff-admin.de](https://webpage-demo.ff-admin.de).
Eine Demo dieser Seite finden Sie unter [https://ff-demo.jk-effects.cloud](https://ff-demo.jk-effects.cloud).
## Installation

18
app.vue
View file

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

View file

@ -18,9 +18,9 @@
<NuxtPicture
v-if="data?.image"
loading="lazy"
class="max-sm:w-full h-full sm:h-[50vh] max-w-full object-cover object-center"
class="w-full h-full sm:w-fit sm:h-[50vh] max-w-full object-cover object-center"
:src="baseUrl + data.image.url"
:imgAttrs="{ class: 'h-full sm:h-[50vh] object-cover object-center' }"
:imgAttrs="{ class: 'w-full h-full sm:w-fit sm:h-[50vh] object-cover object-center' }"
/>
<br v-if="data?.image" />
<div v-if="data?.content">
@ -34,9 +34,9 @@
<NuxtPicture
v-for="img in data.attachment"
loading="lazy"
class="max-sm:w-full sm:h-48 object-cover object-center"
class="w-full h-fit sm:w-fit sm:h-48 object-cover object-center"
:src="baseUrl + img.url"
:imgAttrs="{ class: 'max-sm:w-full sm:h-48 object-cover object-center' }"
:imgAttrs="{ class: 'w-full h-fit sm:w-fit sm:h-48 object-cover object-center' }"
/>
</div>
</div>

View file

@ -9,8 +9,6 @@
<DynamicZoneFullImage v-else-if="item.__component == 'dynamic-zone.full-image'" :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" />
<DynamicZoneFileDownload v-else-if="item.__component == 'dynamic-zone.file-download'" :data="item" />
<DynamicZoneEmbedding v-else-if="item.__component == 'dynamic-zone.embedding'" :data="item" />
<SharedList v-else-if="item.__component == 'shared.list'" :data="item" />
<br />
</div>

View file

@ -1,23 +1,13 @@
<template>
<footer darkgray class="h-48 min-h-fit w-full px-5 py-10 flex-col justify-center items-center flex gap-2">
<div darkgray class="h-48 min-h-fit w-full px-5 py-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 v-for="link in footer.links" :key="link.id" class="contents">
<a v-if="link.URL.startsWith('http')" :href="link.URL" :target="link.target" class="text-base">{{
link.text
}}</a>
<NuxtLink
v-else
:to="`${link.URL.startsWith('/') ? '' : '/'}${link.URL}`"
:target="link.target"
class="text-base"
>
{{ link.text }}
</NuxtLink>
</div>
<NuxtLink v-for="link in footer.links" :key="link.id" :to="link.URL" :target="link.target" class="text-base">
{{ link.text }}
</NuxtLink>
</div>
<div class="text-base text-center">@Copyright {{ new Date().getFullYear() }} {{ footer.copyright }}</div>
<div class="text-base text-center">verwaltet von {{ footer.designed_developed_by }}</div>
</footer>
</div>
</template>
<script setup lang="ts">

View file

@ -1,11 +1,11 @@
<template>
<header class="sticky top-0 h-fit z-50">
<div class="sticky top-0 h-fit">
<div
primary
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="/">
<img class="h-16" :src="baseUrl + navbar.logo.url" />
<img class="h-16 w-fit min-w-fit" :src="baseUrl + navbar.logo.url" />
</NuxtLink>
<div class="md:hidden">
<svg
@ -57,7 +57,7 @@
{{ sublink.name }}
</NuxtLink>
</div>
</header>
</div>
</template>
<script setup lang="ts">

View file

@ -11,13 +11,8 @@
:imgAttrs="{ class: 'w-full h-56 object-cover object-center' }"
/>
<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>
<span v-if="numberOverwrite != undefined" class="w-24 text-center text-black text-4xl my-auto">
{{ numberOverwrite }}.
</span>
{{ data?.title }}
</h1>
<p v-if="numberOverwrite != undefined && data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
<h1>{{ data?.title }}</h1>
<p v-if="data?.date" class="w-full text-[#5c5c5c]">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
@ -27,16 +22,6 @@
hour: "2-digit",
})
}}
Uhr
</p>
<p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
</p>
<p class="w-full text-[#5c5c5c]">
{{ data?.description }}
@ -54,7 +39,6 @@ const baseUrl = runtimeConfig.public.strapi.url;
defineProps({
data: Object as PropType<BaseCollection>,
numberOverwrite: { type: Number, default: undefined },
allowNavigation: { type: Boolean, default: false },
urlOverwrite: { type: String, default: undefined },
});

View file

@ -16,7 +16,7 @@
</h1>
<div class="grow shrink basis-0 flex-col justify-center items-center flex">
<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="numberOverwrite != undefined" class="w-full text-[#5c5c5c]">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
@ -26,16 +26,14 @@
hour: "2-digit",
})
}}
Uhr
</p>
<p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
<p v-else class="w-full text-[#5c5c5c]">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
</p>
<p class="w-full text-[#5c5c5c]">
{{ data?.description }}

View file

@ -1,11 +1,11 @@
<template>
<div class="flex flex-col md:flex-row gap-8 md:gap-4">
<div class="flex flex-col md:flex-row gap-4">
<NuxtPicture
loading="lazy"
class="w-full md:w-1/2 min-w-[50%] object-cover object-center"
class="w-full md:w-1/2 min-w-[50%] h-fit object-cover object-center"
:class="data?.image_left ? 'order-0' : 'order-1'"
:src="baseUrl + data?.image.url"
:imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
:imgAttrs="{ class: 'w-full h-fit object-cover object-center' }"
/>
<FieldContent :data="data?.text" />
</div>

View file

@ -1,5 +1,5 @@
<template>
<div class="flex flex-col md:flex-row gap-8 md:gap-4">
<div class="flex flex-col md:flex-row gap-4">
<FieldContent :data="data?.left_side" />
<FieldContent :data="data?.right_side" />
</div>

View file

@ -1,15 +0,0 @@
<template>
<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>
</div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneEmbedding from "../../types/component/dynamicZoneEmbedding";
const props = defineProps({
data: Object as PropType<DynamicZoneEmbedding>,
});
</script>

View file

@ -1,42 +0,0 @@
<template>
<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>
<NuxtPicture
v-if="data.file.mime.includes('image')"
loading="lazy"
class="w-full object-cover object-center mx-auto"
:src="baseUrl + data?.file.url"
:imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
/>
<a
v-if="data.enable_download"
:href="baseUrl + data.file.url"
:download="data.file.name"
target="_blank"
class="w-fit text-primary underline"
>
Datei herunterladen
</a>
</div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneFileDownload from "../../types/component/dynamicZoneFileDownload";
const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;
const props = defineProps({
data: Object as PropType<DynamicZoneFileDownload>,
});
const showComponent = computed(() => {
if (props.data.file.mime == "application/pdf" || props.data.file.mime.includes("image")) {
return true;
} else {
return props.data.enable_download;
}
});
</script>

View file

@ -1,9 +1,9 @@
<template>
<NuxtPicture
loading="lazy"
class="w-full lg:w-1/2 lg:min-w-[50%] object-cover object-center mx-auto"
class="w-full lg:w-1/2 lg:min-w-[50%] h-fit object-cover object-center mx-auto"
:src="baseUrl + data?.image.url"
:imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
:imgAttrs="{ class: 'w-full h-fit object-cover object-center' }"
/>
</template>

View file

@ -3,9 +3,9 @@
<NuxtPicture
v-for="img in data?.images"
loading="lazy"
class="max-sm:w-full sm:h-48 object-cover object-center"
class="w-full h-fit sm:w-fit sm:h-48 object-cover object-center"
:src="baseUrl + img.url"
:imgAttrs="{ class: 'max-sm:w-full sm:h-48 object-cover object-center' }"
:imgAttrs="{ class: 'w-full h-fit sm:w-fit sm:h-48 object-cover object-center' }"
/>
</div>
</template>

View file

@ -26,9 +26,8 @@
primary
:to="item.children[0].text.split('->')[0]"
class="w-fit p-2 px-3 rounded-md mx-auto mt-3"
>{{ item.children[0].text.split("->")[1] }}</NuxtLink
>
{{ item.children[0].text.split("->")[1] }}
</NuxtLink>
</div>
</div>
</template>

View file

@ -23,18 +23,7 @@
:class="data?.lookup.image_item ? 'flex-row flex-wrap justify-center' : ' flex-col'"
>
<div v-for="(item, index) in collection" :key="item.slug" class="contents">
<p
v-if="data?.lookup.date_list && data?.lookup.numbered_item == false && getDate(index) != ''"
class="w-full text-center"
>
{{ getDate(index) }}
</p>
<BaseListImageItem
v-if="data?.lookup.image_item"
:data="item"
:number-overwrite="data.lookup.numbered_item ? getNumber(index) : undefined"
:allow-navigation="data.enable_detail"
/>
<BaseListImageItem v-if="data?.lookup.image_item" :data="item" :allow-navigation="data.enable_detail" />
<BaseListItem
v-else-if="data?.lookup"
:data="item"
@ -44,7 +33,7 @@
</div>
</div>
<div
v-if="pagination.pageCount > 1"
v-if="data?.lookup.date_list"
class="flex flex-row w-full max-w-4xl mx-auto justify-between items-center select-none pt-4"
>
<p class="text-sm font-normal text-gray-500">
@ -67,7 +56,7 @@
v-for="page in displayedPagesNumbers"
:key="page"
class="flex h-8 w-8 items-center justify-center text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 first:rounded-s-lg last:rounded-e-lg"
:class="[currentPage - 1 == page ? 'font-bold border-primary' : '', page != '.' ? ' cursor-pointer' : '']"
:class="[currentPage == page ? 'font-bold border-primary' : '', page != '.' ? ' cursor-pointer' : '']"
@click="changeTimedPage(page)"
>
{{ typeof page == "number" ? page + 1 : "..." }}
@ -75,7 +64,7 @@
<li
class="flex h-8 w-8 items-center justify-center text-gray-500 bg-white border border-gray-300 first:rounded-s-lg last:rounded-e-lg"
:class="[
currentPage < pagination.pageCount
currentPage + 1 < pagination.pageCount
? 'cursor-pointer hover:bg-gray-100 hover:text-gray-700'
: 'opacity-50 pointer-events-none',
]"
@ -127,7 +116,7 @@ const { data: collections } = await useAsyncData("collection", () =>
sort: "date:desc",
filters: {
date: {
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
$between: [`${activeYear.value}-01-01T00:00:00.000Z`, `${activeYear.value}-12-31T23:59:59.999Z`],
},
},
pagination: {
@ -136,13 +125,7 @@ const { data: collections } = await useAsyncData("collection", () =>
withCount: true,
},
}
: {
pagination: {
page: 1,
pageSize: 10,
withCount: true,
},
}),
: {}),
})
);
collection.value = collections.value?.data;
@ -201,33 +184,19 @@ const displayedPagesNumbers = computed(() => {
function getNumber(index: number): number {
if (props.data?.lookup.inverse_count) {
return pagination.value.total - numberOffset.value - index;
return pagination.value.pageCount - numberOffset.value - index + 1;
} else {
return numberOffset.value + index + 1;
}
}
function getDate(index: number): string {
let thisElement = collection.value?.[index];
let beforeElement = collection.value?.[index - 1];
if (thisElement && beforeElement) {
let thisElementDate = new Date(thisElement.date ?? "").toLocaleDateString("de", { month: "long" });
let beforeElementDate = new Date(beforeElement.date ?? "").toLocaleDateString("de", { month: "long" });
if (thisElementDate == beforeElementDate) return "";
else return thisElementDate;
} else if (thisElement) {
return new Date(thisElement.date ?? "").toLocaleDateString("de", { month: "long" });
} else return "";
}
async function changeTimedData(year: number) {
activeYear.value = year;
const data = await find<BaseCollection>(props.data?.lookup.collection ?? "", {
sort: "date:desc",
filters: {
date: {
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
$between: [`${activeYear.value}-01-01T00:00:00.000Z`, `${activeYear.value}-12-31T23:59:59.999Z`],
},
},
pagination: {
@ -236,7 +205,6 @@ async function changeTimedData(year: number) {
withCount: true,
},
});
console.log(data);
collection.value = data?.data;
pagination.value = (data?.meta.pagination as unknown as {
page: number;
@ -255,7 +223,7 @@ async function changeTimedPage(page: number = 1) {
sort: "date:desc",
filters: {
date: {
$between: [`${activeYear.value}-01-01 00:00:00.000000`, `${activeYear.value}-12-31 23:59:59.999`],
$between: [`${activeYear.value}-01-01T00:00:00.000Z`, `${activeYear.value}-12-31T23:59:59.999Z`],
},
},
pagination: {

View file

@ -1,17 +1,12 @@
<template>
<div v-if="!hide_backdrop" class="relative h-[calc(100svh-6rem)] max-h-[calc(100svh-6rem)] w-full overflow-hidden">
<div class="relative h-[calc(100svh-6rem)] max-h-[calc(100svh-6rem)] w-full overflow-hidden">
<NuxtPicture
loading="lazy"
class="w-full h-full object-cover object-center"
:src="baseUrl + backdrop.url"
: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
class="absolute h-5 w-5 left-1/2 -translate-y-1/2 bottom-5 text-gray-400 cursor-pointer"
src="/chevrons-down.svg"
@click="scroll()"
/>
<img class="absolute p-4 w-full h-fit sm:h-40 sm:w-fit bottom-5" :src="baseUrl + navbar.logo.url" />
</div>
<Header />
<slot />
@ -33,9 +28,5 @@ const { data: global } = await useAsyncData("global", () => findOne<Global>("glo
const { navbar } = global.value?.data as unknown as Global;
const { data: homepage } = await useAsyncData("homepage", () => findOne<Homepage>("homepage"));
const { backdrop, hide_backdrop } = homepage.value?.data as unknown as Homepage;
function scroll() {
window.scrollTo({ top: window.innerHeight - 96, behavior: "smooth" });
}
const { backdrop } = homepage.value?.data as unknown as Homepage;
</script>

View file

@ -10,6 +10,7 @@ export default defineNuxtConfig({
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: "description", name: "description", content: "" },
{ name: "format-detection", content: "telephone=no" },
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.png" }],

23
package-lock.json generated
View file

@ -1,16 +1,14 @@
{
"name": "nuxt-app",
"version": "1.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "nuxt-app",
"version": "1.1.0",
"hasInstallScript": true,
"dependencies": {
"@nuxt/image": "^1.8.1",
"@nuxtjs/strapi": "^2.0.0",
"@nuxtjs/strapi": "npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9",
"nuxt": "^3.13.2",
"vue": "latest",
"vue-router": "latest"
@ -19,7 +17,8 @@
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14"
}
},
"version": "1.0.0"
},
"node_modules/@alloc/quick-lru": {
"version": "5.2.0",
@ -1355,9 +1354,10 @@
}
},
"node_modules/@nuxtjs/strapi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi/-/strapi-2.0.0.tgz",
"integrity": "sha512-6Q34PQd980ruBTaMzVx23V/GP3YeoqWt9NKxVG79d1TJMwpKHCkFqZEN5jI/2csMyncYuzP4ozt2lIi5JYTudA==",
"name": "@nuxtjs/strapi-edge",
"version": "1.12.0-28818224.f53bdf9",
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi-edge/-/strapi-edge-1.12.0-28818224.f53bdf9.tgz",
"integrity": "sha512-SdazV9/5qJr/b5F//fveU9DVxBFeYKfB6Gg7wyvZoNUW9z9BSPuQyoCfDdzRkPy+QqdaLhFXPjFJdPNeK/8agA==",
"license": "MIT",
"dependencies": {
"@nuxt/kit": "^3.13.2",
@ -10923,9 +10923,9 @@
}
},
"@nuxtjs/strapi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi/-/strapi-2.0.0.tgz",
"integrity": "sha512-6Q34PQd980ruBTaMzVx23V/GP3YeoqWt9NKxVG79d1TJMwpKHCkFqZEN5jI/2csMyncYuzP4ozt2lIi5JYTudA==",
"version": "npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9",
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi-edge/-/strapi-edge-1.12.0-28818224.f53bdf9.tgz",
"integrity": "sha512-SdazV9/5qJr/b5F//fveU9DVxBFeYKfB6Gg7wyvZoNUW9z9BSPuQyoCfDdzRkPy+QqdaLhFXPjFJdPNeK/8agA==",
"requires": {
"@nuxt/kit": "^3.13.2",
"defu": "^6.1.4",
@ -16597,5 +16597,6 @@
"readable-stream": "^4.0.0"
}
}
}
},
"version": "1.0.0"
}

View file

@ -4,14 +4,14 @@
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev --host",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxt/image": "^1.8.1",
"@nuxtjs/strapi": "^2.0.0",
"@nuxtjs/strapi": "npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9",
"nuxt": "^3.13.2",
"vue": "latest",
"vue-router": "latest"
@ -21,5 +21,5 @@
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14"
},
"version": "1.1.0"
"version": "1.0.0"
}

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevrons-down"><polyline points="7 13 12 18 17 13"></polyline><polyline points="7 6 12 11 17 6"></polyline></svg>

Before

Width:  |  Height:  |  Size: 317 B

View file

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

View file

@ -1,4 +1,4 @@
import type BaseFile from "../component/baseFile";
import type BaseImage from "../component/baseImage";
import type ContentField from "../field/content";
export default interface BaseCollection {
@ -14,6 +14,6 @@ export default interface BaseCollection {
description: string;
date: string | undefined;
content: ContentField | undefined;
image: BaseFile | undefined;
attachment: Array<BaseFile>;
image: BaseImage | undefined;
attachment: Array<BaseImage>;
}

View file

@ -1,4 +1,4 @@
import type BaseFile from "../component/baseFile";
import type BaseImage from "../component/baseImage";
import type BaseCollection from "./baseCollection";
export default interface Vehicle extends BaseCollection {

View file

@ -4,9 +4,7 @@ import type DynamicZoneEmphasiseArticle from "./dynamicZoneEmphasiseArticle";
import type DynamicZoneFullImage from "./dynamicZoneFullImage";
import type DynamicZoneFullText from "./dynamicZoneFullText";
import type DynamicZoneGallery from "./dynamicZoneGallery";
import type DynamicZoneFileDownload from "./dynamicZoneFileDownload";
import type SharedList from "./sharedList";
import type DynamicZoneEmbedding from "./dynamicZoneEmbedding";
export default interface BaseComponent {
__component: ComponentNames;
@ -20,9 +18,7 @@ export type ComponentNames =
| "dynamic-zone.full-image"
| "dynamic-zone.emphasise-article"
| "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text"
| "dynamic-zone.file-download"
| "dynamic-zone.embedding";
| "dynamic-zone.column-image-text";
export type ComponentTypes =
| SharedList
@ -31,6 +27,4 @@ export type ComponentTypes =
| DynamicZoneFullImage
| DynamicZoneEmphasiseArticle
| DynamicZoneDualColumnText
| DynamicZoneColumnImageText
| DynamicZoneFileDownload
| DynamicZoneEmbedding;
| DynamicZoneColumnImageText;

View file

@ -1,4 +1,4 @@
export default interface BaseFile {
export default interface BaseImage {
id: number;
documentId: string;
name: string;

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseImage from "./baseImage";
export default interface DynamicZoneGallery extends BaseComponent {
__component: "dynamic-zone.gallery";
images: Array<BaseFile>;
images: Array<BaseImage>;
}

View file

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

View file

@ -1,5 +0,0 @@
export default interface SEOComponent {
metaTitle: string;
metaDescription: string;
keywords: string;
}

View file

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

View file

@ -12,7 +12,7 @@ export default interface ContentField
}
| {
type: "code";
children: Array<TextField>;
children: Array<{ type: "list-item"; children: Array<TypeField> }>;
language: "plaintext";
}
> {}

View file

@ -1,6 +1,5 @@
import type Footer from "../component/globalFooter";
import type Navbar from "../component/globalNavbar";
import type SEOComponent from "../component/seoComponent";
export default interface Global {
id: number;
@ -11,5 +10,4 @@ export default interface Global {
locale: string;
navbar: Navbar;
footer: Footer;
SEO: SEOComponent;
}

View file

@ -1,4 +1,4 @@
import type BaseFile from "../component/baseFile";
import type BaseImage from "../component/baseImage";
import type { ComponentTypes } from "../component/baseComponent";
export default interface Homepage {
@ -8,7 +8,6 @@ export default interface Homepage {
updatedAt: string;
publishedAt: string;
locale: string;
backdrop: BaseFile;
hide_backdrop: boolean;
backdrop: BaseImage;
content: Array<ComponentTypes>;
}