chore: correct types

This commit is contained in:
Scott
2024-04-28 17:01:30 -04:00
parent d61da4c086
commit e6ccd3803a
10 changed files with 57 additions and 79 deletions

View File

@@ -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 ? (
<BlogHighlightedPosts
classes={{ container: "pt-0 lg:pt-0 md:pt-0" }}
classes={{ container: 'pt-0 lg:pt-0 md:pt-0' }}
title="Related Posts"
linkText="View All Posts"
linkUrl={getBlogPermalink()}

View File

@@ -16,7 +16,6 @@ export interface Props {
}
const { post, url } = Astro.props;
const { Content } = post;
---
<section class="py-8 sm:py-16 lg:py-20 mx-auto">

View File

@@ -82,7 +82,7 @@ const {
widths={[400, 768]}
sizes="(max-width: 768px) 100vw, 432px"
layout="responsive"
{...(image as any)}
{...image}
/>
)}
</div>

View File

@@ -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;
---
<WidgetWrapper
id={id}
isDark={isDark}
containerClass={`max-w-5xl ${classes?.container ?? ""}`}
bg={bg}
>
<Headline
title={title}
subtitle={subtitle}
tagline={tagline}
classes={classes?.headline as Record<string, string>}
/>
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-5xl ${classes?.container ?? ''}`} bg={bg}>
<Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline as Record<string, string>} />
<ItemGrid
items={items}
columns={columns}
defaultIcon={defaultIcon}
classes={{
container: "",
title: "md:text-[1.3rem]",
icon: "text-white bg-primary rounded-full w-10 h-10 p-2 md:w-12 md:h-12 md:p-3 mr-4 rtl:ml-4 rtl:mr-0",
...((classes?.items as {}) ?? {}),
container: '',
title: 'md:text-[1.3rem]',
icon: 'text-white bg-primary rounded-full w-10 h-10 p-2 md:w-12 md:h-12 md:p-3 mr-4 rtl:ml-4 rtl:mr-0',
...((classes?.items as Record<string, never>) ?? {}),
}}
/>
</WidgetWrapper>

View File

@@ -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;
---
<WidgetWrapper
id={id}
isDark={isDark}
containerClass={`max-w-7xl mx-auto ${classes?.container ?? ''}`}
bg={bg}
>
<Headline
title={title}
subtitle={subtitle}
tagline={tagline}
classes={classes?.headline as Record<string, string>}
/>
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-7xl mx-auto ${classes?.container ?? ''}`} bg={bg}>
<Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline as Record<string, string>} />
<ItemGrid2
items={items}
columns={columns}
defaultIcon={defaultIcon}
classes={{
container: "gap-4 md:gap-6",
container: 'gap-4 md:gap-6',
panel:
'rounded-lg shadow-[0_4px_30px_rgba(0,0,0,0.1)] dark:shadow-[0_4px_30px_rgba(0,0,0,0.1)] backdrop-blur border border-[#ffffff29] bg-white dark:bg-slate-900 p-6',
// panel:
// "text-center bg-page items-center md:text-left rtl:md:text-right md:items-start p-6 p-6 rounded-md shadow-xl dark:shadow-none dark:border dark:border-slate-800",
icon: "w-12 h-12 mb-6 text-primary",
...((classes?.items as {}) ?? {}),
icon: 'w-12 h-12 mb-6 text-primary',
...((classes?.items as Record<string, never>) ?? {}),
}}
/>
</WidgetWrapper>

View File

@@ -46,7 +46,7 @@ const {
height={320}
widths={[400, 768]}
layout="fullWidth"
{...(image as any)}
{...image}
/>
)}
</div>
@@ -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) ?? {}),
}}
/>
</WidgetWrapper>

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -22,7 +22,7 @@ const {
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-5xl ${classes?.container ?? ''}`} bg={bg}>
<div class:list={['flex flex-col gap-8 md:gap-12', { 'md:flex-row-reverse': isReversed }, { 'md:flex-row': image }]}>
<div class:list={["md:py-4 md:self-center", { 'md:basis-1/2': image }, { "w-full": !image}]}>
<div class:list={['md:py-4 md:self-center', { 'md:basis-1/2': image }, { 'w-full': !image }]}>
<Headline
title={title}
subtitle={subtitle}
@@ -30,15 +30,15 @@ const {
classes={{
container: 'text-left rtl:text-right',
title: 'text-3xl lg:text-4xl',
...((classes?.headline as {}) ?? {}),
...((classes?.headline as object) ?? {}),
}}
/>
<Timeline items={items} classes={classes?.items as {}} />
<Timeline items={items} classes={classes?.items as Record<string, never>} />
</div>
{
image && (
<div class="relative md:basis-1/2">
{(typeof image === 'string' ? (
{typeof image === 'string' ? (
<Fragment set:html={image} />
) : (
<Image
@@ -51,7 +51,7 @@ const {
src={image?.src}
alt={image?.alt || ''}
/>
))}
)}
</div>
)
}

View File

@@ -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}
/>
)}
</div>