diff --git a/src/blocks/Process/Component.tsx b/src/blocks/Process/Component.tsx index 61ef6a9..0c6b12d 100644 --- a/src/blocks/Process/Component.tsx +++ b/src/blocks/Process/Component.tsx @@ -6,7 +6,7 @@ import { ArrowLink } from '../../components/ArrowLink' type Props = Extract[0], { blockType: 'process' }> -export const ProcessBlock: React.FC = ({ subtitle, title, steps, ctaText, image }) => { +export const ProcessBlock: React.FC = ({ subtitle, title, steps, ctaText, ctaUrl, image }) => { const processMedia = typeof image === 'object' && image !== null ? (image as Media) : null; const imageUrl = processMedia?.url || 'https://images.unsplash.com/photo-1611162617474-5b21e879e113?auto=format&fit=crop&w=1200&q=80'; const imageAlt = processMedia?.alt || 'Proces współpracy'; @@ -52,7 +52,7 @@ export const ProcessBlock: React.FC = ({ subtitle, title, steps, ctaText, {ctaText && (
- + {ctaText}
diff --git a/src/blocks/Process/config.ts b/src/blocks/Process/config.ts index e671336..dfc1b43 100644 --- a/src/blocks/Process/config.ts +++ b/src/blocks/Process/config.ts @@ -18,6 +18,7 @@ export const Process: Block = { ], }, { name: 'ctaText', type: 'text', localized: true }, + { name: 'ctaUrl', type: 'text', localized: true }, { name: 'image', type: 'upload', relationTo: 'media', required: true }, ], } diff --git a/src/components/ArrowLink/index.tsx b/src/components/ArrowLink/index.tsx index 5d60164..caa75b6 100644 --- a/src/components/ArrowLink/index.tsx +++ b/src/components/ArrowLink/index.tsx @@ -23,15 +23,30 @@ export const ArrowLink: React.FC = ({ const circleSize = size === 'sm' ? 'w-10 h-10' : 'w-12 h-12'; const iconSize = size === 'sm' ? 'w-4 h-4' : 'w-5 h-5'; - return ( - + const isAnchor = href?.startsWith('#') + + const innerContent = ( + <> {children}
+ + ) + + const classes = `group flex items-center gap-3 text-foreground font-semibold hover:text-accent transition-colors ${className}` + + if (isAnchor) { + return ( + + {innerContent} + + ) + } + + return ( + + {innerContent} ) } diff --git a/src/payload-types.ts b/src/payload-types.ts index 869ab71..1c53770 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -365,6 +365,7 @@ export interface Page { }[] | null; ctaText?: string | null; + ctaUrl?: string | null; image: number | Media; id?: string | null; blockName?: string | null; @@ -792,6 +793,7 @@ export interface PagesSelect { id?: T; }; ctaText?: T; + ctaUrl?: T; image?: T; id?: T; blockName?: T;