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
-2
@@ -1,10 +1,9 @@
|
||||
import { FC } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Head from 'next/head';
|
||||
import IconButton from '../components/IconButton';
|
||||
import { Wrapper } from '../styles/404';
|
||||
|
||||
const NotFound: FC = () => {
|
||||
const NotFound = () => {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import React, { FC, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { useForm, ValidationError } from '@formspree/react';
|
||||
import Head from 'next/head';
|
||||
import { Wrapper } from '../styles/contact';
|
||||
import Input from '../components/Input';
|
||||
import MDXButton from '../components/MDXButton';
|
||||
|
||||
const About: FC = () => {
|
||||
const About = () => {
|
||||
const [form, setForm] = useState<{ name: string; email: string; message: string }>({
|
||||
name: '',
|
||||
email: '',
|
||||
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
import { FC } from 'react';
|
||||
import { getPortfolioProjects } from '../utils/portfolio';
|
||||
import { getBlogPosts } from '../utils/blog';
|
||||
import { GetStaticProps } from 'next';
|
||||
@@ -26,7 +25,7 @@ interface Props {
|
||||
}[];
|
||||
}
|
||||
|
||||
const Index: FC<Props> = ({ blogPosts, portfolioProjects }) => {
|
||||
const Index = ({ blogPosts, portfolioProjects }: Props) => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useEffect } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { getPortfolioPorjectsSlugs, getPortfolioProjectdata } from '../../utils/portfolio';
|
||||
import { useRouter } from 'next/router';
|
||||
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote';
|
||||
@@ -18,7 +18,7 @@ interface Props {
|
||||
frontMatter: any;
|
||||
}
|
||||
|
||||
const PortfolioProject: FC<Props> = ({ source, frontMatter }) => {
|
||||
const PortfolioProject = ({ source, frontMatter }: Props) => {
|
||||
const router = useRouter();
|
||||
const htmlOverrides = { code: CodeBlock };
|
||||
const mdxComponents = { Button: MDXButton };
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React, { FC } from 'react';
|
||||
import { getPortfolioProjects } from '../../utils/portfolio';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Wrapper } from '../../styles/portfolio';
|
||||
@@ -17,7 +16,7 @@ interface Props {
|
||||
}[];
|
||||
}
|
||||
|
||||
const Index: FC<Props> = ({ portfolioProjects }) => {
|
||||
const Index = ({ portfolioProjects }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user