2020-07-17 14:59:20 +02:00
|
|
|
const createFields = require('./gatsby/createFields')
|
|
|
|
const createMarkdownPages = require('./gatsby/createMarkdownPages')
|
2020-11-09 14:31:04 +01:00
|
|
|
const execSync = require('child_process').execSync
|
|
|
|
|
|
|
|
// Write out repo metadata
|
2021-01-21 16:02:48 +01:00
|
|
|
execSync(`node ./scripts/write-repo-metadata > repo-metadata.json`, {
|
|
|
|
stdio: 'inherit'
|
|
|
|
})
|
|
|
|
|
2021-07-02 08:44:24 +02:00
|
|
|
// Generate GraphQl typings for urql
|
2021-07-09 10:36:43 +02:00
|
|
|
// execSync(`npm run graphql:graphTypes`, { stdio: 'inherit' })
|
|
|
|
|
|
|
|
// Generate Apollo typings
|
|
|
|
execSync(`npm run apollo:codegen`, { stdio: 'inherit' })
|
2020-07-17 14:59:20 +02:00
|
|
|
|
2021-03-04 18:16:20 +01:00
|
|
|
// Fetch EVM networks metadata
|
|
|
|
execSync(
|
|
|
|
`node ./scripts/write-networks-metadata > content/networks-metadata.json`,
|
|
|
|
{
|
|
|
|
stdio: 'inherit'
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-07-17 14:59:20 +02:00
|
|
|
exports.onCreateNode = ({ node, actions, getNode }) => {
|
|
|
|
createFields(node, actions, getNode)
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.createPages = async ({ graphql, actions }) => {
|
|
|
|
await createMarkdownPages(graphql, actions)
|
2020-06-30 13:32:16 +02:00
|
|
|
}
|
2020-07-01 17:11:45 +02:00
|
|
|
|
2020-07-07 10:26:38 +02:00
|
|
|
exports.onCreatePage = async ({ page, actions }) => {
|
|
|
|
const { createPage } = actions
|
|
|
|
// page.matchPath is a special key that's used for matching pages
|
|
|
|
// only on the client.
|
2021-08-04 14:21:57 +02:00
|
|
|
const handleClientSideOnlyAsset = page.path.match(/^\/asset/)
|
Account metadata header (#776)
* get all neded data for the header from 3box, aqua and subgraph
* fix tvl display error
* WIP metadata header styling
* added more styling for the header
* make page title optional so we can remove it on account page
* stroke change for svg images and default values
* more styling added to the header
* fixed linter
* added ocean balance to tvl
* update styling for statistcs
* fixed eror for go to my account from another account page
* updated styling for mobile use
* wip show more on explorer links and description
* properly display read more for explorer links and description
* replaced show more with 3box redirect on description
* change accounts default picture and check links length before display element
* use optional on links
* grid cleanup, new number unit, split up stats
* rename all the things, more profile header styling
* visual hierarchy, improve image loading experience
* layout flow & visual tweaks
* more description
* replaced account route with profile when accesing a profile by the eth address
* use account id from url if exists when fetching data
* bump @oceanprotocol/art to v3.2.0
* styling, fallbacks, edge case fixes
* clean up Publisher atom, link to profile page
* fixed issue when switching to my profile from another profile
* output accountId, make it copyable, remove stats icons
* render tweaks, markup cleanup
* add 3box reference
* mobile tabs spacing tweaks
* text flow and spacing tweaks
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-09-01 13:56:34 +02:00
|
|
|
const handleClientSideOnlyAccount = page.path.match(/^\/profile/)
|
2021-08-04 14:21:57 +02:00
|
|
|
|
2021-08-04 14:55:27 +02:00
|
|
|
if (handleClientSideOnlyAsset) {
|
|
|
|
page.matchPath = '/asset/*'
|
2020-07-07 10:26:38 +02:00
|
|
|
// Update the page.
|
|
|
|
createPage(page)
|
2021-08-04 14:55:27 +02:00
|
|
|
} else if (handleClientSideOnlyAccount) {
|
Account metadata header (#776)
* get all neded data for the header from 3box, aqua and subgraph
* fix tvl display error
* WIP metadata header styling
* added more styling for the header
* make page title optional so we can remove it on account page
* stroke change for svg images and default values
* more styling added to the header
* fixed linter
* added ocean balance to tvl
* update styling for statistcs
* fixed eror for go to my account from another account page
* updated styling for mobile use
* wip show more on explorer links and description
* properly display read more for explorer links and description
* replaced show more with 3box redirect on description
* change accounts default picture and check links length before display element
* use optional on links
* grid cleanup, new number unit, split up stats
* rename all the things, more profile header styling
* visual hierarchy, improve image loading experience
* layout flow & visual tweaks
* more description
* replaced account route with profile when accesing a profile by the eth address
* use account id from url if exists when fetching data
* bump @oceanprotocol/art to v3.2.0
* styling, fallbacks, edge case fixes
* clean up Publisher atom, link to profile page
* fixed issue when switching to my profile from another profile
* output accountId, make it copyable, remove stats icons
* render tweaks, markup cleanup
* add 3box reference
* mobile tabs spacing tweaks
* text flow and spacing tweaks
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-09-01 13:56:34 +02:00
|
|
|
page.matchPath = '/profile/*'
|
2021-08-04 14:55:27 +02:00
|
|
|
createPage(page)
|
2020-07-07 10:26:38 +02:00
|
|
|
}
|
|
|
|
}
|
2020-07-17 14:59:20 +02:00
|
|
|
|
|
|
|
exports.onCreateWebpackConfig = ({ actions }) => {
|
|
|
|
actions.setWebpackConfig({
|
|
|
|
node: {
|
2021-05-20 00:44:22 +02:00
|
|
|
// 'fs' fix for ocean.js
|
2020-07-17 14:59:20 +02:00
|
|
|
fs: 'empty'
|
|
|
|
},
|
|
|
|
// fix for 'got'/'swarm-js' dependency
|
2021-03-17 11:44:26 +01:00
|
|
|
externals: ['got']
|
2020-07-17 14:59:20 +02:00
|
|
|
})
|
|
|
|
}
|