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}
|
{primaryCta}
|
||||||
</a>
|
</a>
|
||||||
{secondaryCta?.text && secondaryCta?.url && (
|
{secondaryCta?.text && secondaryCta?.url && (
|
||||||
<Link
|
secondaryCta.url.startsWith('#') ? (
|
||||||
href={secondaryCta.url}
|
<a
|
||||||
className="text-foreground font-semibold text-lg hover:text-accent hover:underline underline-offset-4 transition-colors"
|
href={secondaryCta.url}
|
||||||
>
|
className="text-foreground font-semibold text-lg hover:text-accent hover:underline underline-offset-4 transition-colors"
|
||||||
{secondaryCta.text}
|
>
|
||||||
</Link>
|
{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>
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const ProcessBlock: React.FC<Props> = ({ subtitle, title, steps, ctaText,
|
|||||||
const imageAlt = processMedia?.alt || 'Proces współpracy';
|
const imageAlt = processMedia?.alt || 'Proces współpracy';
|
||||||
|
|
||||||
return (
|
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="container-premium">
|
||||||
<div className="max-w-3xl mb-16 md:mb-24">
|
<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">
|
<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