- Shenanigans, page not found.
-
- You might want to check the url, or{' '}
- go back to the homepage. Or just check out
- some {tag} gifs, entirely your choice.
-
-
-
-
-
-
-
-
- >
- )
+async function getRandomGif() {
+ try {
+ let response = await giphyClient.random({ tag })
+ const gif = response.data.images.original.mp4
+ return gif
+ } catch (error) {
+ console.error(error.message)
}
}
+
+export default function NotFound() {
+ const [gif, setGif] = useState('')
+
+ async function handleClick(e) {
+ e.preventDefault()
+ const gif = await getRandomGif()
+ setGif(gif)
+ }
+
+ useEffect(() => {
+ async function init() {
+ const gif = await getRandomGif()
+ setGif(gif)
+ }
+ init()
+ }, [])
+
+ return (
+ <>
+
+ Shenanigans, page not found.
+
+ You might want to check the url, or{' '}
+ go back to the homepage. Or just check out some{' '}
+ {tag} gifs, entirely your choice.
+
+
+
+
+
+
+
+
+ >
+ )
+}
diff --git a/src/pages/__tests__/index.test.jsx b/tests/Home.test.jsx
similarity index 73%
rename from src/pages/__tests__/index.test.jsx
rename to tests/Home.test.jsx
index bc1db85..0f886ca 100644
--- a/src/pages/__tests__/index.test.jsx
+++ b/tests/Home.test.jsx
@@ -1,8 +1,8 @@
import React from 'react'
import { render } from '@testing-library/react'
-import Home from '../index'
-import projects from '../../../jest/__fixtures__/projects.json'
-import projectImageFiles from '../../../jest/__fixtures__/projectImageFiles.json'
+import Home from '../src/pages/index'
+import projects from './__fixtures__/projects.json'
+import projectImageFiles from './__fixtures__/projectImageFiles.json'
describe('Home', () => {
const data = {
diff --git a/src/pages/__tests__/Project.test.jsx b/tests/Project.test.jsx
similarity index 81%
rename from src/pages/__tests__/Project.test.jsx
rename to tests/Project.test.jsx
index 747f450..2b10469 100644
--- a/src/pages/__tests__/Project.test.jsx
+++ b/tests/Project.test.jsx
@@ -1,8 +1,8 @@
import React from 'react'
import { render } from '@testing-library/react'
import { createHistory, createMemorySource } from '@reach/router'
-import Project from '../{ProjectsYaml.slug}'
-import project from '../../../jest/__fixtures__/project.json'
+import Project from '../src/pages/{ProjectsYaml.slug}'
+import project from './__fixtures__/project.json'
describe('Project', () => {
const history = createHistory(createMemorySource('/oceanprotocol'))
diff --git a/jest/__fixtures__/meta.json b/tests/__fixtures__/meta.json
similarity index 100%
rename from jest/__fixtures__/meta.json
rename to tests/__fixtures__/meta.json
diff --git a/jest/__fixtures__/project.json b/tests/__fixtures__/project.json
similarity index 100%
rename from jest/__fixtures__/project.json
rename to tests/__fixtures__/project.json
diff --git a/jest/__fixtures__/projectImageFiles.json b/tests/__fixtures__/projectImageFiles.json
similarity index 100%
rename from jest/__fixtures__/projectImageFiles.json
rename to tests/__fixtures__/projectImageFiles.json
diff --git a/jest/__fixtures__/projects.json b/tests/__fixtures__/projects.json
similarity index 100%
rename from jest/__fixtures__/projects.json
rename to tests/__fixtures__/projects.json
diff --git a/jest/__fixtures__/repos.json b/tests/__fixtures__/repos.json
similarity index 100%
rename from jest/__fixtures__/repos.json
rename to tests/__fixtures__/repos.json
diff --git a/jest/__fixtures__/resume.json b/tests/__fixtures__/resume.json
similarity index 100%
rename from jest/__fixtures__/resume.json
rename to tests/__fixtures__/resume.json
diff --git a/jest/__mocks__/file-mock.js b/tests/__mocks__/file-mock.js
similarity index 100%
rename from jest/__mocks__/file-mock.js
rename to tests/__mocks__/file-mock.js
diff --git a/jest/__mocks__/gatsby.js b/tests/__mocks__/gatsby.js
similarity index 100%
rename from jest/__mocks__/gatsby.js
rename to tests/__mocks__/gatsby.js
diff --git a/jest/__mocks__/svgr-mock.js b/tests/__mocks__/svgr-mock.js
similarity index 100%
rename from jest/__mocks__/svgr-mock.js
rename to tests/__mocks__/svgr-mock.js
diff --git a/jest.config.js b/tests/jest.config.js
similarity index 59%
rename from jest.config.js
rename to tests/jest.config.js
index 260f999..40f340d 100644
--- a/jest.config.js
+++ b/tests/jest.config.js
@@ -1,12 +1,10 @@
module.exports = {
- transform: {
- '^.+\\.jsx?$': '