From fc13e8328a0cd5e81f8ec792c3273cf730375440 Mon Sep 17 00:00:00 2001 From: widgeter Date: Mon, 7 Aug 2023 18:56:09 +0200 Subject: [PATCH] Change images in the Features3 and Testimonials --- src/components/widgets/Content.astro | 22 +++------------------- src/components/widgets/Features3.astro | 22 ++++++++++++++++++++-- src/components/widgets/Testimonials.astro | 22 ++++++++++++++++------ src/pages/landing/mobile-app.astro | 18 +++++++++--------- src/types.d.ts | 8 +++++--- 5 files changed, 53 insertions(+), 39 deletions(-) diff --git a/src/components/widgets/Content.astro b/src/components/widgets/Content.astro index 8c3f678..7417285 100644 --- a/src/components/widgets/Content.astro +++ b/src/components/widgets/Content.astro @@ -1,23 +1,7 @@ --- import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; - -interface Item { - title: string; - description?: string; - icon?: string; -} - -export interface Props { - title?: string; - subtitle?: string; - tagline?: string; - content?: string; - items?: Array; - image?: string | any; // TODO: find HTMLElementProps - isReversed?: boolean; - isAfterContent?: boolean; -} +import type { Content } from '~/types'; const { title = await Astro.slots.render('title'), @@ -28,7 +12,7 @@ const { image = await Astro.slots.render('image'), isReversed = false, isAfterContent = false, -} = Astro.props; +} = Astro.props as Content; ---
@@ -95,7 +79,7 @@ const { widths={[400, 768]} sizes="(max-width: 768px) 100vw, 432px" aspectRatio="500:500" - {...image} + {...(image as any)} /> )} diff --git a/src/components/widgets/Features3.astro b/src/components/widgets/Features3.astro index 843652f..ea2575e 100644 --- a/src/components/widgets/Features3.astro +++ b/src/components/widgets/Features3.astro @@ -1,4 +1,5 @@ --- +import { Picture } from '@astrojs/image/components'; import Headline from '~/components/ui/Headline.astro'; import ItemGrid from '~/components/ui/ItemGrid.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; @@ -22,8 +23,25 @@ const { -
- {image && image.src && {image.alt} +
- {image && image.src && ( - {image.alt} + {image && ( +
+ {typeof image === 'string' ? ( + + ) : ( + + )} +
)}
diff --git a/src/pages/landing/mobile-app.astro b/src/pages/landing/mobile-app.astro index 76348dc..1331c76 100644 --- a/src/pages/landing/mobile-app.astro +++ b/src/pages/landing/mobile-app.astro @@ -88,8 +88,8 @@ const metadata = { }, ]} image={{ - src: 'https://cdn.pixabay.com/photo/2023/07/18/21/40/astronaut-8135685_1280.jpg', - alt: 'Astronaut Image', + src: import('~/assets/images/colors.jpg'), + alt: 'Colorful Image', }} /> @@ -125,8 +125,8 @@ const metadata = { }, ]} image={{ - src: 'https://cdn.pixabay.com/photo/2023/07/22/19/25/ai-generated-8144026_1280.jpg', - alt: 'Features Image', + src: import('~/assets/images/caos.jpg'), + alt: 'Colorful Image', }} > @@ -168,8 +168,8 @@ const metadata = { }, ]} image={{ - src: 'https://cdn.pixabay.com/photo/2020/07/25/22/26/rocket-5438053_1280.jpg', - alt: 'Benefits Image', + src: import('~/assets/images/vintage.jpg'), + alt: 'Vintage Image', }} > @@ -188,7 +188,7 @@ const metadata = { name: 'Cary Kennedy', job: 'Film director', image: { - src: 'https://cdn.pixabay.com/photo/2023/07/22/19/25/ai-generated-8144026_1280.jpg', + src: import('~/assets/images/colors.jpg'), alt: 'Cary Kennedy Image', }, }, @@ -198,7 +198,7 @@ const metadata = { name: 'Josh Wilkinson', job: 'Product Manager', image: { - src: 'https://cdn.pixabay.com/photo/2023/07/18/21/40/astronaut-8135685_1280.jpg', + src: import('~/assets/images/vintage.jpg'), alt: 'Josh Wilkinson Image', }, }, @@ -208,7 +208,7 @@ const metadata = { name: 'Sidney Hansen', job: 'Decorator', image: { - src: 'https://cdn.pixabay.com/photo/2020/07/25/22/26/rocket-5438053_1280.jpg', + src: import('~/assets/images/caos.jpg'), alt: 'Sidney Hansen Image', }, }, diff --git a/src/types.d.ts b/src/types.d.ts index 963d00b..6361d53 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -149,7 +149,7 @@ export interface Testimonial { testimonial?: string; name?: string; job?: string; - image?: Image; + image?: string | unknown; } // COMPONENTS @@ -207,7 +207,7 @@ export interface Clients extends Headline, Widget { } export interface Features extends Headline, Widget { - image?: Image; + image?: string | unknown; video?: Video; items: Array; columns: number; @@ -235,8 +235,10 @@ export interface Steps extends Headline, Widget { } export interface Content extends Headline, Widget { - image?: string; + content?: string; + image?: string | unknown; items?: Array; columns?: number; isReversed?: boolean; + isAfterContent?: boolean; }