dark mode and light mode support
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { GetServerSideProps } from "next";
|
||||
import { MainLayout } from "../../layouts/MainLayout";
|
||||
import { Post, getAllBlogsFrontMatter } from "../../utils/markdown";
|
||||
import { FrontMatter } from "../../types/types";
|
||||
import Link from "next/link";
|
||||
import { formatDate } from "../../utils/general";
|
||||
import { BasicArticleProps } from "../../components/PostHeader";
|
||||
@@ -14,12 +13,14 @@ const BlogCard = ({
|
||||
slug: string;
|
||||
}) => {
|
||||
return (
|
||||
<div className="p-4 rounded-md border border-gray-700">
|
||||
<div className="p-4 rounded-md border border-gray-200 shadow-md shadow-gray-200 dark:border-gray-700">
|
||||
<div className="text-sm font-medium text-gray-500">
|
||||
{formatDate(blog.date)}
|
||||
</div>
|
||||
<h2 className="text-2xl font-bold">{blog.title}</h2>
|
||||
<p className="text-gray-400 text-lg">{blog.description}</p>
|
||||
<p className="text-gray-600 dark:text-gray-400 text-lg">
|
||||
{blog.description}
|
||||
</p>
|
||||
<Link href={`blog/${slug}`}>
|
||||
<button className="bg-action px-2 py-1 rounded-md mt-4 hover:bg-action/60 transition-all ease-in duration-100 font-bold text-white">
|
||||
Read more
|
||||
@@ -32,9 +33,9 @@ const BlogCard = ({
|
||||
const Blog = ({ posts }: { posts: Post[] }) => {
|
||||
return (
|
||||
<MainLayout>
|
||||
<h1 className="text-3xl font-bold">Blog</h1>
|
||||
<div className="w-full h-0.5 bg-white/50 my-4 rounded-full" />
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<h1 className="text-3xl font-bold text-gray-800">Blog</h1>
|
||||
<div className="w-full h-0.5 bg-gray-200 dark:bg-gray-800 my-4 rounded-full" />
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{posts.map((post, index) => (
|
||||
<BlogCard
|
||||
key={index}
|
||||
|
||||
Reference in New Issue
Block a user