feature: blog
This commit is contained in:
parent
c341825857
commit
0afc27b028
25 changed files with 563 additions and 117 deletions
|
|
@ -1,22 +1,11 @@
|
||||||
import { RscEntryLexicalCell as RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
|
import { RscEntryLexicalCell as RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
|
||||||
import { RscEntryLexicalField as RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
|
import { RscEntryLexicalField as RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
|
||||||
import { InlineToolbarFeatureClient as InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { InlineToolbarFeatureClient as InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { ParagraphFeatureClient as ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { UploadFeatureClient as UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { BlockquoteFeatureClient as BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { RelationshipFeatureClient as RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { LinkFeatureClient as LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { LinkFeatureClient as LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { ChecklistFeatureClient as ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { OrderedListFeatureClient as OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { UnorderedListFeatureClient as UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { UnorderedListFeatureClient as UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { IndentFeatureClient as IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { AlignFeatureClient as AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { AlignFeatureClient as AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { HeadingFeatureClient as HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { HeadingFeatureClient as HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { ParagraphFeatureClient as ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { InlineCodeFeatureClient as InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { SuperscriptFeatureClient as SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { SubscriptFeatureClient as SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { StrikethroughFeatureClient as StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
|
||||||
import { UnderlineFeatureClient as UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { UnderlineFeatureClient as UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { BoldFeatureClient as BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { BoldFeatureClient as BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { ItalicFeatureClient as ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
import { ItalicFeatureClient as ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
|
@ -25,22 +14,11 @@ export const importMap = {
|
||||||
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e,
|
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e,
|
||||||
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalField": RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e,
|
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalField": RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e,
|
||||||
"@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient": HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#UploadFeatureClient": UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#BlockquoteFeatureClient": BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#RelationshipFeatureClient": RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#ChecklistFeatureClient": ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#OrderedListFeatureClient": OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#UnorderedListFeatureClient": UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#UnorderedListFeatureClient": UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#IndentFeatureClient": IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#AlignFeatureClient": AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#AlignFeatureClient": AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#InlineCodeFeatureClient": InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#SuperscriptFeatureClient": SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#SubscriptFeatureClient": SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#StrikethroughFeatureClient": StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
|
||||||
"@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
"@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864
|
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
import { Section } from '@/components/Section/Section'
|
import { Section } from '@/components/Section/Section'
|
||||||
import { Container } from '@/components/Container/Container'
|
import { Container } from '@/components/Container/Container'
|
||||||
import { Title } from '@/components/Title/Title'
|
import { Title } from '@/components/Title/Title'
|
||||||
import { ContentWithSlider } from '@/compositions/ContentWithSlider/ContentWithSlider'
|
|
||||||
import { TextDiv } from '@/components/Text/TextDiv'
|
import { TextDiv } from '@/components/Text/TextDiv'
|
||||||
import { Blog } from '@/payload-types'
|
import { Blog } from '@/payload-types'
|
||||||
import { notFound } from 'next/navigation'
|
import { notFound } from 'next/navigation'
|
||||||
|
import { readableDateTime } from '@/utils/readableDate'
|
||||||
|
import { HR } from '@/components/HorizontalRule/HorizontalRule'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import styles from "./styles.module.scss"
|
||||||
|
import { HTMLText } from '@/components/Text/HTMLText'
|
||||||
|
import { Button } from '@/components/Button/Button'
|
||||||
|
import { ContactSection } from '@/compositions/ContactSection/ContactSection'
|
||||||
|
|
||||||
async function fetchBlog(id: string) {
|
async function fetchBlog(id: string) {
|
||||||
const res = await fetch(`http://localhost:3000/api/blog/${id}`)
|
const res = await fetch(`http://localhost:3000/api/blog/${id}`)
|
||||||
|
|
@ -16,30 +22,67 @@ export default async function BlogPage({ params }: { params: Promise<{id: string
|
||||||
|
|
||||||
const id = (await params).id;
|
const id = (await params).id;
|
||||||
const data = await fetchBlog(id) as Blog;
|
const data = await fetchBlog(id) as Blog;
|
||||||
|
const url = typeof data.photo === 'object' && data.photo?.sizes?.banner?.url;
|
||||||
|
|
||||||
if(!data) {
|
if(!data) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// determine if some margin at the bottom should be added
|
||||||
|
const length = data.content.length;
|
||||||
|
const shouldAddMargin = data.content[length - 1].blockType === "text"
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section>
|
<>
|
||||||
|
<Section paddingBottom={"small"}>
|
||||||
<Container>
|
<Container>
|
||||||
<Title title={data.title}></Title>
|
<Title title={data.title}></Title>
|
||||||
|
<strong><TextDiv text={data.excerpt} /></strong>
|
||||||
|
<p className={styles.published}>
|
||||||
|
Publiziert am {readableDateTime(data.createdAt)}
|
||||||
|
</p>
|
||||||
</Container>
|
</Container>
|
||||||
|
<HR/>
|
||||||
|
<Container>
|
||||||
<div>
|
<div>
|
||||||
{data.content && data.content.map(item => {
|
{ typeof url === "string" &&
|
||||||
if (item.blockType === "ContentWithSlider") {
|
<Image className={styles.image} src={url} width={1100} height={400} alt={""} />
|
||||||
return (
|
}
|
||||||
<ContentWithSlider key={item.id} slider={item.sliderContent}>
|
</div>
|
||||||
<Container position={"right"}>
|
</Container>
|
||||||
<TextDiv text={item.content} />
|
</Section>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{data.content.map(item => {
|
||||||
|
if (item.blockType === "text" && item.content_html) {
|
||||||
|
return (
|
||||||
|
<Container key={item.id}>
|
||||||
|
<HTMLText width={item.width} html={item.content_html} />
|
||||||
</Container>
|
</Container>
|
||||||
</ContentWithSlider>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.blockType === "document" && typeof item.file === "object") {
|
||||||
|
return (
|
||||||
|
<Container key={item.id}>
|
||||||
|
<Section padding={"medium"}>
|
||||||
|
<Button size={"lg"} href={item.file.url || "notfound"}>{item.button}</Button>
|
||||||
|
</Section>
|
||||||
|
</Container>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.blockType === "contactform") {
|
||||||
|
return (
|
||||||
|
<ContactSection key={item.id} title={item.title} description={item.description} />
|
||||||
|
)
|
||||||
|
}
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
|
||||||
|
{ shouldAddMargin &&
|
||||||
|
<Section></Section>
|
||||||
|
}
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
11
src/app/blog/[id]/styles.module.scss
Normal file
11
src/app/blog/[id]/styles.module.scss
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
@import "template.scss";
|
||||||
|
|
||||||
|
.image {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
.published {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
@ -4,8 +4,14 @@ body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
color: #2c2c2c;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mainContent {
|
||||||
|
font-size: 20px;
|
||||||
|
line-height: 147%;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default function RootLayout({
|
||||||
<html lang="en" className={defaultFont.className}>
|
<html lang="en" className={defaultFont.className}>
|
||||||
<body>
|
<body>
|
||||||
<Menu />
|
<Menu />
|
||||||
<main>
|
<main className={"mainContent"}>
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,9 @@
|
||||||
import { Block, CollectionConfig } from 'payload'
|
import { CollectionConfig } from 'payload'
|
||||||
import { isAdminOrEmployee } from '@/collections/access/admin'
|
import { isAdminOrEmployee } from '@/collections/access/admin'
|
||||||
|
import { ParagraphBlock } from '@/collections/blocks/Paragraph'
|
||||||
|
import { DocumentBlock } from '@/collections/blocks/Document'
|
||||||
|
import { ContactformBlock } from '@/collections/blocks/Contactform'
|
||||||
|
|
||||||
const QuoteBlock: Block = {
|
|
||||||
slug: 'Quote',
|
|
||||||
labels: {
|
|
||||||
singular: "Zitat",
|
|
||||||
plural: "Zitaten"
|
|
||||||
},
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
name: 'quoteText',
|
|
||||||
type: 'text',
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
const ContentWithSlider: Block = {
|
|
||||||
slug: 'ContentWithSlider',
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
name: 'sliderContent',
|
|
||||||
type: 'textarea',
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'content',
|
|
||||||
type: 'textarea',
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Blog: CollectionConfig = {
|
export const Blog: CollectionConfig = {
|
||||||
slug: 'blog',
|
slug: 'blog',
|
||||||
|
|
@ -65,16 +38,26 @@ export const Blog: CollectionConfig = {
|
||||||
de: "Gemeinde"
|
de: "Gemeinde"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'excerpt',
|
||||||
|
type: 'textarea',
|
||||||
|
label: {
|
||||||
|
de: 'Auszug'
|
||||||
|
},
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'content',
|
name: 'content',
|
||||||
type: 'blocks',
|
type: 'blocks',
|
||||||
minRows: 1,
|
minRows: 1,
|
||||||
maxRows: 20,
|
maxRows: 20,
|
||||||
blocks: [
|
blocks: [
|
||||||
QuoteBlock,
|
ParagraphBlock,
|
||||||
ContentWithSlider
|
DocumentBlock,
|
||||||
]
|
ContactformBlock
|
||||||
}
|
],
|
||||||
|
required: true
|
||||||
|
},
|
||||||
],
|
],
|
||||||
admin: {
|
admin: {
|
||||||
useAsTitle: 'title'
|
useAsTitle: 'title'
|
||||||
|
|
|
||||||
18
src/collections/Documents.ts
Normal file
18
src/collections/Documents.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import type { CollectionConfig } from 'payload'
|
||||||
|
|
||||||
|
export const Documents: CollectionConfig = {
|
||||||
|
slug: 'documents',
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'name',
|
||||||
|
type: 'text',
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
upload: {
|
||||||
|
mimeTypes: ['application/pdf']
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -12,5 +12,32 @@ export const Media: CollectionConfig = {
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
upload: true,
|
upload: {
|
||||||
|
imageSizes: [
|
||||||
|
{
|
||||||
|
name: 'thumbnail',
|
||||||
|
width: 350,
|
||||||
|
height: 350,
|
||||||
|
position: 'centre',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'banner',
|
||||||
|
width: 1100,
|
||||||
|
height: 400,
|
||||||
|
position: 'centre',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'tablet',
|
||||||
|
width: 1024,
|
||||||
|
// By specifying `undefined` or leaving a height undefined,
|
||||||
|
// the image will be sized to a certain width,
|
||||||
|
// but it will retain its original aspect ratio
|
||||||
|
// and calculate a height automatically.
|
||||||
|
height: undefined,
|
||||||
|
position: 'centre',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
adminThumbnail: 'thumbnail',
|
||||||
|
mimeTypes: ['image/*'],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
39
src/collections/blocks/Contactform.ts
Normal file
39
src/collections/blocks/Contactform.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import { Block } from 'payload'
|
||||||
|
|
||||||
|
export const ContactformBlock: Block = {
|
||||||
|
slug: 'contactform',
|
||||||
|
labels: {
|
||||||
|
singular: {
|
||||||
|
de: "Kontaktformular"
|
||||||
|
},
|
||||||
|
plural: {
|
||||||
|
de: 'Kontaktformular'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'title',
|
||||||
|
type: 'text',
|
||||||
|
required: true,
|
||||||
|
defaultValue: 'Ich bin dabei!',
|
||||||
|
label: {
|
||||||
|
de: 'Titel'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
type: 'textarea',
|
||||||
|
label: {
|
||||||
|
de: 'Werbetext'
|
||||||
|
},
|
||||||
|
defaultValue: "Um dich anzumelden oder uns zu unterstützen, fülle bitte das Kontaktformular aus. Wir freuen uns sehr, dass du Teil unserer Gemeinschaft bist und mit deinem Engagement dazu beiträgst, unsere Ziele zu erreichen. Solltest du Fragen haben oder weitere Informationen benötigen, zögere nicht, uns zu kontaktieren – wir sind gerne für dich da!",
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'email',
|
||||||
|
type: 'email',
|
||||||
|
defaultValue: "kontakt@dreikoenige.berlin",
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
30
src/collections/blocks/Document.ts
Normal file
30
src/collections/blocks/Document.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { Block } from 'payload'
|
||||||
|
|
||||||
|
export const DocumentBlock: Block = {
|
||||||
|
slug: 'document',
|
||||||
|
labels: {
|
||||||
|
singular: {
|
||||||
|
de: "PDF Dokument"
|
||||||
|
},
|
||||||
|
plural: {
|
||||||
|
de: "PDF Dokumenten"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'file',
|
||||||
|
type: 'upload',
|
||||||
|
relationTo: 'documents',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'button',
|
||||||
|
label: {
|
||||||
|
de: "Button text"
|
||||||
|
},
|
||||||
|
type: 'text',
|
||||||
|
defaultValue: 'Download Flyer',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
32
src/collections/blocks/Paragraph.ts
Normal file
32
src/collections/blocks/Paragraph.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { Block } from 'payload'
|
||||||
|
import { lexicalHTML } from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
|
export const ParagraphBlock: Block = {
|
||||||
|
slug: 'text',
|
||||||
|
labels: {
|
||||||
|
singular: {
|
||||||
|
de: 'Text'
|
||||||
|
},
|
||||||
|
plural: {
|
||||||
|
de: 'Text'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'content',
|
||||||
|
type: 'richText',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
lexicalHTML('content', { name: 'content_html' }),
|
||||||
|
{
|
||||||
|
name: 'width',
|
||||||
|
label: {
|
||||||
|
de: "Breite"
|
||||||
|
},
|
||||||
|
type: 'radio',
|
||||||
|
options: ["1/2", "3/4"],
|
||||||
|
required: true,
|
||||||
|
defaultValue: "1/2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import classNames from 'classnames'
|
||||||
type ButtonProps = {
|
type ButtonProps = {
|
||||||
size: 'lg' | 'md'
|
size: 'lg' | 'md'
|
||||||
type?: "button" | "submit" | "reset",
|
type?: "button" | "submit" | "reset",
|
||||||
|
href?: string,
|
||||||
children: React.ReactNode,
|
children: React.ReactNode,
|
||||||
onClick?: () => void,
|
onClick?: () => void,
|
||||||
}
|
}
|
||||||
|
|
@ -13,9 +14,24 @@ export function Button(
|
||||||
type = "button",
|
type = "button",
|
||||||
size,
|
size,
|
||||||
children,
|
children,
|
||||||
onClick
|
onClick,
|
||||||
|
href
|
||||||
}: ButtonProps
|
}: ButtonProps
|
||||||
) {
|
) {
|
||||||
|
if(href) {
|
||||||
|
return <a
|
||||||
|
href={href}
|
||||||
|
onClick={onClick}
|
||||||
|
className={classNames({
|
||||||
|
[styles.button]: true,
|
||||||
|
[styles.lg]: size === 'lg',
|
||||||
|
[styles.md]: size === 'md',
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type={type}
|
type={type}
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,16 @@
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
background: $shade1;
|
background: $shade1;
|
||||||
color: $shade3;
|
color: #ffffff;
|
||||||
border-radius: $border-radius;
|
border-radius: $border-radius;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 0;
|
border: 0;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
transition: background 0.2s;
|
transition: background 0.2s;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
margin: 5px 0;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover {
|
.button:hover {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10px 5%;
|
padding: 20px 5%;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
height: 24px;
|
height: 24px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
|
|
@ -21,7 +22,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
width: 70px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
|
|
|
||||||
9
src/components/RawHTML/RawHTML.tsx
Normal file
9
src/components/RawHTML/RawHTML.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
type RawHTMLProps = {
|
||||||
|
html: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RawHTML = ({html}: RawHTMLProps) => {
|
||||||
|
return (
|
||||||
|
<div dangerouslySetInnerHTML={{__html: html}}></div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -5,13 +5,20 @@ export type BackgroundColor = "soft" | "off-white" | undefined
|
||||||
|
|
||||||
type SectionProps = {
|
type SectionProps = {
|
||||||
backgroundColor?: BackgroundColor
|
backgroundColor?: BackgroundColor
|
||||||
children: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
padding?: "small" | "medium" | "large"
|
||||||
|
paddingBottom?: "small" | "medium" | "large"
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Section = ({ children, backgroundColor }: SectionProps) => {
|
export const Section = ({ children, backgroundColor, padding = "large", paddingBottom }: SectionProps) => {
|
||||||
return (
|
return (
|
||||||
<section className={classNames({
|
<section className={classNames({
|
||||||
[styles.section]: true,
|
[styles.large]: padding == "large",
|
||||||
|
[styles.medium]: padding == "medium",
|
||||||
|
[styles.small]: padding == "small",
|
||||||
|
[styles.largeBottom]: paddingBottom == "large",
|
||||||
|
[styles.mediumBottom]: paddingBottom == "medium",
|
||||||
|
[styles.smallBottom]: paddingBottom == "small",
|
||||||
[styles.shade2]: backgroundColor === "soft",
|
[styles.shade2]: backgroundColor === "soft",
|
||||||
[styles.shade3]: backgroundColor === "off-white"
|
[styles.shade3]: backgroundColor === "off-white"
|
||||||
})}>
|
})}>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,29 @@
|
||||||
@import "template.scss";
|
@import "template.scss";
|
||||||
|
|
||||||
.section {
|
.large {
|
||||||
padding: 130px 0;
|
padding: 130px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.medium {
|
||||||
|
padding: 70px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small {
|
||||||
|
padding: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.largeBottom {
|
||||||
|
padding-bottom: 130px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mediumBottom {
|
||||||
|
padding-bottom: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.smallBottom {
|
||||||
|
padding-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
.shade2 {
|
.shade2 {
|
||||||
background-color: $shade2;
|
background-color: $shade2;
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +33,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 576px) {
|
@media screen and (max-width: 576px) {
|
||||||
.section {
|
.large {
|
||||||
padding: 70px 0;
|
padding: 70px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.medium {
|
||||||
|
padding: 40px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small {
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.largeBottom {
|
||||||
|
padding-bottom: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mediumBottom {
|
||||||
|
padding-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.smallBottom {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
19
src/components/Text/HTMLText.tsx
Normal file
19
src/components/Text/HTMLText.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import styles from "./html.module.scss"
|
||||||
|
import { RawHTML } from '@/components/RawHTML/RawHTML'
|
||||||
|
import classNames from 'classnames'
|
||||||
|
|
||||||
|
type HTMLTextProps = {
|
||||||
|
width: "1/2" | "3/4",
|
||||||
|
html: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const HTMLText = ({width, html}: HTMLTextProps) => {
|
||||||
|
return (
|
||||||
|
<div className={classNames({
|
||||||
|
[styles.half]: width === "1/2",
|
||||||
|
[styles.threeFourth]: width === "3/4"
|
||||||
|
})}>
|
||||||
|
<RawHTML html={html} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
17
src/components/Text/html.module.scss
Normal file
17
src/components/Text/html.module.scss
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
.half {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.threeFourth {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 576px){
|
||||||
|
.half {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.threeFourth {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,23 +4,22 @@ import { ContactForm } from '@/compositions/ContactForm/ContactForm'
|
||||||
import { Title } from '@/components/Title/Title'
|
import { Title } from '@/components/Title/Title'
|
||||||
import { Col } from '@/components/Flex/Col'
|
import { Col } from '@/components/Flex/Col'
|
||||||
import { Row } from '@/components/Flex/Row'
|
import { Row } from '@/components/Flex/Row'
|
||||||
|
import { TextDiv } from '@/components/Text/TextDiv'
|
||||||
|
|
||||||
type Col50Props = {
|
type ContactSectionProps = {
|
||||||
children?: React.ReactNode
|
title: string,
|
||||||
|
description: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const ContactSection = () => {
|
export const ContactSection = ({title, description}: ContactSectionProps) => {
|
||||||
return (
|
return (
|
||||||
<Section>
|
<Section backgroundColor={"off-white"}>
|
||||||
<Container>
|
<Container>
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<Title title="Kontakt" size={"lg"} />
|
<Title title={title} size={"md"} />
|
||||||
<p>
|
<TextDiv text={description} />
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque lacinia efficitur sapien, vel molestie ligula fermentum rutrum. Maecenas vel mattis leo. Donec dictum convallis mi ac fermentum. Praesent imperdiet dictum arcu, vel lacinia est accumsan ut. Mauris ultrices leo ut mi eleifend, at porttitor mauris condimentum. Quisque a viverra tellus. Cras eu euismod augue. Morbi tristique a nisi vitae tincidunt. Nullam eget dignissim risus, ut tempor nulla. Proin suscipit mi sed leo posuere scelerisque. Sed vel semper ligula.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<ContactForm />
|
<ContactForm />
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import bread from '@/app/bread.jpg'
|
||||||
import forest from "../../assets/forest.jpeg"
|
import forest from "../../assets/forest.jpeg"
|
||||||
import { ContentWithSlider } from '@/compositions/ContentWithSlider/ContentWithSlider'
|
import { ContentWithSlider } from '@/compositions/ContentWithSlider/ContentWithSlider'
|
||||||
import { ContactSection } from '@/compositions/ContactSection/ContactSection'
|
import { ContactSection } from '@/compositions/ContactSection/ContactSection'
|
||||||
import { Events } from '@/compositions/Events/Events'
|
|
||||||
import { ImageWithText } from '@/compositions/ImageWithText/ImageWithText'
|
import { ImageWithText } from '@/compositions/ImageWithText/ImageWithText'
|
||||||
|
|
||||||
export const Home = () => {
|
export const Home = () => {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ export interface Config {
|
||||||
testimony: Testimony;
|
testimony: Testimony;
|
||||||
page: Page;
|
page: Page;
|
||||||
users: User;
|
users: User;
|
||||||
|
documents: Document;
|
||||||
media: Media;
|
media: Media;
|
||||||
'payload-locked-documents': PayloadLockedDocument;
|
'payload-locked-documents': PayloadLockedDocument;
|
||||||
'payload-preferences': PayloadPreference;
|
'payload-preferences': PayloadPreference;
|
||||||
|
|
@ -42,6 +43,7 @@ export interface Config {
|
||||||
testimony: TestimonySelect<false> | TestimonySelect<true>;
|
testimony: TestimonySelect<false> | TestimonySelect<true>;
|
||||||
page: PageSelect<false> | PageSelect<true>;
|
page: PageSelect<false> | PageSelect<true>;
|
||||||
users: UsersSelect<false> | UsersSelect<true>;
|
users: UsersSelect<false> | UsersSelect<true>;
|
||||||
|
documents: DocumentsSelect<false> | DocumentsSelect<true>;
|
||||||
media: MediaSelect<false> | MediaSelect<true>;
|
media: MediaSelect<false> | MediaSelect<true>;
|
||||||
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
|
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
|
||||||
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
|
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
|
||||||
|
|
@ -146,6 +148,32 @@ export interface Media {
|
||||||
height?: number | null;
|
height?: number | null;
|
||||||
focalX?: number | null;
|
focalX?: number | null;
|
||||||
focalY?: number | null;
|
focalY?: number | null;
|
||||||
|
sizes?: {
|
||||||
|
thumbnail?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
banner?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
tablet?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -184,26 +212,68 @@ export interface Blog {
|
||||||
photo?: (string | null) | Media;
|
photo?: (string | null) | Media;
|
||||||
title: string;
|
title: string;
|
||||||
parish?: (string | Parish)[] | null;
|
parish?: (string | Parish)[] | null;
|
||||||
content?:
|
excerpt: string;
|
||||||
| (
|
content: (
|
||||||
| {
|
| {
|
||||||
quoteText: string;
|
content: {
|
||||||
|
root: {
|
||||||
|
type: string;
|
||||||
|
children: {
|
||||||
|
type: string;
|
||||||
|
version: number;
|
||||||
|
[k: string]: unknown;
|
||||||
|
}[];
|
||||||
|
direction: ('ltr' | 'rtl') | null;
|
||||||
|
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
||||||
|
indent: number;
|
||||||
|
version: number;
|
||||||
|
};
|
||||||
|
[k: string]: unknown;
|
||||||
|
};
|
||||||
|
content_html?: string | null;
|
||||||
|
width: '1/2' | '3/4';
|
||||||
id?: string | null;
|
id?: string | null;
|
||||||
blockName?: string | null;
|
blockName?: string | null;
|
||||||
blockType: 'Quote';
|
blockType: 'text';
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
sliderContent: string;
|
file: string | Document;
|
||||||
content: string;
|
button: string;
|
||||||
id?: string | null;
|
id?: string | null;
|
||||||
blockName?: string | null;
|
blockName?: string | null;
|
||||||
blockType: 'ContentWithSlider';
|
blockType: 'document';
|
||||||
}
|
}
|
||||||
)[]
|
| {
|
||||||
| null;
|
title: string;
|
||||||
|
description: string;
|
||||||
|
email: string;
|
||||||
|
id?: string | null;
|
||||||
|
blockName?: string | null;
|
||||||
|
blockType: 'contactform';
|
||||||
|
}
|
||||||
|
)[];
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "documents".
|
||||||
|
*/
|
||||||
|
export interface Document {
|
||||||
|
id: string;
|
||||||
|
name: 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
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "tweet".
|
* via the `definition` "tweet".
|
||||||
|
|
@ -392,6 +462,10 @@ export interface PayloadLockedDocument {
|
||||||
relationTo: 'users';
|
relationTo: 'users';
|
||||||
value: string | User;
|
value: string | User;
|
||||||
} | null)
|
} | null)
|
||||||
|
| ({
|
||||||
|
relationTo: 'documents';
|
||||||
|
value: string | Document;
|
||||||
|
} | null)
|
||||||
| ({
|
| ({
|
||||||
relationTo: 'media';
|
relationTo: 'media';
|
||||||
value: string | Media;
|
value: string | Media;
|
||||||
|
|
@ -505,21 +579,33 @@ export interface BlogSelect<T extends boolean = true> {
|
||||||
photo?: T;
|
photo?: T;
|
||||||
title?: T;
|
title?: T;
|
||||||
parish?: T;
|
parish?: T;
|
||||||
|
excerpt?: T;
|
||||||
content?:
|
content?:
|
||||||
| T
|
| T
|
||||||
| {
|
| {
|
||||||
Quote?:
|
text?:
|
||||||
| T
|
| T
|
||||||
| {
|
| {
|
||||||
quoteText?: T;
|
content?: T;
|
||||||
|
content_html?: T;
|
||||||
|
width?: T;
|
||||||
id?: T;
|
id?: T;
|
||||||
blockName?: T;
|
blockName?: T;
|
||||||
};
|
};
|
||||||
ContentWithSlider?:
|
document?:
|
||||||
| T
|
| T
|
||||||
| {
|
| {
|
||||||
sliderContent?: T;
|
file?: T;
|
||||||
content?: T;
|
button?: T;
|
||||||
|
id?: T;
|
||||||
|
blockName?: T;
|
||||||
|
};
|
||||||
|
contactform?:
|
||||||
|
| T
|
||||||
|
| {
|
||||||
|
title?: T;
|
||||||
|
description?: T;
|
||||||
|
email?: T;
|
||||||
id?: T;
|
id?: T;
|
||||||
blockName?: T;
|
blockName?: T;
|
||||||
};
|
};
|
||||||
|
|
@ -643,6 +729,24 @@ export interface UsersSelect<T extends boolean = true> {
|
||||||
loginAttempts?: T;
|
loginAttempts?: T;
|
||||||
lockUntil?: T;
|
lockUntil?: T;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "documents_select".
|
||||||
|
*/
|
||||||
|
export interface DocumentsSelect<T extends boolean = true> {
|
||||||
|
name?: T;
|
||||||
|
updatedAt?: T;
|
||||||
|
createdAt?: T;
|
||||||
|
url?: T;
|
||||||
|
thumbnailURL?: T;
|
||||||
|
filename?: T;
|
||||||
|
mimeType?: T;
|
||||||
|
filesize?: T;
|
||||||
|
width?: T;
|
||||||
|
height?: T;
|
||||||
|
focalX?: T;
|
||||||
|
focalY?: T;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "media_select".
|
* via the `definition` "media_select".
|
||||||
|
|
@ -660,6 +764,40 @@ export interface MediaSelect<T extends boolean = true> {
|
||||||
height?: T;
|
height?: T;
|
||||||
focalX?: T;
|
focalX?: T;
|
||||||
focalY?: T;
|
focalY?: T;
|
||||||
|
sizes?:
|
||||||
|
| T
|
||||||
|
| {
|
||||||
|
thumbnail?:
|
||||||
|
| T
|
||||||
|
| {
|
||||||
|
url?: T;
|
||||||
|
width?: T;
|
||||||
|
height?: T;
|
||||||
|
mimeType?: T;
|
||||||
|
filesize?: T;
|
||||||
|
filename?: T;
|
||||||
|
};
|
||||||
|
banner?:
|
||||||
|
| T
|
||||||
|
| {
|
||||||
|
url?: T;
|
||||||
|
width?: T;
|
||||||
|
height?: T;
|
||||||
|
mimeType?: T;
|
||||||
|
filesize?: T;
|
||||||
|
filename?: T;
|
||||||
|
};
|
||||||
|
tablet?:
|
||||||
|
| T
|
||||||
|
| {
|
||||||
|
url?: T;
|
||||||
|
width?: T;
|
||||||
|
height?: T;
|
||||||
|
mimeType?: T;
|
||||||
|
filesize?: T;
|
||||||
|
filename?: T;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,18 @@
|
||||||
// storage-adapter-import-placeholder
|
// storage-adapter-import-placeholder
|
||||||
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
||||||
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
import {
|
||||||
|
lexicalEditor,
|
||||||
|
BoldFeature,
|
||||||
|
InlineToolbarFeature,
|
||||||
|
ItalicFeature,
|
||||||
|
UnderlineFeature,
|
||||||
|
ParagraphFeature,
|
||||||
|
HeadingFeature,
|
||||||
|
AlignFeature,
|
||||||
|
UnorderedListFeature,
|
||||||
|
LinkFeature,
|
||||||
|
HTMLConverterFeature,
|
||||||
|
} from '@payloadcms/richtext-lexical'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { buildConfig } from 'payload'
|
import { buildConfig } from 'payload'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
|
|
@ -20,6 +32,8 @@ import { Announcements } from '@/collections/Announcements'
|
||||||
import { Blog } from '@/collections/Blog'
|
import { Blog } from '@/collections/Blog'
|
||||||
import { Tweets } from '@/collections/Tweets'
|
import { Tweets } from '@/collections/Tweets'
|
||||||
import { Pages } from '@/collections/Pages'
|
import { Pages } from '@/collections/Pages'
|
||||||
|
import { Documents } from '@/collections/Documents'
|
||||||
|
import { Underdog } from 'next/dist/compiled/@next/font/dist/google'
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
|
|
@ -41,9 +55,25 @@ export default buildConfig({
|
||||||
Testimony,
|
Testimony,
|
||||||
Pages,
|
Pages,
|
||||||
Users,
|
Users,
|
||||||
|
Documents,
|
||||||
Media,
|
Media,
|
||||||
],
|
],
|
||||||
editor: lexicalEditor(),
|
editor: lexicalEditor(
|
||||||
|
{
|
||||||
|
features: () => [
|
||||||
|
BoldFeature(),
|
||||||
|
ItalicFeature(),
|
||||||
|
UnderlineFeature(),
|
||||||
|
HeadingFeature({ enabledHeadingSizes: ["h3","h4","h5"]}),
|
||||||
|
AlignFeature(),
|
||||||
|
UnorderedListFeature(),
|
||||||
|
LinkFeature(),
|
||||||
|
ParagraphFeature(),
|
||||||
|
InlineToolbarFeature(),
|
||||||
|
HTMLConverterFeature()
|
||||||
|
]
|
||||||
|
}
|
||||||
|
),
|
||||||
secret: process.env.PAYLOAD_SECRET || '',
|
secret: process.env.PAYLOAD_SECRET || '',
|
||||||
typescript: {
|
typescript: {
|
||||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue