diff --git a/src/blocks/Affiliation/Component.tsx b/src/blocks/Affiliation/Component.tsx index 11fc3fb..f18d3cc 100644 --- a/src/blocks/Affiliation/Component.tsx +++ b/src/blocks/Affiliation/Component.tsx @@ -1,22 +1,24 @@ 'use client' import React from 'react' -import { motion } from 'framer-motion' + +import { Landmark, Scale, ShieldCheck } from 'lucide-react' import Link from 'next/link' import type { Page } from '../../payload-types' type Props = Extract[0], { blockType: 'affiliation' }> -export const AffiliationBlock: React.FC = ({ eyebrow, title, description, logo, linkText }) => { +const iconMap = { + shield: ShieldCheck, + scale: Scale, + landmark: Landmark, +} + +export const AffiliationBlock: React.FC = ({ eyebrow, title, description, logo, linkText, trustPoints }) => { return (
-
+
- {eyebrow && ( -
- // {eyebrow} -
- )}

{title}

@@ -38,15 +40,20 @@ export const AffiliationBlock: React.FC = ({ eyebrow, title, description,
-
- {/* PLACEHOLDER - do podmiany na realne zdjęcia klienta */} - Budynek urzędu, formalna architektura -
-
+ {trustPoints && trustPoints.length > 0 && ( +
+ {trustPoints.map((point: any, index: number) => { + const Icon = (point.icon && iconMap[point.icon as keyof typeof iconMap]) || ShieldCheck + return ( +
+ +

{point.title}

+

{point.description}

+
+ ) + })} +
+ )}
diff --git a/src/blocks/Affiliation/config.ts b/src/blocks/Affiliation/config.ts index 7dd9da3..4325cf7 100644 --- a/src/blocks/Affiliation/config.ts +++ b/src/blocks/Affiliation/config.ts @@ -7,6 +7,24 @@ export const Affiliation: Block = { { name: 'title', type: 'text', required: true, localized: true }, { name: 'description', type: 'textarea', required: true, localized: true }, { name: 'logo', type: 'upload', relationTo: 'media' }, + { + name: 'trustPoints', + type: 'array', + localized: true, + minRows: 1, + maxRows: 3, + fields: [ + { + name: 'icon', + type: 'select', + required: true, + options: ['shield', 'scale', 'landmark'], + defaultValue: 'shield', + }, + { name: 'title', type: 'text', required: true, defaultValue: 'Punkt zaufania' }, + { name: 'description', type: 'textarea', required: true, defaultValue: 'Certyfikacja i uprawnienia potwierdzone urzędowo.' }, + ], + }, { name: 'linkText', type: 'text', localized: true }, ], } diff --git a/src/blocks/FAQTeaser/Component.tsx b/src/blocks/FAQTeaser/Component.tsx index c7404f8..4447722 100644 --- a/src/blocks/FAQTeaser/Component.tsx +++ b/src/blocks/FAQTeaser/Component.tsx @@ -1,6 +1,6 @@ 'use client' import React from 'react' -import { motion } from 'framer-motion' + import Link from 'next/link' import type { Page } from '../../payload-types' @@ -11,11 +11,7 @@ export const FAQTeaserBlock: React.FC = ({ eyebrow, title, questions, lin
- {eyebrow && ( -
- // {eyebrow} -
- )} +

{title}

diff --git a/src/blocks/Hero/Component.tsx b/src/blocks/Hero/Component.tsx index c41f648..2409853 100644 --- a/src/blocks/Hero/Component.tsx +++ b/src/blocks/Hero/Component.tsx @@ -6,7 +6,7 @@ import Image from 'next/image' type Props = Extract[0], { blockType: 'hero' }> -export const HeroBlock: React.FC = ({ title, subtitle, primaryCta, secondaryCta, image }) => { +export const HeroBlock: React.FC = ({ title, titleAccent, subtitle, primaryCta, secondaryCta, image }) => { // Sprawdzamy czy obrazek jest obiektem Media czy tylko ID const heroMedia = typeof image === 'object' && image !== null ? (image as Media) : null; // PLACEHOLDER - do podmiany na zdjęcie klienta jeśli brak w CMS @@ -19,8 +19,9 @@ export const HeroBlock: React.FC = ({ title, subtitle, primaryCta, second
-

- {title} +

+ {title} + {titleAccent && {titleAccent}}

diff --git a/src/blocks/Hero/config.ts b/src/blocks/Hero/config.ts index 8c7aa79..020b05a 100644 --- a/src/blocks/Hero/config.ts +++ b/src/blocks/Hero/config.ts @@ -3,7 +3,8 @@ import type { Block } from 'payload' export const Hero: Block = { slug: 'hero', fields: [ - { name: 'title', type: 'text', required: true, localized: true }, + { name: 'title', type: 'text', required: true, localized: true, defaultValue: 'Tytuł strony głównej' }, + { name: 'titleAccent', type: 'text', required: true, localized: true, defaultValue: '— do uzupełnienia' }, { name: 'subtitle', type: 'text', required: true, localized: true }, { name: 'primaryCta', type: 'text', required: true, localized: true }, { diff --git a/src/blocks/UniqueValue/Component.tsx b/src/blocks/UniqueValue/Component.tsx index c37a473..54091e4 100644 --- a/src/blocks/UniqueValue/Component.tsx +++ b/src/blocks/UniqueValue/Component.tsx @@ -6,7 +6,7 @@ import { CheckCircle } from 'lucide-react' type Props = Extract[0], { blockType: 'uniqueValue' }> -export const UniqueValueBlock: React.FC = ({ eyebrow, features, title, description }) => { +export const UniqueValueBlock: React.FC = ({ eyebrow, features, title, description, image }) => { return (

@@ -16,8 +16,8 @@ export const UniqueValueBlock: React.FC = ({ eyebrow, features, title, de
{/* PLACEHOLDER - do podmiany na realne zdjęcia klienta */} Dokumenty i profesjonalne doradztwo podatkowe = ({ eyebrow, features, title, de {/* Kolumna tekstowa */}
- {eyebrow && ( -
- // {eyebrow} -
- )} +

{title} diff --git a/src/blocks/UniqueValue/config.ts b/src/blocks/UniqueValue/config.ts index c0170ac..261ee77 100644 --- a/src/blocks/UniqueValue/config.ts +++ b/src/blocks/UniqueValue/config.ts @@ -6,6 +6,7 @@ export const UniqueValue: Block = { { name: 'eyebrow', type: 'text', localized: true }, { name: 'title', type: 'text', required: true, localized: true }, { name: 'description', type: 'textarea', required: true, localized: true }, + { name: 'image', type: 'upload', relationTo: 'media', required: true }, { name: 'features', type: 'array', diff --git a/src/payload-types.ts b/src/payload-types.ts index 859f5f1..53ee835 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -255,6 +255,7 @@ export interface Page { } | { title: string; + titleAccent: string; subtitle: string; primaryCta: string; secondaryCta?: { @@ -295,6 +296,7 @@ export interface Page { eyebrow?: string | null; title: string; description: string; + image: number | Media; features?: | { text: string; @@ -342,6 +344,14 @@ export interface Page { title: string; description: string; logo?: (number | null) | Media; + trustPoints?: + | { + icon: 'shield' | 'scale' | 'landmark'; + title: string; + description: string; + id?: string | null; + }[] + | null; linkText?: string | null; id?: string | null; blockName?: string | null; @@ -617,6 +627,7 @@ export interface PagesSelect { | T | { title?: T; + titleAccent?: T; subtitle?: T; primaryCta?: T; secondaryCta?: @@ -664,6 +675,7 @@ export interface PagesSelect { eyebrow?: T; title?: T; description?: T; + image?: T; features?: | T | { @@ -714,6 +726,14 @@ export interface PagesSelect { title?: T; description?: T; logo?: T; + trustPoints?: + | T + | { + icon?: T; + title?: T; + description?: T; + id?: T; + }; linkText?: T; id?: T; blockName?: T;