Skip to content

Commit

Permalink
fix category typo
Browse files Browse the repository at this point in the history
  • Loading branch information
saml33 committed Jan 9, 2024
1 parent c2f45b8 commit 26f146e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/(pages)/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ async function BlogPage() {
{blogPosts && blogPosts.length ? (
<div className="grid grid-cols-3 gap-6">
{blogPosts.map((blogPost) => {
return <PostCard blogPost={blogPost} key={blogPost.slug} />
return (
<PostCard blogPost={blogPost} key={blogPost.slug} type="blog" />
)
})}
</div>
) : (
Expand Down
8 changes: 7 additions & 1 deletion app/(pages)/learn/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ async function LearnPage() {
{learnPosts && learnPosts.length ? (
<div className="grid grid-cols-3 gap-6">
{learnPosts.map((learnPost) => {
return <PostCard blogPost={learnPost} key={learnPost.slug} />
return (
<PostCard
blogPost={learnPost}
key={learnPost.slug}
type="learn"
/>
)
})}
</div>
) : (
Expand Down
10 changes: 8 additions & 2 deletions app/components/blog/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ import { BlogPost } from '../../../contentful/blogPost'
import CardImage from '../shared/CardImage'
import dayjs from 'dayjs'

const PostCard = ({ blogPost }: { blogPost: BlogPost }) => {
const PostCard = ({
blogPost,
type,
}: {
blogPost: BlogPost
type: 'blog' | 'learn'
}) => {
const { author, createdAt, postDescription, postTitle, slug } = blogPost
return (
<div
className="col-span-4 sm:col-span-2 lg:col-span-1 border border-th-bkg-3 rounded-xl group relative"
key={slug}
>
<Link href={`/learn/${slug}`}>
<Link href={`/${type}/${slug}`}>
<div className="overflow-hidden rounded-t-xl">
<CardImage />
</div>
Expand Down
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const nextConfig = {
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/governanace',
destination: '/explore/categories/governance',
// 308 redirect
permanent: true,
},
]
},
webpack: (config, opts) => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

1 comment on commit 26f146e

@vercel
Copy link

@vercel vercel bot commented on 26f146e Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.