adding prop types
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
const { pathname } = Astro.url;
|
const { pathname } = Astro.url;
|
||||||
|
|
||||||
const navLinks = [
|
type NavLink = {
|
||||||
|
label: string;
|
||||||
|
path: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const navLinks: NavLink[] = [
|
||||||
{ label: '📝 Blog', path: '/' },
|
{ label: '📝 Blog', path: '/' },
|
||||||
{ label: '👤 About', path: '/about/' },
|
{ label: '👤 About', path: '/about/' },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -2,8 +2,17 @@
|
|||||||
import BlogHeader from '@components/BlogHeader.astro';
|
import BlogHeader from '@components/BlogHeader.astro';
|
||||||
import Tags from '@components/Tags.astro';
|
import Tags from '@components/Tags.astro';
|
||||||
|
|
||||||
|
interface Post {
|
||||||
|
data: {
|
||||||
|
title: string;
|
||||||
|
pubDate: Date;
|
||||||
|
tags: string[];
|
||||||
|
};
|
||||||
|
slug: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
post: Object;
|
post: Post;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { post } = Astro.props;
|
const { post } = Astro.props;
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
interface Props {
|
||||||
|
tags: string[];
|
||||||
|
}
|
||||||
|
|
||||||
const { tags } = Astro.props;
|
const { tags } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user