mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Refactoring components
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { FC, useEffect } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { getBlogPostsSlugs, getBlogPostdata } from '../../utils/blog';
|
||||
import { useRouter } from 'next/router';
|
||||
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote';
|
||||
@@ -19,7 +19,7 @@ interface Props {
|
||||
text: string;
|
||||
}
|
||||
|
||||
const BlogPost: FC<Props> = ({ source, frontMatter, text }) => {
|
||||
const BlogPost = ({ source, frontMatter, text }: Props) => {
|
||||
const router = useRouter();
|
||||
const stats = readingTime(text);
|
||||
const htmlOverrides = { code: CodeBlock };
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React, { FC } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getBlogPosts } from '../../utils/blog';
|
||||
import { Wrapper } from '../../styles/blog';
|
||||
@@ -18,7 +17,7 @@ interface Props {
|
||||
}[];
|
||||
}
|
||||
|
||||
const Index: FC<Props> = ({ blogPosts }) => {
|
||||
const Index = ({ blogPosts }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user