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 { getRelatedPosts } from '~/utils/blog';
import BlogHighlightedPosts from "../widgets/BlogHighlightedPosts.astro"; import BlogHighlightedPosts from '../widgets/BlogHighlightedPosts.astro';
import type { Post } from "~/types"; import type { Post } from '~/types';
import { getBlogPermalink } from "~/utils/permalinks"; import { getBlogPermalink } from '~/utils/permalinks';
export interface Props { export interface Props {
post: Post; post: Post;
@@ -18,7 +18,7 @@ const relatedPosts = post.tags ? await getRelatedPosts(post, 4) : [];
{ {
APP_BLOG.isRelatedPostsEnabled ? ( APP_BLOG.isRelatedPostsEnabled ? (
<BlogHighlightedPosts <BlogHighlightedPosts
classes={{ container: "pt-0 lg:pt-0 md:pt-0" }} classes={{ container: 'pt-0 lg:pt-0 md:pt-0' }}
title="Related Posts" title="Related Posts"
linkText="View All Posts" linkText="View All Posts"
linkUrl={getBlogPermalink()} linkUrl={getBlogPermalink()}

View File

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

View File

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

View File

@@ -1,13 +1,13 @@
--- ---
import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro';
import ItemGrid from "~/components/ui/ItemGrid.astro"; import ItemGrid from '~/components/ui/ItemGrid.astro';
import Headline from "~/components/ui/Headline.astro"; import Headline from '~/components/ui/Headline.astro';
import type { Features as Props } from "~/types"; import type { Features as Props } from '~/types';
const { const {
title = await Astro.slots.render("title"), title = await Astro.slots.render('title'),
subtitle = await Astro.slots.render("subtitle"), subtitle = await Astro.slots.render('subtitle'),
tagline = await Astro.slots.render("tagline"), tagline = await Astro.slots.render('tagline'),
items = [], items = [],
columns = 2, columns = 2,
@@ -16,31 +16,21 @@ const {
id, id,
isDark = false, isDark = false,
classes = {}, classes = {},
bg = await Astro.slots.render("bg"), bg = await Astro.slots.render('bg'),
} = Astro.props; } = Astro.props;
--- ---
<WidgetWrapper <WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-5xl ${classes?.container ?? ''}`} bg={bg}>
id={id} <Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline as Record<string, string>} />
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 <ItemGrid
items={items} items={items}
columns={columns} columns={columns}
defaultIcon={defaultIcon} defaultIcon={defaultIcon}
classes={{ classes={{
container: "", container: '',
title: "md:text-[1.3rem]", 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", 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 {}) ?? {}), ...((classes?.items as Record<string, never>) ?? {}),
}} }}
/> />
</WidgetWrapper> </WidgetWrapper>

View File

@@ -1,13 +1,13 @@
--- ---
import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro';
import Headline from "~/components/ui/Headline.astro"; import Headline from '~/components/ui/Headline.astro';
import ItemGrid2 from "~/components/ui/ItemGrid2.astro"; import ItemGrid2 from '~/components/ui/ItemGrid2.astro';
import type { Features as Props } from "~/types"; import type { Features as Props } from '~/types';
const { const {
title = await Astro.slots.render("title"), title = await Astro.slots.render('title'),
subtitle = await Astro.slots.render("subtitle"), subtitle = await Astro.slots.render('subtitle'),
tagline = await Astro.slots.render("tagline"), tagline = await Astro.slots.render('tagline'),
items = [], items = [],
columns = 3, columns = 3,
defaultIcon, defaultIcon,
@@ -15,34 +15,24 @@ const {
id, id,
isDark = false, isDark = false,
classes = {}, classes = {},
bg = await Astro.slots.render("bg"), bg = await Astro.slots.render('bg'),
} = Astro.props; } = Astro.props;
--- ---
<WidgetWrapper <WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-7xl mx-auto ${classes?.container ?? ''}`} bg={bg}>
id={id} <Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline as Record<string, string>} />
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 <ItemGrid2
items={items} items={items}
columns={columns} columns={columns}
defaultIcon={defaultIcon} defaultIcon={defaultIcon}
classes={{ classes={{
container: "gap-4 md:gap-6", container: 'gap-4 md:gap-6',
panel: 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', '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: // 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", // "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", icon: 'w-12 h-12 mb-6 text-primary',
...((classes?.items as {}) ?? {}), ...((classes?.items as Record<string, never>) ?? {}),
}} }}
/> />
</WidgetWrapper> </WidgetWrapper>

View File

@@ -46,7 +46,7 @@ const {
height={320} height={320}
widths={[400, 768]} widths={[400, 768]}
layout="fullWidth" layout="fullWidth"
{...(image as any)} {...image}
/> />
)} )}
</div> </div>
@@ -64,7 +64,7 @@ const {
title: 'text-lg font-semibold', title: 'text-lg font-semibold',
description: 'mt-0.5', description: 'mt-0.5',
icon: 'flex-shrink-0 mt-1 text-primary w-6 h-6', icon: 'flex-shrink-0 mt-1 text-primary w-6 h-6',
...((classes?.items as {}) ?? {}), ...((classes?.items as object) ?? {}),
}} }}
/> />
</WidgetWrapper> </WidgetWrapper>

View File

@@ -10,7 +10,7 @@ export interface Props {
tagline?: string; tagline?: string;
content?: string; content?: string;
actions?: string | CallToAction[]; actions?: string | CallToAction[];
image?: string | any; // TODO: find HTMLElementProps image?: string | unknown; // TODO: find HTMLElementProps
} }
const { const {

View File

@@ -9,7 +9,7 @@ export interface Props {
tagline?: string; tagline?: string;
content?: string; content?: string;
actions?: string | CallToAction[]; actions?: string | CallToAction[];
image?: string | any; // TODO: find HTMLElementProps image?: string | unknown; // TODO: find HTMLElementProps
} }
const { const {

View File

@@ -21,8 +21,8 @@ const {
--- ---
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-5xl ${classes?.container ?? ''}`} bg={bg}> <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={['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 <Headline
title={title} title={title}
subtitle={subtitle} subtitle={subtitle}
@@ -30,28 +30,28 @@ const {
classes={{ classes={{
container: 'text-left rtl:text-right', container: 'text-left rtl:text-right',
title: 'text-3xl lg:text-4xl', 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> </div>
{ {
image && ( image && (
<div class="relative md:basis-1/2"> <div class="relative md:basis-1/2">
{(typeof image === 'string' ? ( {typeof image === 'string' ? (
<Fragment set:html={image} /> <Fragment set:html={image} />
) : ( ) : (
<Image <Image
class="inset-0 object-cover object-top w-full rounded-md shadow-lg md:absolute md:h-full bg-gray-400 dark:bg-slate-700" class="inset-0 object-cover object-top w-full rounded-md shadow-lg md:absolute md:h-full bg-gray-400 dark:bg-slate-700"
widths={[400, 768]} widths={[400, 768]}
sizes="(max-width: 768px) 100vw, 432px" sizes="(max-width: 768px) 100vw, 432px"
width={432} width={432}
height={768} height={768}
layout="cover" layout="cover"
src={image?.src} src={image?.src}
alt={image?.alt || ''} alt={image?.alt || ''}
/> />
))} )}
</div> </div>
) )
} }

View File

@@ -5,7 +5,6 @@ import Button from '~/components/ui/Button.astro';
import Image from '~/components/common/Image.astro'; import Image from '~/components/common/Image.astro';
import type { Testimonials as Props } from '~/types'; import type { Testimonials as Props } from '~/types';
const { const {
title = '', title = '',
subtitle = '', subtitle = '',
@@ -50,7 +49,7 @@ const {
height={40} height={40}
widths={[400, 768]} widths={[400, 768]}
layout="fixed" layout="fixed"
{...(image as any)} {...image}
/> />
)} )}
</div> </div>