From b3262d8700aaa1baedc1baff27c9ff3506b2878e Mon Sep 17 00:00:00 2001 From: Benno Tielen Date: Thu, 22 Aug 2024 11:04:22 +0200 Subject: [PATCH] style: prettier --- .eslintrc.cjs | 5 - .storybook/preview.tsx | 4 +- .../admin/[[...segments]]/not-found.tsx | 8 +- .../(payload)/admin/[[...segments]]/page.tsx | 8 +- src/app/(payload)/api/[...slug]/route.ts | 8 +- src/app/(payload)/layout.tsx | 4 +- src/app/BannerWithMenu.tsx | 44 +++-- src/app/fonts.ts | 10 +- src/app/home.module.css | 12 +- src/app/layout.tsx | 21 +- src/app/not-found.tsx | 8 +- src/app/page.tsx | 57 +++--- src/app/worship/[id]/page.tsx | 61 +++--- src/app/worship/[id]/styles.module.css | 36 ++-- src/collections/Churches.ts | 64 +++---- src/collections/Testimony.ts | 22 +-- src/collections/Worship.ts | 152 +++++++-------- .../BannerText/BannerText.stories.ts | 14 +- src/components/BannerText/BannerText.tsx | 32 ++-- .../BannerText/bannerText.module.css | 54 +++--- src/components/Card/Card.stories.tsx | 6 +- src/components/Card/Card.tsx | 14 +- src/components/Card/styles.module.css | 10 +- .../Container/Container.stories.tsx | 22 +-- src/components/Container/Container.tsx | 14 +- src/components/Container/styles.module.css | 18 +- src/components/HomeBanner/HomeBanner.css | 24 +-- .../HomeBanner/HomeBanner.stories.ts | 18 +- src/components/HomeBanner/HomeBanner.tsx | 110 ++++++----- src/components/Map/Map.tsx | 35 ++-- src/components/Map/styles.module.css | 4 +- src/components/MassTable/MassTable.stories.ts | 72 +++---- src/components/MassTable/MassTable.tsx | 57 +++--- .../MassTable/MassTableRow.stories.ts | 70 +++---- src/components/MassTable/MassTableRow.tsx | 83 ++++---- src/components/MassTable/styles.module.css | 24 +-- src/components/MassTimer/MassTimer.stories.ts | 31 ++- src/components/MassTimer/MassTimer.tsx | 83 ++++---- src/components/MassTimer/masstimer.module.css | 16 +- src/components/MassTimer/useCountdown.ts | 45 ++--- .../MassTimerTooltip.stories.ts | 16 +- .../MassTimerTooltip/MassTimerTooltip.tsx | 34 ++-- .../massTimerTooltip.module.css | 46 +++-- .../MassTitle/MassTitle.stories.tsx | 8 +- src/components/MassTitle/MassTitle.tsx | 20 +- src/components/MassTitle/styles.module.css | 14 +- src/components/Menu/Menu.stories.ts | 16 +- src/components/Menu/Menu.tsx | 72 ++++--- src/components/Menu/styles.module.css | 73 ++++--- .../MenuBaseLayer/MenuBaseLayer.stories.tsx | 14 +- .../MenuBaseLayer/MenuBaseLayer.tsx | 4 +- src/components/MenuBaseLayer/style.module.css | 18 +- src/components/Pill/Pill.stories.tsx | 6 +- src/components/Pill/Pill.tsx | 12 +- src/components/Pill/styles.module.css | 10 +- .../Testimony/Testimony.stories.tsx | 7 +- src/components/Testimony/Testimony.tsx | 20 +- src/components/Testimony/styles.module.css | 20 +- src/hooks/calendars.ts | 8 +- src/hooks/useCompactDate.ts | 10 +- src/hooks/useLiturgyCalendarTitle.ts | 6 +- src/hooks/useLocation.ts | 11 +- src/hooks/useLocationName.ts | 4 +- src/hooks/useMassType.ts | 15 +- src/hooks/useTime.ts | 4 +- src/payload-types.ts | 179 +++++++++--------- src/payload.config.ts | 2 +- tsconfig.json | 25 +-- 68 files changed, 1047 insertions(+), 1007 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 82c266b..1996cf0 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,9 +5,4 @@ module.exports = { project: ['./tsconfig.json'], tsconfigRootDir: __dirname, }, - plugins: ['eslint-plugin-prettier'], - rules: { - "prefer-const": "error", - "prettier": "error" - } } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 1e4f6a5..ce4eed8 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -6,10 +6,10 @@ const preview: Preview = { (Story) => { return (
- +
) - } + }, ], parameters: { controls: { diff --git a/src/app/(payload)/admin/[[...segments]]/not-found.tsx b/src/app/(payload)/admin/[[...segments]]/not-found.tsx index e7723f4..7edadbe 100644 --- a/src/app/(payload)/admin/[[...segments]]/not-found.tsx +++ b/src/app/(payload)/admin/[[...segments]]/not-found.tsx @@ -14,9 +14,13 @@ type Args = { } } -export const generateMetadata = ({ params, searchParams }: Args): Promise => +export const generateMetadata = ({ + params, + searchParams, +}: Args): Promise => generatePageMetadata({ config, params, searchParams }) -const NotFound = ({ params, searchParams }: Args) => NotFoundPage({ config, params, searchParams }) +const NotFound = ({ params, searchParams }: Args) => + NotFoundPage({ config, params, searchParams }) export default NotFound diff --git a/src/app/(payload)/admin/[[...segments]]/page.tsx b/src/app/(payload)/admin/[[...segments]]/page.tsx index 61be15c..5903a55 100644 --- a/src/app/(payload)/admin/[[...segments]]/page.tsx +++ b/src/app/(payload)/admin/[[...segments]]/page.tsx @@ -14,9 +14,13 @@ type Args = { } } -export const generateMetadata = ({ params, searchParams }: Args): Promise => +export const generateMetadata = ({ + params, + searchParams, +}: Args): Promise => generatePageMetadata({ config, params, searchParams }) -const Page = ({ params, searchParams }: Args) => RootPage({ config, params, searchParams }) +const Page = ({ params, searchParams }: Args) => + RootPage({ config, params, searchParams }) export default Page diff --git a/src/app/(payload)/api/[...slug]/route.ts b/src/app/(payload)/api/[...slug]/route.ts index 52caec9..efb77bd 100644 --- a/src/app/(payload)/api/[...slug]/route.ts +++ b/src/app/(payload)/api/[...slug]/route.ts @@ -1,7 +1,13 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY it because it could be re-written at any time. */ import config from '@payload-config' -import { REST_DELETE, REST_GET, REST_OPTIONS, REST_PATCH, REST_POST } from '@payloadcms/next/routes' +import { + REST_DELETE, + REST_GET, + REST_OPTIONS, + REST_PATCH, + REST_POST, +} from '@payloadcms/next/routes' export const GET = REST_GET(config) export const POST = REST_POST(config) diff --git a/src/app/(payload)/layout.tsx b/src/app/(payload)/layout.tsx index 7997f27..002e2c1 100644 --- a/src/app/(payload)/layout.tsx +++ b/src/app/(payload)/layout.tsx @@ -11,6 +11,8 @@ type Args = { children: React.ReactNode } -const Layout = ({ children }: Args) => {children} +const Layout = ({ children }: Args) => ( + {children} +) export default Layout diff --git a/src/app/BannerWithMenu.tsx b/src/app/BannerWithMenu.tsx index 88741a4..0c6d41a 100644 --- a/src/app/BannerWithMenu.tsx +++ b/src/app/BannerWithMenu.tsx @@ -1,29 +1,31 @@ -"use client" +'use client' -import {Menu} from "@/components/Menu/Menu"; -import {BannerText} from "@/components/BannerText/BannerText"; -import {HomeBanner, HomeBannerHandle} from "@/components/HomeBanner/HomeBanner"; -import {useRef} from "react"; +import { Menu } from '@/components/Menu/Menu' +import { BannerText } from '@/components/BannerText/BannerText' +import { + HomeBanner, + HomeBannerHandle, +} from '@/components/HomeBanner/HomeBanner' +import { useRef } from 'react' import { Worship } from '@/payload-types' type BannerWithMenuProps = { - nextMass?: Worship + nextMass?: Worship } -export const BannerWithMenu = ({nextMass}: BannerWithMenuProps) => { +export const BannerWithMenu = ({ nextMass }: BannerWithMenuProps) => { + const bannerRef = useRef(null) - const bannerRef = useRef(null); + function addThreeNewStars() { + bannerRef.current?.newStar() + bannerRef.current?.newStar() + bannerRef.current?.newStar() + } - function addThreeNewStars() { - bannerRef.current?.newStar(); - bannerRef.current?.newStar(); - bannerRef.current?.newStar(); - } - - return ( - - - - - ) -} \ No newline at end of file + return ( + + + + + ) +} diff --git a/src/app/fonts.ts b/src/app/fonts.ts index bcc23a3..2bdcec9 100644 --- a/src/app/fonts.ts +++ b/src/app/fonts.ts @@ -1,12 +1,12 @@ -import { Faustina, Lato } from 'next/font/google'; +import { Faustina, Lato } from 'next/font/google' export const faustina = Faustina({ subsets: ['latin'], - display: "swap" + display: 'swap', }) export const lato = Lato({ subsets: ['latin'], - weight: ["400"], - display: 'swap' -}) \ No newline at end of file + weight: ['400'], + display: 'swap', +}) diff --git a/src/app/home.module.css b/src/app/home.module.css index b060038..0d5825d 100644 --- a/src/app/home.module.css +++ b/src/app/home.module.css @@ -1,13 +1,13 @@ .mass { - padding-top: 30px; - padding-bottom: 300px; + padding-top: 30px; + padding-bottom: 300px; } .mass h2 { - text-align: center; + text-align: center; } .table { - display: flex; - justify-content: center; -} \ No newline at end of file + display: flex; + justify-content: center; +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1ac0724..46d01ff 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,20 +1,19 @@ -import type { Metadata } from "next"; -import {lato} from "./fonts"; - +import type { Metadata } from 'next' +import { lato } from './fonts' export const metadata: Metadata = { - title: "Katholische Pfarrei Heilige drei Könige Berlin", - description: "Generated by create next app", -}; + title: 'Katholische Pfarrei Heilige drei Könige Berlin', + description: 'Generated by create next app', +} export default function RootLayout({ - children, - }: Readonly<{ - children: React.ReactNode; + children, +}: Readonly<{ + children: React.ReactNode }>) { return ( - {children} + {children} - ); + ) } diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 3a653f9..c88fd49 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -4,8 +4,12 @@ export default function Custom404() {

404 - Seite nicht gefunden

- Glorreicher heiliger Antonius, du hast die göttliche Macht ausgeübt, verlorene Dinge wiederzufinden. Hilf uns, die Gnade Gottes wiederzuerlangen und mach mich stark im Dienst an Gott und an den Tugenden. Lass' mich das Verlorene wiederfinden und zeige mir so deine Güte. + Glorreicher heiliger Antonius, du hast die göttliche Macht ausgeübt, + verlorene Dinge wiederzufinden. Hilf uns, die Gnade Gottes + wiederzuerlangen und mach mich stark im Dienst an Gott und an den + Tugenden. Lass' mich das Verlorene wiederfinden und zeige mir so + deine Güte.

) -} \ No newline at end of file +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 5b85659..3ba0580 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,7 @@ -import configPromise from "@payload-config"; +import configPromise from '@payload-config' import { BannerWithMenu } from '@/app/BannerWithMenu' import { Worship } from '@/payload-types' -import styles from "./home.module.css" +import styles from './home.module.css' import { MassTable } from '@/components/MassTable/MassTable' import { getPayloadHMR } from '@payloadcms/next/utilities' @@ -9,13 +9,12 @@ const extractWorshipHours = (worships: Worship[]) => { let worshipByDate = new Map() for (let worship of worships) { - - const date = worship.date.substring(0, 10); + const date = worship.date.substring(0, 10) if (worshipByDate.has(date)) { - worshipByDate.get(date)?.push(worship); + worshipByDate.get(date)?.push(worship) } else { - worshipByDate.set(date, [worship]); + worshipByDate.set(date, [worship]) } } @@ -23,29 +22,28 @@ const extractWorshipHours = (worships: Worship[]) => { } export default async function Home() { - - const today = new Date(); - const nextWeek = new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000) - const payload = await getPayloadHMR({ config: configPromise }); + const today = new Date() + const nextWeek = new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000) + const payload = await getPayloadHMR({ config: configPromise }) const worship = await payload.find({ collection: 'worship', where: { and: [ { date: { - greater_than_equal: today.toISOString().substring(0, 10) - } + greater_than_equal: today.toISOString().substring(0, 10), + }, }, { date: { - less_than: nextWeek.toISOString().substring(0, 10) - } + less_than: nextWeek.toISOString().substring(0, 10), + }, }, - ] + ], }, limit: 30, - sort: 'date' - }); + sort: 'date', + }) const nextMass = await payload.find({ collection: 'worship', @@ -53,33 +51,34 @@ export default async function Home() { and: [ { date: { - greater_than_equal: today.toISOString().substring(0, 10) - } + greater_than_equal: today.toISOString().substring(0, 10), + }, }, { cancelled: { - equals: false - } - } - ] + equals: false, + }, + }, + ], }, limit: 1, - sort: "date" + sort: 'date', }) - const worshipByDate = [...extractWorshipHours(worship.docs).entries()]; + const worshipByDate = [...extractWorshipHours(worship.docs).entries()] return ( - <>

Kommen Sie vorbei, in unsere Heilige Messe!

- {worshipByDate.map(([date, worships]) => )} + {worshipByDate.map(([date, worships]) => ( + + ))}
-) -} \ No newline at end of file + ) +} diff --git a/src/app/worship/[id]/page.tsx b/src/app/worship/[id]/page.tsx index 3d84cec..a0930db 100644 --- a/src/app/worship/[id]/page.tsx +++ b/src/app/worship/[id]/page.tsx @@ -5,29 +5,29 @@ import { useLocation } from '@/hooks/useLocation' import { useLiturgyCalendarTitle } from '@/hooks/useLiturgyCalendarTitle' import { Container } from '@/components/Container/Container' import { Card } from '@/components/Card/Card' -import styles from "./styles.module.css" +import styles from './styles.module.css' import { MassTitle } from '@/components/MassTitle/MassTitle' import { useCompactDate, useDate } from '@/hooks/useCompactDate' import { useTime } from '@/hooks/useTime' import { Pill } from '@/components/Pill/Pill' import { useMassType } from '@/hooks/useMassType' import Image from 'next/image' -import bell from "./bell.svg"; -import locationIcon from "./location.svg" -import question from "./question.svg" +import bell from './bell.svg' +import locationIcon from './location.svg' +import question from './question.svg' import { LocationMap } from '@/components/Map/Map' import { Testimony } from '@/components/Testimony/Testimony' -export default async function Page({params}: {params: {id: string}}) { - const payload = await getPayloadHMR({ config: configPromise }); +export default async function Page({ params }: { params: { id: string } }) { + const payload = await getPayloadHMR({ config: configPromise }) const worship = await payload.findByID({ id: params.id, - collection: 'worship' - }); + collection: 'worship', + }) const location = useLocation(worship.location) - const title = useLiturgyCalendarTitle(worship.date); - const date = useDate(worship.date); - const time = useTime(worship.date); + const title = useLiturgyCalendarTitle(worship.date) + const date = useDate(worship.date) + const time = useTime(worship.date) const type = useMassType(worship.type) return ( @@ -37,11 +37,15 @@ export default async function Page({params}: {params: {id: string}}) { -
- {'Location'} + {'Location'}
@@ -55,7 +59,12 @@ export default async function Page({params}: {params: {id: string}}) {
- {'Location'} + {'Location'}
@@ -65,22 +74,30 @@ export default async function Page({params}: {params: {id: string}}) {
- {worship.description && + {worship.description && (
- {'Location'} + {'Location'}
-
- {worship.description} -
+
{worship.description}
- } + )}
- + ) -} \ No newline at end of file +} diff --git a/src/app/worship/[id]/styles.module.css b/src/app/worship/[id]/styles.module.css index a0ac877..0dd5810 100644 --- a/src/app/worship/[id]/styles.module.css +++ b/src/app/worship/[id]/styles.module.css @@ -1,40 +1,40 @@ .info { - display: flex; - gap: 30px; - margin-bottom: 80px; + display: flex; + gap: 30px; + margin-bottom: 80px; } .cardContent { - padding-top: 30px; - padding-left: 50px; + padding-top: 30px; + padding-left: 50px; } .cardText { - padding-top: 30px; - padding-left: 20px; - padding-right: 20px; + padding-top: 30px; + padding-left: 20px; + padding-right: 20px; } .marginBottom { - margin-bottom: 20px; + margin-bottom: 20px; } .address { - white-space: pre; + white-space: pre; } .cardIcon { - margin-bottom: 10px; - margin-left: auto; - margin-right: auto; - transition: transform 100ms; + margin-bottom: 10px; + margin-left: auto; + margin-right: auto; + transition: transform 100ms; } .cardIcon:hover { - transform: rotateZ(-20deg); + transform: rotateZ(-20deg); } .centerIcon { - padding-top: 30px; - text-align: center; -} \ No newline at end of file + padding-top: 30px; + text-align: center; +} diff --git a/src/collections/Churches.ts b/src/collections/Churches.ts index ca9692d..40d05ac 100644 --- a/src/collections/Churches.ts +++ b/src/collections/Churches.ts @@ -1,37 +1,37 @@ import { CollectionConfig } from 'payload' export const Churches: CollectionConfig = { - slug: 'church', - labels: { - singular: { - de: 'Kirche' - }, - plural: { - de: 'Kirchen' - } + slug: 'church', + labels: { + singular: { + de: 'Kirche', }, - fields: [ - { - name: 'name', - label: { - de: 'Name' - }, - type: 'text', - required: true, - }, - { - name: 'address', - label: { - de: 'Addresse' - }, - type: 'textarea', - required: true, - } - ], - admin: { - useAsTitle: 'name' + plural: { + de: 'Kirchen', }, - access: { - read: () => true - } -} \ No newline at end of file + }, + fields: [ + { + name: 'name', + label: { + de: 'Name', + }, + type: 'text', + required: true, + }, + { + name: 'address', + label: { + de: 'Addresse', + }, + type: 'textarea', + required: true, + }, + ], + admin: { + useAsTitle: 'name', + }, + access: { + read: () => true, + }, +} diff --git a/src/collections/Testimony.ts b/src/collections/Testimony.ts index 5499b56..372118d 100644 --- a/src/collections/Testimony.ts +++ b/src/collections/Testimony.ts @@ -4,17 +4,17 @@ export const Testimony: CollectionConfig = { slug: 'testimony', labels: { singular: { - de: 'Zeugnis' + de: 'Zeugnis', }, plural: { - de: 'Zeugnisse' - } + de: 'Zeugnisse', + }, }, fields: [ { name: 'testimony', label: { - de: 'Zeugnis' + de: 'Zeugnis', }, type: 'textarea', required: true, @@ -30,7 +30,7 @@ export const Testimony: CollectionConfig = { { name: 'occupation', label: { - de: 'Beschäftigung' + de: 'Beschäftigung', }, type: 'text', required: false, @@ -38,16 +38,16 @@ export const Testimony: CollectionConfig = { { name: 'category', label: { - de: 'Kategorie' + de: 'Kategorie', }, type: 'select', options: [ { value: 'EUCHARIST', - label: 'Eucharistie' - } + label: 'Eucharistie', + }, ], required: true, - } - ] -} \ No newline at end of file + }, + ], +} diff --git a/src/collections/Worship.ts b/src/collections/Worship.ts index 90d26ec..c85d89f 100644 --- a/src/collections/Worship.ts +++ b/src/collections/Worship.ts @@ -1,86 +1,86 @@ import { CollectionConfig } from 'payload' export const Worship: CollectionConfig = { - slug: 'worship', - labels: { - singular: { - de: 'Gottesdienst', - }, - plural: { - de: 'Gottesdienst', - } + slug: 'worship', + labels: { + singular: { + de: 'Gottesdienst', }, - fields: [ + plural: { + de: 'Gottesdienst', + }, + }, + fields: [ + { + name: 'date', + label: { + de: 'Datum', + }, + type: 'date', + required: true, + admin: { + date: { + pickerAppearance: 'dayAndTime', + }, + }, + }, + { + name: 'location', + label: { + de: 'Location', + }, + type: 'relationship', + relationTo: 'church', + required: true, + }, + { + name: 'type', + label: { + de: 'Categorie', + }, + type: 'radio', + options: [ { - name: 'date', - label: { - de: 'Datum' - }, - type: 'date', - required: true, - admin: { - date: { - pickerAppearance: 'dayAndTime' - } - } + label: 'Heilige Messe', + value: 'MASS', }, { - name: 'location', - label: { - de: 'Location' - }, - type: "relationship", - relationTo: 'church', - required: true, + label: 'Familien Messe', + value: 'FAMILY', }, { - name: 'type', - label: { - de: 'Categorie' - }, - type: 'radio', - options: [ - { - label: 'Heilige Messe', - value: "MASS" - }, - { - label: 'Familien Messe', - value: "FAMILY" - }, - { - label: "Wort-Gottes-Feier", - value: "WORD" - } - ], - required: true, + label: 'Wort-Gottes-Feier', + value: 'WORD', }, - { - name: 'cancelled', - type: 'checkbox', - required: true, - defaultValue: false, - label: { - de: 'Abgesagt' - } - }, - { - name: 'title', - type: 'text', - required: false, - label: { - de: 'Liturgischer Tag' - } - }, - { - name: 'description', - type: 'textarea', - label: { - de: 'Hinweise' - } - }, - ], - access: { - read: () => true - } -} \ No newline at end of file + ], + required: true, + }, + { + name: 'cancelled', + type: 'checkbox', + required: true, + defaultValue: false, + label: { + de: 'Abgesagt', + }, + }, + { + name: 'title', + type: 'text', + required: false, + label: { + de: 'Liturgischer Tag', + }, + }, + { + name: 'description', + type: 'textarea', + label: { + de: 'Hinweise', + }, + }, + ], + access: { + read: () => true, + }, +} diff --git a/src/components/BannerText/BannerText.stories.ts b/src/components/BannerText/BannerText.stories.ts index 553ebae..038f40a 100644 --- a/src/components/BannerText/BannerText.stories.ts +++ b/src/components/BannerText/BannerText.stories.ts @@ -1,13 +1,13 @@ -import type {Meta, StoryObj} from "@storybook/react"; -import {BannerText} from "./BannerText"; +import type { Meta, StoryObj } from '@storybook/react' +import { BannerText } from './BannerText' const meta: Meta = { - component: BannerText + component: BannerText, } -type Story = StoryObj; -export default meta; +type Story = StoryObj +export default meta export const Default: Story = { - args: {} -} \ No newline at end of file + args: {}, +} diff --git a/src/components/BannerText/BannerText.tsx b/src/components/BannerText/BannerText.tsx index e81790a..943f708 100644 --- a/src/components/BannerText/BannerText.tsx +++ b/src/components/BannerText/BannerText.tsx @@ -1,18 +1,18 @@ -import styles from "./bannerText.module.css" -import {faustina, lato} from "@/app/fonts"; +import styles from './bannerText.module.css' +import { faustina, lato } from '@/app/fonts' export const BannerText = () => { - return ( -
-
KATHOLISCHE
-
- PFARREI
- HEILIGE
- DREI KÖNIGE
-
-
- Berlin Nord-Neukölln -
-
- ) -} \ No newline at end of file + return ( +
+
KATHOLISCHE
+
+ PFARREI
+ HEILIGE
+ DREI KÖNIGE
+
+
+ Berlin Nord-Neukölln +
+
+ ) +} diff --git a/src/components/BannerText/bannerText.module.css b/src/components/BannerText/bannerText.module.css index 31ec32a..9535f09 100644 --- a/src/components/BannerText/bannerText.module.css +++ b/src/components/BannerText/bannerText.module.css @@ -1,42 +1,42 @@ .catholic { - font-weight: 600; - font-size: 35px; - position: relative; - bottom: -15px; - left: 10px; + font-weight: 600; + font-size: 35px; + position: relative; + bottom: -15px; + left: 10px; } .container { - position: absolute; - bottom: 100px; + position: absolute; + bottom: 100px; } .name { - font-weight: 600; - font-size: 120px; - line-height: 105px; - padding: 20px 0; + font-weight: 600; + font-size: 120px; + line-height: 105px; + padding: 20px 0; } .berlin { - position: relative; - left: 10px; + position: relative; + left: 10px; } @media screen and (max-width: 420px) { - .name { - font-size: 42px; - line-height: 42px; - padding: 5px 0; - } + .name { + font-size: 42px; + line-height: 42px; + padding: 5px 0; + } - .catholic { - font-size: 18px; - bottom: 0; - left: 0; - } + .catholic { + font-size: 18px; + bottom: 0; + left: 0; + } - .berlin { - left: 0; - } -} \ No newline at end of file + .berlin { + left: 0; + } +} diff --git a/src/components/Card/Card.stories.tsx b/src/components/Card/Card.stories.tsx index 1272da4..561980f 100644 --- a/src/components/Card/Card.stories.tsx +++ b/src/components/Card/Card.stories.tsx @@ -5,11 +5,11 @@ const meta: Meta = { component: Card, } -type Story = StoryObj; +type Story = StoryObj export default meta export const Default: Story = { args: { - children: <>Some content + children: <>Some content, }, -} \ No newline at end of file +} diff --git a/src/components/Card/Card.tsx b/src/components/Card/Card.tsx index 7ec29c2..c4a77ae 100644 --- a/src/components/Card/Card.tsx +++ b/src/components/Card/Card.tsx @@ -1,13 +1,9 @@ -import styles from "./styles.module.css"; +import styles from './styles.module.css' type CardProps = { - children?: JSX.Element | JSX.Element[]; + children?: JSX.Element | JSX.Element[] } -export const Card = ({children}: CardProps) => { - return ( -
- {children} -
- ) -} \ No newline at end of file +export const Card = ({ children }: CardProps) => { + return
{children}
+} diff --git a/src/components/Card/styles.module.css b/src/components/Card/styles.module.css index 53ca0ac..14210ff 100644 --- a/src/components/Card/styles.module.css +++ b/src/components/Card/styles.module.css @@ -1,6 +1,6 @@ .card { - height: 260px; - width: 235px; - box-shadow: 0 0 11px 0 rgba(79,66,79,0.26); - background-color: #ffffff; -} \ No newline at end of file + height: 260px; + width: 235px; + box-shadow: 0 0 11px 0 rgba(79, 66, 79, 0.26); + background-color: #ffffff; +} diff --git a/src/components/Container/Container.stories.tsx b/src/components/Container/Container.stories.tsx index ae90fb2..5039e38 100644 --- a/src/components/Container/Container.stories.tsx +++ b/src/components/Container/Container.stories.tsx @@ -1,22 +1,22 @@ -import {Meta, StoryObj} from "@storybook/react"; -import { Container } from "./Container"; +import { Meta, StoryObj } from '@storybook/react' +import { Container } from './Container' const meta: Meta = { - component: Container + component: Container, } -type Story = StoryObj; -export default meta; +type Story = StoryObj +export default meta export const Default: Story = { args: { - children: <>Some content - } + children: <>Some content, + }, } export const Yellow: Story = { args: { - background: "yellow", - children: <>Some content - } -} \ No newline at end of file + background: 'yellow', + children: <>Some content, + }, +} diff --git a/src/components/Container/Container.tsx b/src/components/Container/Container.tsx index a2a0ac8..bef523a 100644 --- a/src/components/Container/Container.tsx +++ b/src/components/Container/Container.tsx @@ -1,17 +1,15 @@ -import styles from "./styles.module.css" +import styles from './styles.module.css' import classNames from 'classnames' type ContainerProps = { - background?: "yellow" + background?: 'yellow' children: JSX.Element | JSX.Element[] } -export const Container = ({children, background}: ContainerProps) => { +export const Container = ({ children, background }: ContainerProps) => { return ( -
-
- {children} -
+
+
{children}
) -} \ No newline at end of file +} diff --git a/src/components/Container/styles.module.css b/src/components/Container/styles.module.css index c27b66c..ea69582 100644 --- a/src/components/Container/styles.module.css +++ b/src/components/Container/styles.module.css @@ -1,11 +1,15 @@ .container { - width: 800px; - margin: 0 auto; + width: 800px; + margin: 0 auto; } .yellow { - background: rgb(255,255,97); - background: linear-gradient(180deg, rgba(255,255,97,0.0) 0%, rgb(255 250 163) 20%); - position: relative; - top: -70px; -} \ No newline at end of file + background: rgb(255, 255, 97); + background: linear-gradient( + 180deg, + rgba(255, 255, 97, 0) 0%, + rgb(255 250 163) 20% + ); + position: relative; + top: -70px; +} diff --git a/src/components/HomeBanner/HomeBanner.css b/src/components/HomeBanner/HomeBanner.css index 7b13414..ca7aa26 100644 --- a/src/components/HomeBanner/HomeBanner.css +++ b/src/components/HomeBanner/HomeBanner.css @@ -1,19 +1,19 @@ .splash-bg { - background-color: #8d5fd3; + background-color: #8d5fd3; } .splash { - height: 80vh; - background: url("bg.svg") center center; - background-size: cover; - color: #FFFFFF; - padding: 20px; - position: relative; + height: 80vh; + background: url('bg.svg') center center; + background-size: cover; + color: #ffffff; + padding: 20px; + position: relative; } .stars { - position: absolute; - top: 0; - left: 0; - z-index: 0; -} \ No newline at end of file + position: absolute; + top: 0; + left: 0; + z-index: 0; +} diff --git a/src/components/HomeBanner/HomeBanner.stories.ts b/src/components/HomeBanner/HomeBanner.stories.ts index 29d1c9f..2968071 100644 --- a/src/components/HomeBanner/HomeBanner.stories.ts +++ b/src/components/HomeBanner/HomeBanner.stories.ts @@ -1,15 +1,15 @@ -import type { Meta, StoryObj} from '@storybook/react'; -import {HomeBanner} from "@/components/HomeBanner/HomeBanner"; +import type { Meta, StoryObj } from '@storybook/react' +import { HomeBanner } from '@/components/HomeBanner/HomeBanner' const meta: Meta = { - component: HomeBanner, + component: HomeBanner, } -type Story = StoryObj; -export default meta; +type Story = StoryObj +export default meta export const Default: Story = { - args: { - stars: 50 - } -} \ No newline at end of file + args: { + stars: 50, + }, +} diff --git a/src/components/HomeBanner/HomeBanner.tsx b/src/components/HomeBanner/HomeBanner.tsx index 48ef7cd..3c1d0ab 100644 --- a/src/components/HomeBanner/HomeBanner.tsx +++ b/src/components/HomeBanner/HomeBanner.tsx @@ -1,72 +1,82 @@ -import React, {forwardRef, useCallback, useEffect, useImperativeHandle, useRef} from "react"; -import "./HomeBanner.css" +import React, { + forwardRef, + useCallback, + useEffect, + useImperativeHandle, + useRef, +} from 'react' +import './HomeBanner.css' type HomeBannerProps = { - children?: React.ReactNode, - stars: number + children?: React.ReactNode + stars: number } export type HomeBannerHandle = { - newStar: () => void; + newStar: () => void } -export const HomeBanner = forwardRef(function HomeBanner({children, stars}: HomeBannerProps, ref) { - const canvasRef = useRef(null); +export const HomeBanner = forwardRef( + function HomeBanner({ children, stars }: HomeBannerProps, ref) { + const canvasRef = useRef(null) - const drawStarAtPosition = useCallback((ctx: CanvasRenderingContext2D, x: number, y: number) => { - - let r = 2.5 * Math.random(); + const drawStarAtPosition = useCallback( + (ctx: CanvasRenderingContext2D, x: number, y: number) => { + let r = 2.5 * Math.random() //Draw the stars; - ctx.beginPath(); - ctx.fillStyle = "white"; - ctx.arc(x, y, r, 0, Math.PI * 2); - ctx.fill(); - }, []); + ctx.beginPath() + ctx.fillStyle = 'white' + ctx.arc(x, y, r, 0, Math.PI * 2) + ctx.fill() + }, + [], + ) - const drawStar = useCallback((ctx: CanvasRenderingContext2D) => { + const drawStar = useCallback( + (ctx: CanvasRenderingContext2D) => { //Random position and size of stars; - let x = ctx.canvas.width * Math.random(); - let y = ctx.canvas.height * Math.random(); + let x = ctx.canvas.width * Math.random() + let y = ctx.canvas.height * Math.random() - drawStarAtPosition(ctx, x, y); - }, [drawStarAtPosition]); + drawStarAtPosition(ctx, x, y) + }, + [drawStarAtPosition], + ) useImperativeHandle(ref, () => { - return { - newStar() { - const context = canvasRef.current?.getContext("2d") - if (context) { - drawStar(context) - } - } - } - }, [drawStar]); - + return { + newStar() { + const context = canvasRef.current?.getContext('2d') + if (context) { + drawStar(context) + } + }, + } + }, [drawStar]) useEffect(() => { - if (canvasRef.current) { - canvasRef.current.width = window.innerWidth; - canvasRef.current.height = 0.8 * window.innerHeight; - } - const context = canvasRef.current?.getContext("2d"); - if(context) { - for (let i = 0; i < stars; i++) { - //Glow effect; - context.shadowBlur = 10; - context.shadowColor = "white"; + if (canvasRef.current) { + canvasRef.current.width = window.innerWidth + canvasRef.current.height = 0.8 * window.innerHeight + } + const context = canvasRef.current?.getContext('2d') + if (context) { + for (let i = 0; i < stars; i++) { + //Glow effect; + context.shadowBlur = 10 + context.shadowColor = 'white' - drawStar(context) - } + drawStar(context) } - }, [drawStar, stars]); + } + }, [drawStar, stars]) return ( -
- -
- {children} -
-
+
+ +
{children}
+
) -}); \ No newline at end of file + }, +) diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index 464576f..745b8e6 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -1,38 +1,35 @@ -"use client" +'use client' import { useEffect, useRef, useState } from 'react' import mapboxgl from 'mapbox-gl' -import styles from "./styles.module.css" +import styles from './styles.module.css' import 'mapbox-gl/dist/mapbox-gl.css' // todo: as env variable -mapboxgl.accessToken ='pk.eyJ1IjoiYnRpZWxlbiIsImEiOiJjbHpzNmNoNjAxdmxqMmpzaWtxOGsxNnY2In0.4XrA_ZlvlmKZ7MG_tLo-mQ' +mapboxgl.accessToken = + 'pk.eyJ1IjoiYnRpZWxlbiIsImEiOiJjbHpzNmNoNjAxdmxqMmpzaWtxOGsxNnY2In0.4XrA_ZlvlmKZ7MG_tLo-mQ' export const LocationMap = () => { - const mapContainer = useRef(null); - const map = useRef(null); - const [lng, setLng] = useState(13.436093); - const [lat, setLat] = useState(52.477608); - const [zoom, setZoom] = useState(15.42); + const mapContainer = useRef(null) + const map = useRef(null) + const [lng, setLng] = useState(13.436093) + const [lat, setLat] = useState(52.477608) + const [zoom, setZoom] = useState(15.42) useEffect(() => { - if (map.current) return; // initialize map only once + if (map.current) return // initialize map only once - if(mapContainer.current) { + if (mapContainer.current) { map.current = new mapboxgl.Map({ container: mapContainer.current, - logoPosition: "top-left", + logoPosition: 'top-left', attributionControl: false, style: 'mapbox://styles/btielen/clzs6etam008801qu6hpn9qbo', center: [lng, lat], zoom: zoom, - }); + }) } + }) - - }); - - return ( -
- ) -} \ No newline at end of file + return
+} diff --git a/src/components/Map/styles.module.css b/src/components/Map/styles.module.css index aec85a6..9504a48 100644 --- a/src/components/Map/styles.module.css +++ b/src/components/Map/styles.module.css @@ -1,3 +1,3 @@ .map { - height: 300px; -} \ No newline at end of file + height: 300px; +} diff --git a/src/components/MassTable/MassTable.stories.ts b/src/components/MassTable/MassTable.stories.ts index ce25e38..a8b3346 100644 --- a/src/components/MassTable/MassTable.stories.ts +++ b/src/components/MassTable/MassTable.stories.ts @@ -1,41 +1,41 @@ -import { Meta, StoryObj } from '@storybook/react'; -import { MassTable } from './MassTable'; +import { Meta, StoryObj } from '@storybook/react' +import { MassTable } from './MassTable' const meta: Meta = { - component: MassTable, -}; + component: MassTable, +} -export default meta; -type Story = StoryObj; +export default meta +type Story = StoryObj export const Default: Story = { - args: { - date: "2024-08-04", - masses: [ - { - id: "1", - date: "10:00", - locationName: "St. Christopherus", - type: null - }, - { - id: "1", - date: "11:00", - locationName: "St. Richard", - type: "FAMILY" - }, - { - id: "1", - date: "11:00", - locationName: "St. Clara", - type: "WORD" - }, - { - id: "1", - date: "19:00", - locationName: "St. Clara", - type: null - } - ] - } -} \ No newline at end of file + args: { + date: '2024-08-04', + masses: [ + { + id: '1', + date: '10:00', + locationName: 'St. Christopherus', + type: null, + }, + { + id: '1', + date: '11:00', + locationName: 'St. Richard', + type: 'FAMILY', + }, + { + id: '1', + date: '11:00', + locationName: 'St. Clara', + type: 'WORD', + }, + { + id: '1', + date: '19:00', + locationName: 'St. Clara', + type: null, + }, + ], + }, +} diff --git a/src/components/MassTable/MassTable.tsx b/src/components/MassTable/MassTable.tsx index babf393..8dba21a 100644 --- a/src/components/MassTable/MassTable.tsx +++ b/src/components/MassTable/MassTable.tsx @@ -1,33 +1,40 @@ -import {MassTableRow} from "@/components/MassTable/MassTableRow"; -import {useMemo} from "react"; -import styles from "./styles.module.css" -import {faustina} from "@/app/fonts"; +import { MassTableRow } from '@/components/MassTable/MassTableRow' +import { useMemo } from 'react' +import styles from './styles.module.css' +import { faustina } from '@/app/fonts' import { Worship } from '@/payload-types' import { useCompactDate } from '@/hooks/useCompactDate' type MassTableProps = { - date: string, - masses: Worship[] + date: string + masses: Worship[] } -export const MassTable = ({date, masses}: MassTableProps) => { - let dateObj = useMemo(() => new Date(date), [date]); - let compactDate = useCompactDate(date); +export const MassTable = ({ date, masses }: MassTableProps) => { + let dateObj = useMemo(() => new Date(date), [date]) + let compactDate = useCompactDate(date) - return ( -
-

{dateObj.toLocaleDateString("de-DE", {weekday: 'long'})} {compactDate}

+ return ( +
+

+ {dateObj.toLocaleDateString('de-DE', { weekday: 'long' })}{' '} + {compactDate} +

- { masses.map(mass => - - )} -
- ) -} \ No newline at end of file + {masses.map((mass) => ( + + ))} +
+ ) +} diff --git a/src/components/MassTable/MassTableRow.stories.ts b/src/components/MassTable/MassTableRow.stories.ts index ec84d10..4ed7dba 100644 --- a/src/components/MassTable/MassTableRow.stories.ts +++ b/src/components/MassTable/MassTableRow.stories.ts @@ -1,49 +1,49 @@ -import { Meta, StoryObj } from '@storybook/react'; -import { MassTableRow } from './MassTableRow'; +import { Meta, StoryObj } from '@storybook/react' +import { MassTableRow } from './MassTableRow' const meta: Meta = { - component: MassTableRow, -}; + component: MassTableRow, +} -export default meta; -type Story = StoryObj; +export default meta +type Story = StoryObj export const Default: Story = { - args: { - id: "1", - locationName: "St. Clara", - date: "2024-08-23T15:00:00.000Z", - type: 'MASS', - cancelled: false, - } + args: { + id: '1', + locationName: 'St. Clara', + date: '2024-08-23T15:00:00.000Z', + type: 'MASS', + cancelled: false, + }, } export const FamilyMass: Story = { - args: { - id: "1", - locationName: "St. Christopherus", - date: "2024-08-23T15:00:00.000Z", - type: "FAMILY", - cancelled: false, - } + args: { + id: '1', + locationName: 'St. Christopherus', + date: '2024-08-23T15:00:00.000Z', + type: 'FAMILY', + cancelled: false, + }, } export const LiturgyOfTheWord: Story = { - args: { - id: "1", - locationName: "St. Richard", - date: "2024-08-23T15:00:00.000Z", - type: "WORD", - cancelled: false, - } + args: { + id: '1', + locationName: 'St. Richard', + date: '2024-08-23T15:00:00.000Z', + type: 'WORD', + cancelled: false, + }, } export const Cancelled: Story = { - args: { - id: "1", - locationName: "St. Richard", - date: "2024-08-23T15:00:00.000Z", - type: "WORD", - cancelled: true, - } -} \ No newline at end of file + args: { + id: '1', + locationName: 'St. Richard', + date: '2024-08-23T15:00:00.000Z', + type: 'WORD', + cancelled: true, + }, +} diff --git a/src/components/MassTable/MassTableRow.tsx b/src/components/MassTable/MassTableRow.tsx index 4caccd8..4184f84 100644 --- a/src/components/MassTable/MassTableRow.tsx +++ b/src/components/MassTable/MassTableRow.tsx @@ -1,49 +1,54 @@ -"use client" +'use client' -import styles from "./styles.module.css" -import Image from "next/image"; -import family from "./family.svg" -import bible from "./bible.svg" -import {useState} from "react"; +import styles from './styles.module.css' +import Image from 'next/image' +import family from './family.svg' +import bible from './bible.svg' +import { useState } from 'react' import Link from 'next/link' import classNames from 'classnames' import { useTime } from '@/hooks/useTime' export type MassTableRowProps = { - id: string, - locationName: string, - date: string, - type: 'MASS' | 'FAMILY' | 'WORD', - cancelled: boolean + id: string + locationName: string + date: string + type: 'MASS' | 'FAMILY' | 'WORD' + cancelled: boolean } -export const MassTableRow = ({id, locationName, date, type, cancelled}: MassTableRowProps) => { - const [symbol, setSymbol] = useState("-"); - const time = useTime(date); - return ( - -
setSymbol("†")} - onMouseLeave={() => setSymbol("-")} - > -
{time}
-
- {symbol} -
-
- {locationName} -
-
- { type === "FAMILY" && - {"Familien - } +export const MassTableRow = ({ + id, + locationName, + date, + type, + cancelled, +}: MassTableRowProps) => { + const [symbol, setSymbol] = useState('-') + const time = useTime(date) + return ( + +
setSymbol('†')} + onMouseLeave={() => setSymbol('-')} + > +
{time}
+
{symbol}
+
{locationName}
+
+ {type === 'FAMILY' && ( + {'Familien + )} - { type === "WORD" && - {"Wortgottesfeier"} - } -
+ {type === 'WORD' && ( + {'Wortgottesfeier'} + )}
- - ) -} \ No newline at end of file +
+ + ) +} diff --git a/src/components/MassTable/styles.module.css b/src/components/MassTable/styles.module.css index 414fe1f..153bdba 100644 --- a/src/components/MassTable/styles.module.css +++ b/src/components/MassTable/styles.module.css @@ -1,28 +1,28 @@ .row { - display: flex; - gap: 10px; - height: 24px; - cursor: pointer; + display: flex; + gap: 10px; + height: 24px; + cursor: pointer; } .link { - text-decoration: none; - color: inherit; + text-decoration: none; + color: inherit; } .cancelled { - text-decoration: line-through; + text-decoration: line-through; } .symbol { - width: 14px; - text-align: center; + width: 14px; + text-align: center; } .time { - width: 40px; + width: 40px; } .table { - width: 300px; -} \ No newline at end of file + width: 300px; +} diff --git a/src/components/MassTimer/MassTimer.stories.ts b/src/components/MassTimer/MassTimer.stories.ts index c712d61..c828099 100644 --- a/src/components/MassTimer/MassTimer.stories.ts +++ b/src/components/MassTimer/MassTimer.stories.ts @@ -1,25 +1,24 @@ -import type { Meta, StoryObj} from '@storybook/react'; -import { MassTimer } from './MassTimer'; -import {fn} from "@storybook/test"; +import type { Meta, StoryObj } from '@storybook/react' +import { MassTimer } from './MassTimer' +import { fn } from '@storybook/test' const meta: Meta = { - component: MassTimer -}; + component: MassTimer, +} -type Story = StoryObj; +type Story = StoryObj export default meta - export const OneDay: Story = { - args: { - timeout: new Date().getTime() + 1000 * 60 * 60 * 24, - onStarClick: fn() - } + args: { + timeout: new Date().getTime() + 1000 * 60 * 60 * 24, + onStarClick: fn(), + }, } export const TimeOut: Story = { - args: { - timeout: new Date().getTime(), - onStarClick: fn() - } -} \ No newline at end of file + args: { + timeout: new Date().getTime(), + onStarClick: fn(), + }, +} diff --git a/src/components/MassTimer/MassTimer.tsx b/src/components/MassTimer/MassTimer.tsx index f06aa06..fc4cd2e 100644 --- a/src/components/MassTimer/MassTimer.tsx +++ b/src/components/MassTimer/MassTimer.tsx @@ -1,50 +1,53 @@ -"use client" +'use client' -import {useCountdown} from "@/components/MassTimer/useCountdown"; -import styles from "./masstimer.module.css" -import {useState} from "react"; -import {MassTimerTooltip} from "@/components/MassTimerTooltip/MassTimerTooltip"; +import { useCountdown } from '@/components/MassTimer/useCountdown' +import styles from './masstimer.module.css' +import { useState } from 'react' +import { MassTimerTooltip } from '@/components/MassTimerTooltip/MassTimerTooltip' import { Worship } from '@/payload-types' type MassTimerProps = { - nextMass: Worship + nextMass: Worship - /** - * Optional click handler - */ - onStarClick?: () => void + /** + * Optional click handler + */ + onStarClick?: () => void } -export const MassTimer = ({nextMass, onStarClick}: MassTimerProps) => { +export const MassTimer = ({ nextMass, onStarClick }: MassTimerProps) => { + const [displayTooltip, setDisplayTooltip] = useState(false) + const [days, hours, minutes, seconds] = useCountdown( + new Date(nextMass.date).getTime(), + ) - const [displayTooltip, setDisplayTooltip] = useState(false); - const [days, hours, minutes, seconds] = useCountdown(new Date(nextMass.date).getTime()); + return ( +
+
+ - return ( -
-
- + setDisplayTooltip(true)}> + {days}T {hours}S {minutes}M {seconds}S + +
- setDisplayTooltip(true)}> - {days}T {hours}S {minutes}M {seconds}S - -
- - -
setDisplayTooltip(false)}> - -
-
- ) -} \ No newline at end of file +
setDisplayTooltip(false)} + > + +
+
+ ) +} diff --git a/src/components/MassTimer/masstimer.module.css b/src/components/MassTimer/masstimer.module.css index f1da6d4..4b10be5 100644 --- a/src/components/MassTimer/masstimer.module.css +++ b/src/components/MassTimer/masstimer.module.css @@ -1,19 +1,19 @@ .container { - position: relative; + position: relative; } .starButton { - background: none; - border: none; - margin-right: 5px; + background: none; + border: none; + margin-right: 5px; } .starButton:hover { - cursor: pointer; + cursor: pointer; } .tooltip { - position: absolute; - right: 0; - top: 35px; + position: absolute; + right: 0; + top: 35px; } diff --git a/src/components/MassTimer/useCountdown.ts b/src/components/MassTimer/useCountdown.ts index ed68a05..398c99c 100644 --- a/src/components/MassTimer/useCountdown.ts +++ b/src/components/MassTimer/useCountdown.ts @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react' /** * Countdown until targetDate, @@ -7,36 +7,33 @@ import { useEffect, useState } from 'react'; * */ const useCountdown = (targetDate: number) => { + const [countDown, setCountDown] = useState(targetDate - new Date().getTime()) - const [countDown, setCountDown] = useState( - targetDate - new Date().getTime() - ); + useEffect(() => { + if (countDown > 0) { + setTimeout(() => setCountDown(countDown - 1000), 1000) + } else { + setCountDown(0) + } + }, [countDown]) - useEffect(() => { - if (countDown > 0) { - setTimeout(() => setCountDown(countDown - 1000), 1000); - } else { - setCountDown(0) - } - }, [countDown]); - - return getDaysHoursMinutesAndSeconds(countDown); -}; + return getDaysHoursMinutesAndSeconds(countDown) +} /** * Return an array of four numbers, representing the * numbers days, hours, minutes and seconds */ const getDaysHoursMinutesAndSeconds = (countDown: number) => { - // calculate time left - const days = Math.floor(countDown / (1000 * 60 * 60 * 24)); - const hours = Math.floor( - (countDown % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) - ); - const minutes = Math.floor((countDown % (1000 * 60 * 60)) / (1000 * 60)); - const seconds = Math.floor((countDown % (1000 * 60)) / 1000); + // calculate time left + const days = Math.floor(countDown / (1000 * 60 * 60 * 24)) + const hours = Math.floor( + (countDown % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60), + ) + const minutes = Math.floor((countDown % (1000 * 60 * 60)) / (1000 * 60)) + const seconds = Math.floor((countDown % (1000 * 60)) / 1000) - return [days, hours, minutes, seconds]; -}; + return [days, hours, minutes, seconds] +} -export { useCountdown }; \ No newline at end of file +export { useCountdown } diff --git a/src/components/MassTimerTooltip/MassTimerTooltip.stories.ts b/src/components/MassTimerTooltip/MassTimerTooltip.stories.ts index d952d5e..f38fc66 100644 --- a/src/components/MassTimerTooltip/MassTimerTooltip.stories.ts +++ b/src/components/MassTimerTooltip/MassTimerTooltip.stories.ts @@ -1,15 +1,13 @@ -import type { Meta, StoryObj} from "@storybook/react"; -import {MassTimerTooltip} from "./MassTimerTooltip"; +import type { Meta, StoryObj } from '@storybook/react' +import { MassTimerTooltip } from './MassTimerTooltip' const meta: Meta = { - component: MassTimerTooltip + component: MassTimerTooltip, } -type Story = StoryObj; -export default meta; +type Story = StoryObj +export default meta export const Default: Story = { - args: { - - } -} \ No newline at end of file + args: {}, +} diff --git a/src/components/MassTimerTooltip/MassTimerTooltip.tsx b/src/components/MassTimerTooltip/MassTimerTooltip.tsx index e1d3f45..b8643af 100644 --- a/src/components/MassTimerTooltip/MassTimerTooltip.tsx +++ b/src/components/MassTimerTooltip/MassTimerTooltip.tsx @@ -1,6 +1,6 @@ -import styles from "./massTimerTooltip.module.css"; -import clara from "./clara.svg" -import Image from "next/image"; +import styles from './massTimerTooltip.module.css' +import clara from './clara.svg' +import Image from 'next/image' import { Worship } from '@/payload-types' import { useTime } from '@/hooks/useTime' import { useLocationName } from '@/hooks/useLocationName' @@ -10,22 +10,20 @@ type MassTimerTooltipProps = { nextMass: Worship } -export const MassTimerTooltip = ({nextMass}: MassTimerTooltipProps) => { - - const time = useTime(nextMass.date); - const location = useLocationName(nextMass.location); - const date = useCompactDate(nextMass.date); +export const MassTimerTooltip = ({ nextMass }: MassTimerTooltipProps) => { + const time = useTime(nextMass.date) + const location = useLocationName(nextMass.location) + const date = useCompactDate(nextMass.date) return ( -
-
- {""}/ -
+
+
+ {''} +
-
- Die nächste Messe is am {date} um {time} Uhr in {location}. -
-
- ) +
+ Die nächste Messe is am {date} um {time} Uhr in {location}. +
+
+ ) } diff --git a/src/components/MassTimerTooltip/massTimerTooltip.module.css b/src/components/MassTimerTooltip/massTimerTooltip.module.css index 59ba4f5..fa89f78 100644 --- a/src/components/MassTimerTooltip/massTimerTooltip.module.css +++ b/src/components/MassTimerTooltip/massTimerTooltip.module.css @@ -1,28 +1,32 @@ .tooltip { - width: 300px; - padding: 20px; - color: #4d4d4d; - background: rgb(244,244,244); - background: linear-gradient(40deg, rgba(244,244,244,1) 0%, rgba(228,228,228,1) 100%); - border: solid 1px #dddddd; - border-radius: 6px; - display: flex; - gap: 20px; - align-items: center; + width: 300px; + padding: 20px; + color: #4d4d4d; + background: rgb(244, 244, 244); + background: linear-gradient( + 40deg, + rgba(244, 244, 244, 1) 0%, + rgba(228, 228, 228, 1) 100% + ); + border: solid 1px #dddddd; + border-radius: 6px; + display: flex; + gap: 20px; + align-items: center; } .church { - width: 75px; - height: 75px; - border-radius: 50%; - flex-shrink: 0; - background-color: #f6f6f6; - border: solid 2px #c2c2c2; - transition: background-color 200ms ease-in; - overflow: clip; + width: 75px; + height: 75px; + border-radius: 50%; + flex-shrink: 0; + background-color: #f6f6f6; + border: solid 2px #c2c2c2; + transition: background-color 200ms ease-in; + overflow: clip; } .church:hover { - cursor: pointer; - background-color: #fff318; -} \ No newline at end of file + cursor: pointer; + background-color: #fff318; +} diff --git a/src/components/MassTitle/MassTitle.stories.tsx b/src/components/MassTitle/MassTitle.stories.tsx index 6ea623a..cc29b3d 100644 --- a/src/components/MassTitle/MassTitle.stories.tsx +++ b/src/components/MassTitle/MassTitle.stories.tsx @@ -5,19 +5,19 @@ const meta: Meta = { component: MassTitle, } -type Story = StoryObj; +type Story = StoryObj export default meta export const Default: Story = { args: { title: 'Mittwoch der 19. Woche im Jahreskreis', - cancelled: false + cancelled: false, }, } export const Cancelled: Story = { args: { title: 'Mittwoch der 19. Woche im Jahreskreis', - cancelled: true + cancelled: true, }, -} \ No newline at end of file +} diff --git a/src/components/MassTitle/MassTitle.tsx b/src/components/MassTitle/MassTitle.tsx index 2b0553e..4a77c3c 100644 --- a/src/components/MassTitle/MassTitle.tsx +++ b/src/components/MassTitle/MassTitle.tsx @@ -1,18 +1,26 @@ import classNames from 'classnames' import { faustina } from '@/app/fonts' -import styles from "./styles.module.css" +import styles from './styles.module.css' import { Pill } from '@/components/Pill/Pill' type MassTitleProps = { - title: string, + title: string cancelled: boolean } -export const MassTitle = ({title, cancelled}: MassTitleProps) => { +export const MassTitle = ({ title, cancelled }: MassTitleProps) => { return (
-
Gottesdienst { cancelled && ABGESAGT }
-

{title}

+
+ Gottesdienst {cancelled && ABGESAGT} +
+

+ {title} +

) -} \ No newline at end of file +} diff --git a/src/components/MassTitle/styles.module.css b/src/components/MassTitle/styles.module.css index 822bc93..a32b3f3 100644 --- a/src/components/MassTitle/styles.module.css +++ b/src/components/MassTitle/styles.module.css @@ -1,14 +1,14 @@ .title { - font-size: 48px; - font-weight: 700; - margin-block-start: 0; + font-size: 48px; + font-weight: 700; + margin-block-start: 0; } .mass { - font-size: 16px; - font-weight: 700; + font-size: 16px; + font-weight: 700; } .cancelled { - text-decoration: line-through; -} \ No newline at end of file + text-decoration: line-through; +} diff --git a/src/components/Menu/Menu.stories.ts b/src/components/Menu/Menu.stories.ts index e6c71f1..af3bf4b 100644 --- a/src/components/Menu/Menu.stories.ts +++ b/src/components/Menu/Menu.stories.ts @@ -1,15 +1,13 @@ -import {Meta, StoryObj} from "@storybook/react"; -import { Menu } from "./Menu"; +import { Meta, StoryObj } from '@storybook/react' +import { Menu } from './Menu' const meta: Meta = { - component: Menu + component: Menu, } -type Story = StoryObj; -export default meta; +type Story = StoryObj +export default meta export const Default: Story = { - args: { - - } -} \ No newline at end of file + args: {}, +} diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 829cad9..1efe5de 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -1,41 +1,51 @@ -import {MassTimer} from "@/components/MassTimer/MassTimer"; -import styles from "./styles.module.css" -import MenuIcon from "./menu.svg" -import Image from "next/image"; +import { MassTimer } from '@/components/MassTimer/MassTimer' +import styles from './styles.module.css' +import MenuIcon from './menu.svg' +import Image from 'next/image' import { Worship } from '@/payload-types' import { MenuBaseLayer } from '@/components/MenuBaseLayer/MenuBaseLayer' type MenuProps = { - starClick?: () => void - nextMass?: Worship, + starClick?: () => void + nextMass?: Worship } export const Menu = (props: MenuProps) => { return ( -
+ + ) +} diff --git a/src/components/Menu/styles.module.css b/src/components/Menu/styles.module.css index 291412c..f9096c1 100644 --- a/src/components/Menu/styles.module.css +++ b/src/components/Menu/styles.module.css @@ -1,63 +1,62 @@ .nav { - display: flex; - align-items: baseline; - gap: 20px; - color: #3d3d3d; - padding-top: 15px; - height: 50px; - border-bottom: 1px solid rgba(217, 217, 217, 0.19); + display: flex; + align-items: baseline; + gap: 20px; + color: #3d3d3d; + padding-top: 15px; + height: 50px; + border-bottom: 1px solid rgba(217, 217, 217, 0.19); } .navMobile { - display: none; + display: none; } .itemsLeft { - display: flex; - gap: 20px; + display: flex; + gap: 20px; } .menuLink { - color: inherit; - text-decoration: none; - font-weight: 600; - transition: opacity 100ms ease-in; + color: inherit; + text-decoration: none; + font-weight: 600; + transition: opacity 100ms ease-in; } .menuLink:hover { - opacity: 0.7; + opacity: 0.7; } .itemsRight { - margin-left: auto; - display: flex; - gap: 20px; - justify-content: flex-end; - align-items: baseline; + margin-left: auto; + display: flex; + gap: 20px; + justify-content: flex-end; + align-items: baseline; } .button { - padding: 10px; - border-radius: 10px; - border: none; - background-color: #eeeeee; - transition: background-color 0.1s ease-in-out; - font-family: inherit; - font-weight: 600; + padding: 10px; + border-radius: 10px; + border: none; + background-color: #eeeeee; + transition: background-color 0.1s ease-in-out; + font-family: inherit; + font-weight: 600; } .button:hover { - background-color: #fff318; - cursor: pointer; + background-color: #fff318; + cursor: pointer; } @media screen and (max-width: 800px) { + .navMobile { + display: block; + } - .navMobile { - display: block; - } - - .itemsLeft { - display: none; - } -} \ No newline at end of file + .itemsLeft { + display: none; + } +} diff --git a/src/components/MenuBaseLayer/MenuBaseLayer.stories.tsx b/src/components/MenuBaseLayer/MenuBaseLayer.stories.tsx index ae955b6..6bfeff1 100644 --- a/src/components/MenuBaseLayer/MenuBaseLayer.stories.tsx +++ b/src/components/MenuBaseLayer/MenuBaseLayer.stories.tsx @@ -1,15 +1,13 @@ -import {Meta, StoryObj} from "@storybook/react"; +import { Meta, StoryObj } from '@storybook/react' import { MenuBaseLayer } from '@/components/MenuBaseLayer/MenuBaseLayer' const meta: Meta = { - component: MenuBaseLayer + component: MenuBaseLayer, } -type Story = StoryObj; -export default meta; +type Story = StoryObj +export default meta export const Default: Story = { - args: { - - } -} \ No newline at end of file + args: {}, +} diff --git a/src/components/MenuBaseLayer/MenuBaseLayer.tsx b/src/components/MenuBaseLayer/MenuBaseLayer.tsx index d3d782d..d8c02b2 100644 --- a/src/components/MenuBaseLayer/MenuBaseLayer.tsx +++ b/src/components/MenuBaseLayer/MenuBaseLayer.tsx @@ -1,5 +1,5 @@ -import styles from "./style.module.css" +import styles from './style.module.css' export const MenuBaseLayer = () => { return
-} \ No newline at end of file +} diff --git a/src/components/MenuBaseLayer/style.module.css b/src/components/MenuBaseLayer/style.module.css index 8eb254f..3d36c91 100644 --- a/src/components/MenuBaseLayer/style.module.css +++ b/src/components/MenuBaseLayer/style.module.css @@ -1,10 +1,10 @@ .background { - width: 100%; - height: 340px; - background-image: url("./bg.svg"); - background-size: 100% 100%; - position: absolute; - top: 0; - left: 0; - z-index: -1; -} \ No newline at end of file + width: 100%; + height: 340px; + background-image: url('./bg.svg'); + background-size: 100% 100%; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} diff --git a/src/components/Pill/Pill.stories.tsx b/src/components/Pill/Pill.stories.tsx index 3496db0..15ec4e1 100644 --- a/src/components/Pill/Pill.stories.tsx +++ b/src/components/Pill/Pill.stories.tsx @@ -5,11 +5,11 @@ const meta: Meta = { component: Pill, } -type Story = StoryObj; +type Story = StoryObj export default meta export const Default: Story = { args: { - children: "Default" + children: 'Default', }, -} \ No newline at end of file +} diff --git a/src/components/Pill/Pill.tsx b/src/components/Pill/Pill.tsx index 1f3a5fc..466742a 100644 --- a/src/components/Pill/Pill.tsx +++ b/src/components/Pill/Pill.tsx @@ -1,13 +1,9 @@ -import styles from "./styles.module.css" +import styles from './styles.module.css' type PillProps = { children: JSX.Element | string | JSX.Element[] } -export const Pill = ({children}: PillProps) => { - return ( -
- {children} -
- ) -} \ No newline at end of file +export const Pill = ({ children }: PillProps) => { + return
{children}
+} diff --git a/src/components/Pill/styles.module.css b/src/components/Pill/styles.module.css index f33ab70..f4aaf1c 100644 --- a/src/components/Pill/styles.module.css +++ b/src/components/Pill/styles.module.css @@ -1,6 +1,6 @@ .pill { - padding: 8px 12px; - background-color: #c2c2c2; - border-radius: 20px; - display: inline-block; -} \ No newline at end of file + padding: 8px 12px; + background-color: #c2c2c2; + border-radius: 20px; + display: inline-block; +} diff --git a/src/components/Testimony/Testimony.stories.tsx b/src/components/Testimony/Testimony.stories.tsx index 54c6513..c6e0073 100644 --- a/src/components/Testimony/Testimony.stories.tsx +++ b/src/components/Testimony/Testimony.stories.tsx @@ -5,12 +5,13 @@ const meta: Meta = { component: Testimony, } -type Story = StoryObj; +type Story = StoryObj export default meta export const Default: Story = { args: { name: 'Johan Schäfer', - testimony: 'Die Eucharistie ist für mich wie ein spiritueller Boost. Wenn ich die Hostie empfange, fühle ich mich krass verbunden mit Jesus. Es ist wie ein Reminder, dass ich nicht allein bin, egal was abgeht. Dieser Moment gibt mir richtig Power und lässt mich mit einem starken Gefühl von Frieden und Hoffnung rausgehen.' + testimony: + 'Die Eucharistie ist für mich wie ein spiritueller Boost. Wenn ich die Hostie empfange, fühle ich mich krass verbunden mit Jesus. Es ist wie ein Reminder, dass ich nicht allein bin, egal was abgeht. Dieser Moment gibt mir richtig Power und lässt mich mit einem starken Gefühl von Frieden und Hoffnung rausgehen.', }, -} \ No newline at end of file +} diff --git a/src/components/Testimony/Testimony.tsx b/src/components/Testimony/Testimony.tsx index 2ef79a8..8b009ce 100644 --- a/src/components/Testimony/Testimony.tsx +++ b/src/components/Testimony/Testimony.tsx @@ -1,29 +1,25 @@ -import styles from "./styles.module.css"; +import styles from './styles.module.css' import { Container } from '@/components/Container/Container' import classNames from 'classnames' import { faustina } from '@/app/fonts' type TestimonyProps = { - name: string, - testimony: string, + name: string + testimony: string } -export const Testimony = ({name, testimony}: TestimonyProps) => { +export const Testimony = ({ name, testimony }: TestimonyProps) => { return ( - +
-
- -
+

{testimony}

-

- {name} -

+

{name}

) -} \ No newline at end of file +} diff --git a/src/components/Testimony/styles.module.css b/src/components/Testimony/styles.module.css index 39bdce6..767cce1 100644 --- a/src/components/Testimony/styles.module.css +++ b/src/components/Testimony/styles.module.css @@ -1,17 +1,17 @@ .testimony { - display: flex; - padding: 80px 0 50px 0; - gap: 40px; - align-items: center; + display: flex; + padding: 80px 0 50px 0; + gap: 40px; + align-items: center; } .testimonyText { - font-style: italic; + font-style: italic; } .person { - height: 150px; - width: 150px; - background-color: white; - flex-shrink: 0; -} \ No newline at end of file + height: 150px; + width: 150px; + background-color: white; + flex-shrink: 0; +} diff --git a/src/hooks/calendars.ts b/src/hooks/calendars.ts index e7ae6ab..959f43e 100644 --- a/src/hooks/calendars.ts +++ b/src/hooks/calendars.ts @@ -2,11 +2,10 @@ * This data was "hacked" together with the romcal package */ - type LiturgyData = { - name: string; - color: string; -}; + name: string + color: string +} export const calendar: Record = { '2024-01-01': { @@ -29230,4 +29229,3 @@ export const calendar: Record = { color: 'weiß', }, } - \ No newline at end of file diff --git a/src/hooks/useCompactDate.ts b/src/hooks/useCompactDate.ts index 402331b..d421cb4 100644 --- a/src/hooks/useCompactDate.ts +++ b/src/hooks/useCompactDate.ts @@ -10,5 +10,11 @@ export const useCompactDate = (date: string) => { * */ export const useDate = (date: string) => { - return date.substring(8, 10) + '.' + date.substring(5, 7) + '.' + date.substring(0, 4) -} \ No newline at end of file + return ( + date.substring(8, 10) + + '.' + + date.substring(5, 7) + + '.' + + date.substring(0, 4) + ) +} diff --git a/src/hooks/useLiturgyCalendarTitle.ts b/src/hooks/useLiturgyCalendarTitle.ts index 31a4c90..af4d51b 100644 --- a/src/hooks/useLiturgyCalendarTitle.ts +++ b/src/hooks/useLiturgyCalendarTitle.ts @@ -5,6 +5,6 @@ import { calendar } from '@/hooks/calendars' * e.G. "2024-12-25" => Christmas */ export const useLiturgyCalendarTitle = (date: string) => { - const day = calendar[date.substring(0, 10)]; - return day.name; -} \ No newline at end of file + const day = calendar[date.substring(0, 10)] + return day.name +} diff --git a/src/hooks/useLocation.ts b/src/hooks/useLocation.ts index 21b6903..d06962a 100644 --- a/src/hooks/useLocation.ts +++ b/src/hooks/useLocation.ts @@ -1,16 +1,15 @@ -import {Church} from '@/payload-types' +import { Church } from '@/payload-types' -export const useLocation = (location: string | Church) : Church => { - - if(typeof location === 'string') { +export const useLocation = (location: string | Church): Church => { + if (typeof location === 'string') { return { address: '', createdAt: '', name: 'Unknown', updatedAt: '', - id: location + id: location, } } else { return location } -} \ No newline at end of file +} diff --git a/src/hooks/useLocationName.ts b/src/hooks/useLocationName.ts index b495f27..037697f 100644 --- a/src/hooks/useLocationName.ts +++ b/src/hooks/useLocationName.ts @@ -4,9 +4,9 @@ import { Church } from '@/payload-types' * Get user friendly location name */ export const useLocationName = (location: string | Church) => { - if (typeof location == "string") { + if (typeof location == 'string') { return location } else { return location.name } -} \ No newline at end of file +} diff --git a/src/hooks/useMassType.ts b/src/hooks/useMassType.ts index c430d55..33e7b21 100644 --- a/src/hooks/useMassType.ts +++ b/src/hooks/useMassType.ts @@ -1,12 +1,11 @@ -export const useMassType = (type: "MASS" | "FAMILY" | "WORD") => { +export const useMassType = (type: 'MASS' | 'FAMILY' | 'WORD') => { switch (type) { - case "FAMILY": - return "Familien Messe"; - case "WORD": - return "Wort-Gottes-Feier"; + case 'FAMILY': + return 'Familien Messe' + case 'WORD': + return 'Wort-Gottes-Feier' case 'MASS': default: - return "Heilige Messe"; - + return 'Heilige Messe' } -} \ No newline at end of file +} diff --git a/src/hooks/useTime.ts b/src/hooks/useTime.ts index fdc82b0..50cb05a 100644 --- a/src/hooks/useTime.ts +++ b/src/hooks/useTime.ts @@ -2,6 +2,6 @@ * From a UTC datetime, return the time in HH:MM format */ export const useTime = (datetime: string) => { - let date = new Date(datetime); - return date.toLocaleTimeString('de-De', { timeStyle: "short"}); + let date = new Date(datetime) + return date.toLocaleTimeString('de-De', { timeStyle: 'short' }) } diff --git a/src/payload-types.ts b/src/payload-types.ts index f504fe2..1cb53a0 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -8,162 +8,161 @@ export interface Config { auth: { - users: UserAuthOperations; - }; + users: UserAuthOperations + } collections: { - users: User; - media: Media; - worship: Worship; - church: Church; - testimony: Testimony; - 'payload-preferences': PayloadPreference; - 'payload-migrations': PayloadMigration; - }; + users: User + media: Media + worship: Worship + church: Church + testimony: Testimony + 'payload-preferences': PayloadPreference + 'payload-migrations': PayloadMigration + } db: { - defaultIDType: string; - }; - globals: {}; - locale: null; + defaultIDType: string + } + globals: {} + locale: null user: User & { - collection: 'users'; - }; + collection: 'users' + } } export interface UserAuthOperations { forgotPassword: { - email: string; - password: string; - }; + email: string + password: string + } login: { - email: string; - password: string; - }; + email: string + password: string + } registerFirstUser: { - email: string; - password: string; - }; + email: string + password: string + } unlock: { - email: string; - password: string; - }; + email: string + password: string + } } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "users". */ export interface User { - id: string; - updatedAt: string; - createdAt: string; - email: string; - resetPasswordToken?: string | null; - resetPasswordExpiration?: string | null; - salt?: string | null; - hash?: string | null; - loginAttempts?: number | null; - lockUntil?: string | null; - password?: string | null; + id: string + updatedAt: string + createdAt: string + email: string + resetPasswordToken?: string | null + resetPasswordExpiration?: string | null + salt?: string | null + hash?: string | null + loginAttempts?: number | null + lockUntil?: string | null + password?: string | null } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "media". */ export interface Media { - id: string; - alt: string; - updatedAt: string; - createdAt: string; - url?: string | null; - thumbnailURL?: string | null; - filename?: string | null; - mimeType?: string | null; - filesize?: number | null; - width?: number | null; - height?: number | null; - focalX?: number | null; - focalY?: number | null; + id: string + alt: string + updatedAt: string + createdAt: string + url?: string | null + thumbnailURL?: string | null + filename?: string | null + mimeType?: string | null + filesize?: number | null + width?: number | null + height?: number | null + focalX?: number | null + focalY?: number | null } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "worship". */ export interface Worship { - id: string; - date: string; - location: string | Church; - type: 'MASS' | 'FAMILY' | 'WORD'; - cancelled: boolean; - title?: string | null; - description?: string | null; - updatedAt: string; - createdAt: string; + id: string + date: string + location: string | Church + type: 'MASS' | 'FAMILY' | 'WORD' + cancelled: boolean + title?: string | null + description?: string | null + updatedAt: string + createdAt: string } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "church". */ export interface Church { - id: string; - name: string; - address: string; - updatedAt: string; - createdAt: string; + id: string + name: string + address: string + updatedAt: string + createdAt: string } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "testimony". */ export interface Testimony { - id: string; - testimony: string; - name: string; - occupation?: string | null; - category: 'EUCHARIST'; - updatedAt: string; - createdAt: string; + id: string + testimony: string + name: string + occupation?: string | null + category: 'EUCHARIST' + updatedAt: string + createdAt: string } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-preferences". */ export interface PayloadPreference { - id: string; + id: string user: { - relationTo: 'users'; - value: string | User; - }; - key?: string | null; + relationTo: 'users' + value: string | User + } + key?: string | null value?: | { - [k: string]: unknown; + [k: string]: unknown } | unknown[] | string | number | boolean - | null; - updatedAt: string; - createdAt: string; + | null + updatedAt: string + createdAt: string } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-migrations". */ export interface PayloadMigration { - id: string; - name?: string | null; - batch?: number | null; - updatedAt: string; - createdAt: string; + id: string + name?: string | null + batch?: number | null + updatedAt: string + createdAt: string } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "auth". */ export interface Auth { - [k: string]: unknown; + [k: string]: unknown } - declare module 'payload' { export interface GeneratedTypes extends Config {} -} \ No newline at end of file +} diff --git a/src/payload.config.ts b/src/payload.config.ts index 61ce0f1..f66a0a9 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -27,7 +27,7 @@ export default buildConfig({ outputFile: path.resolve(dirname, 'payload-types.ts'), }, i18n: { - supportedLanguages: { de } + supportedLanguages: { de }, }, db: mongooseAdapter({ url: process.env.DATABASE_URI || '', diff --git a/tsconfig.json b/tsconfig.json index c724da8..afb2191 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "baseUrl": ".", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -23,22 +19,11 @@ } ], "paths": { - "@/*": [ - "./src/*" - ], - "@payload-config": [ - "./src/payload.config.ts" - ] + "@/*": ["./src/*"], + "@payload-config": ["./src/payload.config.ts"] }, "target": "ES2017" }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] }