fix(ui): change secondary CTA in Hero to anchor link targeting Process block
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { getPayload } from 'payload'
|
||||
import configPromise from '../src/payload.config'
|
||||
|
||||
async function run() {
|
||||
console.log('Connecting to Payload Local API...')
|
||||
const payload = await getPayload({ config: configPromise })
|
||||
|
||||
for (const locale of ['pl', 'de']) {
|
||||
const home = await payload.findByID({ collection: 'pages', id: 1, locale: locale as any })
|
||||
if (home && home.layout) {
|
||||
const newLayout = home.layout.map((block: any) => {
|
||||
if (block.blockType === 'hero' && block.secondaryCta) {
|
||||
return {
|
||||
...block,
|
||||
secondaryCta: {
|
||||
...block.secondaryCta,
|
||||
url: '#jak-to-dziala'
|
||||
}
|
||||
}
|
||||
}
|
||||
return block
|
||||
})
|
||||
|
||||
await payload.update({
|
||||
collection: 'pages',
|
||||
id: 1,
|
||||
locale: locale as any,
|
||||
data: { layout: newLayout },
|
||||
})
|
||||
console.log(`Updated Hero secondaryCta for locale: ${locale}`)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Done!')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
try {
|
||||
await run()
|
||||
} catch (err) {
|
||||
console.error('ERROR during setup:', err)
|
||||
process.exit(1)
|
||||
}
|
||||
@@ -144,12 +144,21 @@ export const HeroBlock: React.FC<Props> = ({
|
||||
{primaryCta}
|
||||
</a>
|
||||
{secondaryCta?.text && secondaryCta?.url && (
|
||||
<Link
|
||||
href={secondaryCta.url}
|
||||
className="text-foreground font-semibold text-lg hover:text-accent hover:underline underline-offset-4 transition-colors"
|
||||
>
|
||||
{secondaryCta.text}
|
||||
</Link>
|
||||
secondaryCta.url.startsWith('#') ? (
|
||||
<a
|
||||
href={secondaryCta.url}
|
||||
className="text-foreground font-semibold text-lg hover:text-accent hover:underline underline-offset-4 transition-colors"
|
||||
>
|
||||
{secondaryCta.text}
|
||||
</a>
|
||||
) : (
|
||||
<Link
|
||||
href={secondaryCta.url}
|
||||
className="text-foreground font-semibold text-lg hover:text-accent hover:underline underline-offset-4 transition-colors"
|
||||
>
|
||||
{secondaryCta.text}
|
||||
</Link>
|
||||
)
|
||||
)}
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@ export const ProcessBlock: React.FC<Props> = ({ subtitle, title, steps, ctaText,
|
||||
const imageAlt = processMedia?.alt || 'Proces współpracy';
|
||||
|
||||
return (
|
||||
<section className="py-20 md:py-32 bg-background text-foreground overflow-hidden">
|
||||
<section id="jak-to-dziala" className="py-20 md:py-32 bg-background text-foreground overflow-hidden">
|
||||
<div className="container-premium">
|
||||
<div className="max-w-3xl mb-16 md:mb-24">
|
||||
<h2 className="font-heading text-3xl sm:text-4xl md:text-5xl font-extrabold tracking-tight text-foreground mb-6 text-balance">
|
||||
|
||||
Reference in New Issue
Block a user