From e6ccd3803a35cde37487c1e109d5043aa0a5e85a Mon Sep 17 00:00:00 2001 From: Scott <2660603+ShoGinn@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:01:30 -0400 Subject: [PATCH] chore: correct types --- src/components/blog/RelatedPosts.astro | 12 +++---- src/components/blog/SinglePost.astro | 1 - src/components/widgets/Content.astro | 2 +- src/components/widgets/Features.astro | 38 +++++++++-------------- src/components/widgets/Features2.astro | 38 +++++++++-------------- src/components/widgets/Features3.astro | 4 +-- src/components/widgets/Hero.astro | 2 +- src/components/widgets/Hero2.astro | 2 +- src/components/widgets/Steps.astro | 34 ++++++++++---------- src/components/widgets/Testimonials.astro | 3 +- 10 files changed, 57 insertions(+), 79 deletions(-) diff --git a/src/components/blog/RelatedPosts.astro b/src/components/blog/RelatedPosts.astro index 04337a5..8d55ecd 100644 --- a/src/components/blog/RelatedPosts.astro +++ b/src/components/blog/RelatedPosts.astro @@ -1,10 +1,10 @@ --- -import { APP_BLOG } from "astrowind:config"; +import { APP_BLOG } from 'astrowind:config'; -import { fetchPosts, getRelatedPosts } from "~/utils/blog"; -import BlogHighlightedPosts from "../widgets/BlogHighlightedPosts.astro"; -import type { Post } from "~/types"; -import { getBlogPermalink } from "~/utils/permalinks"; +import { getRelatedPosts } from '~/utils/blog'; +import BlogHighlightedPosts from '../widgets/BlogHighlightedPosts.astro'; +import type { Post } from '~/types'; +import { getBlogPermalink } from '~/utils/permalinks'; export interface Props { post: Post; @@ -18,7 +18,7 @@ const relatedPosts = post.tags ? await getRelatedPosts(post, 4) : []; { APP_BLOG.isRelatedPostsEnabled ? ( diff --git a/src/components/widgets/Content.astro b/src/components/widgets/Content.astro index 9ce5421..533ba92 100644 --- a/src/components/widgets/Content.astro +++ b/src/components/widgets/Content.astro @@ -82,7 +82,7 @@ const { widths={[400, 768]} sizes="(max-width: 768px) 100vw, 432px" layout="responsive" - {...(image as any)} + {...image} /> )} diff --git a/src/components/widgets/Features.astro b/src/components/widgets/Features.astro index b1faa9c..8f42b62 100644 --- a/src/components/widgets/Features.astro +++ b/src/components/widgets/Features.astro @@ -1,13 +1,13 @@ --- -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import ItemGrid from "~/components/ui/ItemGrid.astro"; -import Headline from "~/components/ui/Headline.astro"; -import type { Features as Props } from "~/types"; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import ItemGrid from '~/components/ui/ItemGrid.astro'; +import Headline from '~/components/ui/Headline.astro'; +import type { Features as Props } from '~/types'; const { - title = await Astro.slots.render("title"), - subtitle = await Astro.slots.render("subtitle"), - tagline = await Astro.slots.render("tagline"), + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), items = [], columns = 2, @@ -16,31 +16,21 @@ const { id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; --- - - } - /> + + } /> ) ?? {}), }} /> diff --git a/src/components/widgets/Features2.astro b/src/components/widgets/Features2.astro index 6ce5cf0..282337e 100644 --- a/src/components/widgets/Features2.astro +++ b/src/components/widgets/Features2.astro @@ -1,13 +1,13 @@ --- -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import Headline from "~/components/ui/Headline.astro"; -import ItemGrid2 from "~/components/ui/ItemGrid2.astro"; -import type { Features as Props } from "~/types"; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import Headline from '~/components/ui/Headline.astro'; +import ItemGrid2 from '~/components/ui/ItemGrid2.astro'; +import type { Features as Props } from '~/types'; const { - title = await Astro.slots.render("title"), - subtitle = await Astro.slots.render("subtitle"), - tagline = await Astro.slots.render("tagline"), + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), items = [], columns = 3, defaultIcon, @@ -15,34 +15,24 @@ const { id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; --- - - } - /> + + } /> ) ?? {}), }} /> diff --git a/src/components/widgets/Features3.astro b/src/components/widgets/Features3.astro index 076518e..62ab475 100644 --- a/src/components/widgets/Features3.astro +++ b/src/components/widgets/Features3.astro @@ -46,7 +46,7 @@ const { height={320} widths={[400, 768]} layout="fullWidth" - {...(image as any)} + {...image} /> )} @@ -64,7 +64,7 @@ const { title: 'text-lg font-semibold', description: 'mt-0.5', icon: 'flex-shrink-0 mt-1 text-primary w-6 h-6', - ...((classes?.items as {}) ?? {}), + ...((classes?.items as object) ?? {}), }} /> diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro index 20a1ba7..e8ce3ee 100644 --- a/src/components/widgets/Hero.astro +++ b/src/components/widgets/Hero.astro @@ -10,7 +10,7 @@ export interface Props { tagline?: string; content?: string; actions?: string | CallToAction[]; - image?: string | any; // TODO: find HTMLElementProps + image?: string | unknown; // TODO: find HTMLElementProps } const { diff --git a/src/components/widgets/Hero2.astro b/src/components/widgets/Hero2.astro index 5eb3202..6180265 100644 --- a/src/components/widgets/Hero2.astro +++ b/src/components/widgets/Hero2.astro @@ -9,7 +9,7 @@ export interface Props { tagline?: string; content?: string; actions?: string | CallToAction[]; - image?: string | any; // TODO: find HTMLElementProps + image?: string | unknown; // TODO: find HTMLElementProps } const { diff --git a/src/components/widgets/Steps.astro b/src/components/widgets/Steps.astro index 160a729..3c65bf6 100644 --- a/src/components/widgets/Steps.astro +++ b/src/components/widgets/Steps.astro @@ -21,8 +21,8 @@ const { --- -
-
+
+
- + } />
{ image && (
- {(typeof image === 'string' ? ( - + {typeof image === 'string' ? ( + ) : ( - {image?.alt - ))} + {image?.alt + )}
) } diff --git a/src/components/widgets/Testimonials.astro b/src/components/widgets/Testimonials.astro index f40db05..98a7d50 100644 --- a/src/components/widgets/Testimonials.astro +++ b/src/components/widgets/Testimonials.astro @@ -5,7 +5,6 @@ import Button from '~/components/ui/Button.astro'; import Image from '~/components/common/Image.astro'; import type { Testimonials as Props } from '~/types'; - const { title = '', subtitle = '', @@ -50,7 +49,7 @@ const { height={40} widths={[400, 768]} layout="fixed" - {...(image as any)} + {...image} /> )}