fix(dashboard): align hero enroll CTA with pricing section (#810)
The hero Enroll button was disabled unless metadata.allowNewStudent was explicitly true, while the pricing CTA treated unset values as open (matching the enroll page and API). This left the hero button inert on courses where enrollment was allowed but the flag was not set. Also sync pricing CTA disabled state, use activeOrg for paid enroll on public org-site pages, and keep hero/pricing disabled flags aligned via alignHeroCtaWithPricing. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor Agent
Rotimi Best
parent
64112dfc4f
commit
0abdfe2102
@@ -10,7 +10,7 @@ export function alignHeroCtaWithPricing(
|
||||
label: pricing.ctaLabel,
|
||||
href: pricing.ctaOnclick ? undefined : (pricing.ctaHref ?? '#pricing'),
|
||||
onclick: pricing.ctaOnclick,
|
||||
disabled: hero.primaryAction.disabled
|
||||
disabled: pricing.ctaDisabled ?? hero.primaryAction.disabled
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
size="lg"
|
||||
href={pricing.ctaOnclick ? undefined : (pricing.ctaHref ?? '#enroll')}
|
||||
onclick={pricing.ctaOnclick}
|
||||
disabled={pricing.ctaDisabled ?? false}
|
||||
class={t.pricingCta}
|
||||
>
|
||||
{pricing.ctaLabel}
|
||||
|
||||
@@ -229,6 +229,7 @@ export type CoursePricing = {
|
||||
ctaLabel: string;
|
||||
ctaHref?: string;
|
||||
ctaOnclick?: (event: MouseEvent) => void;
|
||||
ctaDisabled?: boolean;
|
||||
features?: string[];
|
||||
reward?: {
|
||||
show: boolean;
|
||||
|
||||
Reference in New Issue
Block a user