From 8480c0f5cabc20f4100142d9abe2fe2448a9d756 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Mon, 24 Oct 2022 14:44:35 +0800 Subject: [PATCH] small fix --- src/components/Image.js | 9 +++------ src/pages/posts/init.js | 3 +++ src/pages/posts/law.js | 6 ++++-- src/pages/posts/map.js | 3 +++ src/templates/law.js | 13 +++++++++---- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/components/Image.js b/src/components/Image.js index 1fbc01f..d32b36c 100644 --- a/src/components/Image.js +++ b/src/components/Image.js @@ -1,8 +1,7 @@ -import * as React from "react" -import {GatsbyImage, getImage} from "gatsby-plugin-image" +import {getImage} from "gatsby-plugin-image" import {useStaticQuery, graphql} from "gatsby" -const Image = ({name}) => { +const Image = (name) => { const { images: { edges: images } } = useStaticQuery(graphql` query { images: allFile(filter: {relativeDirectory: {eq: "images"}}) { @@ -21,9 +20,7 @@ query { const propName = name const imageData = images.find(({node: {name}}) => name === propName) const image = getImage(imageData.node) - return ( - - ) + return image } export default Image diff --git a/src/pages/posts/init.js b/src/pages/posts/init.js index 8b38359..cee1a87 100644 --- a/src/pages/posts/init.js +++ b/src/pages/posts/init.js @@ -2,6 +2,7 @@ import * as React from "react" import * as styles from "../../styles/Post.module.css" import * as homeStyles from "../../styles/Home.module.css" import Header from "../../components/Header" +import Footer from "../../components/Footer" import {StaticImage} from "gatsby-plugin-image" const InitPage = () => { @@ -57,6 +58,8 @@ const InitPage = () => {

+ +