From d7e372ed4b35080f1af711689c3177852ffcc9b5 Mon Sep 17 00:00:00 2001 From: widgeter Date: Tue, 8 Aug 2023 14:17:44 +0200 Subject: [PATCH] Modify Steps2 widget --- src/components/widgets/Steps2.astro | 167 ++++++++++------------------ src/pages/about.astro | 35 +++++- src/types.d.ts | 1 + 3 files changed, 91 insertions(+), 112 deletions(-) diff --git a/src/components/widgets/Steps2.astro b/src/components/widgets/Steps2.astro index ae13600..68e2981 100644 --- a/src/components/widgets/Steps2.astro +++ b/src/components/widgets/Steps2.astro @@ -1,20 +1,8 @@ --- import { Icon } from 'astro-icon/components'; -import { CallToAction } from '~/types'; - -interface Item { - title: string; - description: string; - icon?: string; -} - -export interface Props { - title?: string; - subtitle?: string; - tagline?: string; - callToAction?: string | CallToAction; - items: Array; -} +import Headline from '../ui/Headline.astro'; +import { Steps } from '~/types'; +import WidgetWrapper from '../ui/WidgetWrapper.astro'; const { title = await Astro.slots.render('title'), @@ -22,101 +10,68 @@ const { tagline, callToAction = await Astro.slots.render('callToAction'), items = [], -} = Astro.props; + isReversed = false, -/** - * - - - - - */ + id, + isDark = false, + classes = {}, + bg = await Astro.slots.render('bg'), +} = Astro.props as Steps; --- -
-
-
-
-
-
-
- { - tagline && ( -

- ) - } - {title &&

} - {subtitle &&

} + +

+
+ -
- { - typeof callToAction === 'string' ? ( - - ) : ( - callToAction && - callToAction.text && - callToAction.href && ( - - {callToAction.icon && } - {callToAction.text} - - ) - ) - } -
-
-
-
-
    - { - items && items.length - ? items.map(({ title: title2, description, icon }, index) => ( -
  • -
    - - {icon ? : index + 1} - -
    -
    -

    -

    -

    -
  • - )) - : '' - } -
-
-

+
+ { + typeof callToAction === 'string' ? ( + + ) : ( + callToAction && + callToAction.text && + callToAction.href && ( + + {callToAction.icon && } + {callToAction.text} + + ) + ) + }
+
+
    + { + items && items.length + ? items.map(({ title: title2, description, icon }, index) => ( +
  • +
    + + {icon ? : index + 1} + +
    +
    +

    +

    +

    +
  • + )) + : '' + } +
+
-
+ diff --git a/src/pages/about.astro b/src/pages/about.astro index 063f241..bc256e2 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -118,9 +118,38 @@ const metadata = { + + + + diff --git a/src/types.d.ts b/src/types.d.ts index 17fa9e0..5298748 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -233,6 +233,7 @@ export interface Steps extends Headline, Widget { icon?: string; classes?: Record; }>; + callToAction?: string | CallToAction; image?: string | Image; isReversed?: boolean; }