fix(cta): add backwards-compatible aliases in CallToAction for MDX parameters
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Successful in 1m8s
Build & Deploy / 🏗️ Build (push) Failing after 2m43s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Successful in 1m8s
Build & Deploy / 🏗️ Build (push) Failing after 2m43s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -8,8 +8,11 @@ import { useTranslations } from 'next-intl';
|
|||||||
export interface CallToActionProps {
|
export interface CallToActionProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
text?: string; // Alias for description
|
||||||
ctaLabel?: string;
|
ctaLabel?: string;
|
||||||
|
buttonText?: string; // Alias for ctaLabel
|
||||||
ctaHref?: string;
|
ctaHref?: string;
|
||||||
|
buttonLink?: string; // Alias for ctaHref
|
||||||
theme?: 'light' | 'dark';
|
theme?: 'light' | 'dark';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,9 +42,9 @@ export const CallToAction: React.FC<CallToActionProps> = (props) => {
|
|||||||
const t = useTranslations('CallToAction');
|
const t = useTranslations('CallToAction');
|
||||||
|
|
||||||
const title = props.title || t('title');
|
const title = props.title || t('title');
|
||||||
const description = props.description || t('description');
|
const description = props.description || props.text || t('description');
|
||||||
const ctaLabel = props.ctaLabel || t('ctaLabel');
|
const ctaLabel = props.ctaLabel || props.buttonText || t('ctaLabel');
|
||||||
const ctaHref = props.ctaHref || t('ctaHref');
|
const ctaHref = props.ctaHref || props.buttonLink || t('ctaHref');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`py-24 text-center ${isDark ? 'bg-primary-dark text-white' : 'bg-neutral-50 border-t border-neutral-100'}`}>
|
<div className={`py-24 text-center ${isDark ? 'bg-primary-dark text-white' : 'bg-neutral-50 border-t border-neutral-100'}`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user