Skip to content

Commit 2a62d5b

Browse files
committed
use new gatsby StaticImage component in example
1 parent cc07c23 commit 2a62d5b

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

example/gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
},
1010
plugins: [
1111
`gatsby-plugin-react-helmet`,
12+
`gatsby-plugin-image`,
1213
{
1314
resolve: `gatsby-source-filesystem`,
1415
options: {

example/src/components/image.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

example/src/pages/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import React from 'react';
44
import {Link, Trans, useTranslation} from 'gatsby-plugin-react-i18next';
55
import {graphql, Link as GatsbyLink} from 'gatsby';
6+
import {StaticImage} from 'gatsby-plugin-image';
67
import Layout from '../components/layout';
7-
import Image from '../components/image';
88
import SEO from '../components/seo';
99

1010
const IndexPage = () => {
@@ -22,7 +22,13 @@ const IndexPage = () => {
2222
<Trans>Now go build something great.</Trans>
2323
</p>
2424
<div style={{maxWidth: `300px`, marginBottom: `1.45rem`}}>
25-
<Image />
25+
<StaticImage
26+
src="../images/gatsby-astronaut.png"
27+
alt="Hi people"
28+
placeholder="none"
29+
width={300}
30+
height={300}
31+
/>
2632
</div>
2733
<p>
2834
<Link to="/page-2/">

0 commit comments

Comments
 (0)