mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
* Creating custom provider box selection * adding provider to Form publish validation schema * validating custom provider URL * WIP validation for custom provider * validating provider uri * adding success/ error messages * conditional rendering of custom provider input * remove console.log * fixing textFormData * Publishing custom provider URI in DDO * Adding serviceEndpoint to Debug * removing pre-checked default provider * Refactoring to reduce code duplication * removing console.log messages * update submit text * update submit text * Placing custom provider field behind Advanced Settings * removing provider field * updating placeholder provider * style for advanced setting button * refactoring customProvider * remocing template literal * fixing linting errors * restricting advanced publishing settings through env var * updating example env * adding custom provider to formAlgoPublish * refactoring to reduce duplication * Reducing duplication * updating types and initial values * Removing Custom provider input from main algorithm form * Removing concole.log * Chaning customProvider to providerUri * changing customProvider to providerUri * advanceSettings to PascalCase * Removing unused useOcean() * Using useSiteMetadata() hook * Adding allowAdvancedPublishSettings to query * Adding temporary console.log(ocean) * Removing console.log
108 lines
2.1 KiB
TypeScript
108 lines
2.1 KiB
TypeScript
import { useStaticQuery, graphql } from 'gatsby'
|
|
|
|
interface UseSiteMetadata {
|
|
siteTitle: string
|
|
siteTagline: string
|
|
siteUrl: string
|
|
siteIcon: string
|
|
siteImage: { childImageSharp: { original: { src: string } } }
|
|
copyright: string
|
|
menu: {
|
|
name: string
|
|
link: string
|
|
}[]
|
|
warning: {
|
|
main: string
|
|
polygonPublish: string
|
|
}
|
|
announcement: {
|
|
main: string
|
|
polygon: string
|
|
}
|
|
appConfig: {
|
|
metadataCacheUri: string
|
|
infuraProjectId: string
|
|
chainIds: number[]
|
|
chainIdsSupported: number[]
|
|
marketFeeAddress: string
|
|
currencies: string[]
|
|
portisId: string
|
|
allowFixedPricing: string
|
|
allowDynamicPricing: string
|
|
allowFreePricing: string
|
|
allowAdvancedSettings: string
|
|
credentialType: string
|
|
allowAdvancedPublishSettings: string
|
|
}
|
|
}
|
|
|
|
const query = graphql`
|
|
query {
|
|
site {
|
|
siteMetadata {
|
|
siteTitle
|
|
siteTagline
|
|
siteUrl
|
|
siteIcon
|
|
copyright
|
|
menu {
|
|
name
|
|
link
|
|
}
|
|
warning {
|
|
main
|
|
polygonPublish
|
|
}
|
|
announcement {
|
|
main
|
|
polygon
|
|
}
|
|
appConfig {
|
|
metadataCacheUri
|
|
infuraProjectId
|
|
chainIds
|
|
chainIdsSupported
|
|
marketFeeAddress
|
|
currencies
|
|
portisId
|
|
allowFixedPricing
|
|
allowDynamicPricing
|
|
allowFreePricing
|
|
allowAdvancedSettings
|
|
allowAdvancedPublishSettings
|
|
credentialType
|
|
}
|
|
}
|
|
}
|
|
|
|
siteImage: allFile(filter: { relativePath: { eq: "site.json" } }) {
|
|
edges {
|
|
node {
|
|
childContentJson {
|
|
site {
|
|
siteImage {
|
|
childImageSharp {
|
|
original {
|
|
src
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export function useSiteMetadata(): UseSiteMetadata {
|
|
const data = useStaticQuery(query)
|
|
|
|
const siteMeta: UseSiteMetadata = {
|
|
...data.siteImage.edges[0].node.childContentJson.site,
|
|
...data.site.siteMetadata
|
|
}
|
|
|
|
return siteMeta
|
|
}
|