-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8d50f4
commit 8b6d6f3
Showing
25 changed files
with
402 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
node_modules/ | ||
.cache/ | ||
public | ||
.DS_Store | ||
yarn-error.log | ||
.env* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"Main": { | ||
"uid": { | ||
"type": "UID", | ||
"config": { | ||
"label": "slug" | ||
} | ||
}, | ||
"title": { | ||
"type": "StructuredText", | ||
"config": { | ||
"single": "heading1,heading2,heading3,heading4,heading5,heading6", | ||
"label": "title" | ||
} | ||
}, | ||
"cover": { | ||
"type": "Image", | ||
"config": { | ||
"constraint": {}, | ||
"thumbnails": [], | ||
"label": "cover" | ||
} | ||
}, | ||
"description": { | ||
"type": "Text", | ||
"config": { | ||
"label": "description" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exports.createPages = require("./src/gatsby/node/createPages"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports.data = { | ||
works: `{ | ||
allPrismicWorks(sort: {first_publication_date: DESC}) { | ||
edges { | ||
node { | ||
uid | ||
data { | ||
cover { | ||
gatsbyImageData | ||
alt | ||
} | ||
title { | ||
text | ||
} | ||
description | ||
} | ||
} | ||
} | ||
} | ||
}`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const query = require("../data/query"); | ||
const path = require(`path`); | ||
|
||
module.exports = async ({ graphql, actions }) => { | ||
const { createPage } = actions; | ||
|
||
// Create a page for each post | ||
const worksQuery = await graphql(query.data.works); | ||
const works = worksQuery.data.allPrismicWorks.edges; | ||
works.forEach((work, i) => { | ||
const selected = work.node; | ||
const previous = i === works.length - 1 ? null : works[i + 1].node; | ||
const next = i === 0 ? null : works[i - 1].node; | ||
createPage({ | ||
path: `/${work.node.uid}/`, | ||
component: path.resolve(`./src/templates/work.js`), | ||
context: { | ||
...selected, | ||
previous, | ||
next, | ||
}, | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,45 @@ | ||
import React, { Suspense } from "react"; | ||
import { Canvas } from "@react-three/fiber"; | ||
import { graphql } from "gatsby"; | ||
|
||
import Carousel from "../three/Carousel"; | ||
import "../style/styles.css"; | ||
|
||
const IndexPage = () => { | ||
const IndexPage = ({ data }) => { | ||
const works = data.allPrismicWorks.edges; | ||
return ( | ||
<> | ||
<Suspense fallback={null}> | ||
<Canvas> | ||
<Carousel /> | ||
<Carousel works={works} /> | ||
</Canvas> | ||
</Suspense> | ||
</> | ||
); | ||
}; | ||
|
||
export const query = graphql` | ||
query { | ||
allPrismicWorks(sort: { first_publication_date: DESC }) { | ||
edges { | ||
node { | ||
uid | ||
data { | ||
cover { | ||
gatsbyImageData(width: 1800, placeholder: BLURRED) | ||
alt | ||
} | ||
title { | ||
text | ||
} | ||
description | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export default IndexPage; | ||
|
||
export const Head = () => <title>Home Page</title>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
|
||
const work = ({ pageContext }) => { | ||
const { title, cover, description } = pageContext.data; | ||
const { next } = pageContext; | ||
|
||
return ( | ||
<> | ||
<div>{title.text}</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default work; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.