diff --git a/src/components/widgets/Pricing.astro b/src/components/widgets/Pricing.astro index aa8cf42..baa35c6 100644 --- a/src/components/widgets/Pricing.astro +++ b/src/components/widgets/Pricing.astro @@ -1,48 +1,33 @@ --- -import { Icon } from "astro-icon/components"; -import CTA from "~/components/ui/CTA.astro"; -import Headline from "~/components/ui/Headline.astro"; -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import type { Pricing } from "~/types"; +import { Icon } from 'astro-icon/components'; +import CTA from '~/components/ui/CTA.astro'; +import Headline from '~/components/ui/Headline.astro'; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import type { Pricing } from '~/types'; const { - title = "", - subtitle = "", - tagline = "", + title = '', + subtitle = '', + tagline = '', prices = [], id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props as Pricing; --- - +
-
+
{ prices && - prices.map( - ({ - title, - price, - period, - items, - callToAction, - hasRibbon = false, - ribbonTitle, - }) => ( -
-
+ prices.map(({ title, subtitle, price, period, items, callToAction, hasRibbon = false, ribbonTitle }) => ( +
+ {price && period && ( +
{hasRibbon && ribbonTitle && (
@@ -50,48 +35,47 @@ const {
)} -
    -
  • - {title} -
  • -
  • - $ - {price} -
  • -
  • - {period} -
  • - {items && - items.map(({ description, icon }) => ( -
  • -
    - {icon && ( - - )} -
    - {description} -
  • - ))} -
+
+ {title && ( +

{title}

+ )} + {subtitle &&

{subtitle}

} +
+
+ $ + {price} +
+ {period} +
+ {items && ( +
    + {items.map( + ({ description, icon }) => + description && ( +
  • +
    + +
    + {description} +
  • + ) + )} +
+ )} +
{callToAction && ( -
- +
+ {typeof callToAction === 'string' ? ( + + ) : ( + callToAction && callToAction.text && callToAction.href && + )}
)}
-
- ) - ) + )} +
+ )) }
diff --git a/src/components/widgets/Steps2.astro b/src/components/widgets/Steps2.astro index 9482ff1..3f300ac 100644 --- a/src/components/widgets/Steps2.astro +++ b/src/components/widgets/Steps2.astro @@ -26,7 +26,6 @@ const { title={title} subtitle={subtitle} tagline={tagline} - callToAction={callToAction} classes={{ container: 'text-center md:text-left mb-4 md:mb-8', title: 'mb-4 text-3xl lg:text-4xl font-bold font-heading', diff --git a/src/pages/pricing.astro b/src/pages/pricing.astro index 7a5bcdd..a55840a 100644 --- a/src/pages/pricing.astro +++ b/src/pages/pricing.astro @@ -1,105 +1,97 @@ --- import Layout from '~/layouts/PageLayout.astro'; - -import Pricing from '~/components/widgets/Pricing.astro'; +import Prices from '~/components/widgets/Pricing.astro'; const metadata = { - title: "Pricing", + title: 'Pricing', }; --- - diff --git a/src/types.d.ts b/src/types.d.ts index 5298748..6ae93e2 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -135,6 +135,7 @@ export interface Item { export interface Price { title?: string; + subtitle?: string; description?: string; price?: number; period?: string;