From 6a51f61e0e77dbf951b55c2e047ca125f2803655 Mon Sep 17 00:00:00 2001 From: widgeter Date: Fri, 4 Aug 2023 18:18:22 +0200 Subject: [PATCH] Refactor CallToAction widget --- src/components/widgets/CallToAction.astro | 84 +++++++++++------------ 1 file changed, 40 insertions(+), 44 deletions(-) diff --git a/src/components/widgets/CallToAction.astro b/src/components/widgets/CallToAction.astro index f02c008..adc8aab 100644 --- a/src/components/widgets/CallToAction.astro +++ b/src/components/widgets/CallToAction.astro @@ -1,58 +1,54 @@ --- import { Icon } from 'astro-icon/components'; +import WidgetWrapper from '../ui/WidgetWrapper.astro'; +import type { CallToAction, Widget } from '~/types'; +import Headline from '../ui/Headline.astro'; -export interface CallToAction { - text: string; - href: string; - icon?: string; -} - -export interface Props { +interface Props extends Widget { title?: string; subtitle?: string; - description?: string; - callToAction?: string | CallToAction; + tagline?: string; + callToAction?: CallToAction; } const { title = await Astro.slots.render('title'), subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), callToAction = await Astro.slots.render('callToAction'), -} = Astro.props; + + id, + isDark = false, + classes = {}, + bg = await Astro.slots.render('bg'), +} = Astro.props as Props; --- -
-
-
-
- { - title && ( -

- ) - } - {subtitle &&

} - { - typeof callToAction === 'string' ? ( - - ) : ( - callToAction && - callToAction.text && - callToAction.href && ( -

- ) - ) - } -

-
+ +
+ + { + typeof callToAction === 'string' ? ( + + ) : ( + callToAction && + callToAction.text && + callToAction.href && ( + + ) + ) + }
-
+