From 14387a5413813c9f486058960eb498491631c1fa Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Fri, 27 Nov 2020 16:12:09 -0500 Subject: [PATCH] added type declarations --- src/pages/projects/index.tsx | 4 ++-- src/templates/note.tsx | 11 +++-------- src/templates/notes.tsx | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/pages/projects/index.tsx b/src/pages/projects/index.tsx index ca65776..946ea72 100644 --- a/src/pages/projects/index.tsx +++ b/src/pages/projects/index.tsx @@ -2,7 +2,7 @@ import React from "react"; import Navbar from '../../components/navbar'; import Item from "../../components/item"; -export default () => ( +export default (): JSX.Element => ( <> ( subtitle="subtitle" /> -); \ No newline at end of file +); diff --git a/src/templates/note.tsx b/src/templates/note.tsx index 7437ed6..9d4152a 100644 --- a/src/templates/note.tsx +++ b/src/templates/note.tsx @@ -3,13 +3,8 @@ import Navbar from '../components/navbar'; import { graphql } from "gatsby"; import { MDXRenderer } from 'gatsby-plugin-mdx'; -export default ({ - data -}) => { - let { - frontmatter, - body - } = data.mdx; +export default ({ data }) => { + const { frontmatter, body } = data.mdx; return <> @@ -29,4 +24,4 @@ query NotesIndexQuery($id: String!) { tableOfContents body } -}`; \ No newline at end of file +}`; diff --git a/src/templates/notes.tsx b/src/templates/notes.tsx index 3f0497c..b2acae6 100644 --- a/src/templates/notes.tsx +++ b/src/templates/notes.tsx @@ -8,7 +8,7 @@ import Navbar from "../components/navbar"; import { graphql } from "gatsby"; import style from "./notes.module.css"; -export default ({ data, pageContext }) => { +export default ({ data, pageContext }): JSX.Element => { const posts = data.allMdx.edges; const { currentPage, numPages, rootPath } = pageContext; let prevPageLink = null;