feat(ui): add ctaUrl field to Process block and link ArrowLink

This commit is contained in:
MichalC
2026-09-03 23:09:09 +02:00
parent b0b8d5e55f
commit fa13a3e13d
4 changed files with 25 additions and 7 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { ArrowLink } from '../../components/ArrowLink'
type Props = Extract<NonNullable<Page['layout']>[0], { blockType: 'process' }>
export const ProcessBlock: React.FC<Props> = ({ subtitle, title, steps, ctaText, image }) => {
export const ProcessBlock: React.FC<Props> = ({ 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<Props> = ({ subtitle, title, steps, ctaText,
{ctaText && (
<div className="mt-4">
<ArrowLink href="/jak-sie-umowic">
<ArrowLink href={ctaUrl || '#'}>
{ctaText}
</ArrowLink>
</div>
+1
View File
@@ -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 },
],
}