1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

fix marketFeeAddress (#633)

* fix marketFeeAddress

* UseSiteMetadata typing fixes
This commit is contained in:
Matthias Kretschmann 2021-05-31 12:53:37 +02:00 committed by GitHub
parent 29b644f402
commit 94139f42b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 7 deletions

View File

@ -54,7 +54,7 @@ export default function Compute({
dtBalance: string dtBalance: string
file: FileMetadata file: FileMetadata
}): ReactElement { }): ReactElement {
const { marketFeeAddress } = useSiteMetadata() const { appConfig } = useSiteMetadata()
const { accountId } = useWeb3() const { accountId } = useWeb3()
const { ocean, account, config } = useOcean() const { ocean, account, config } = useOcean()
const { price, type, ddo } = useAsset() const { price, type, ddo } = useAsset()
@ -296,7 +296,7 @@ export default function Compute({
ddo.id, ddo.id,
computeService.index, computeService.index,
computeAlgorithm, computeAlgorithm,
marketFeeAddress, appConfig.marketFeeAddress,
undefined, undefined,
false false
) )
@ -316,7 +316,7 @@ export default function Compute({
serviceAlgo.type, serviceAlgo.type,
accountId, accountId,
serviceAlgo.index, serviceAlgo.index,
marketFeeAddress, appConfig.marketFeeAddress,
undefined, undefined,
false false
) )

View File

@ -44,7 +44,7 @@ export default function Consume({
}): ReactElement { }): ReactElement {
const { accountId } = useWeb3() const { accountId } = useWeb3()
const { ocean } = useOcean() const { ocean } = useOcean()
const { marketFeeAddress } = useSiteMetadata() const { appConfig } = useSiteMetadata()
const [hasPreviousOrder, setHasPreviousOrder] = useState(false) const [hasPreviousOrder, setHasPreviousOrder] = useState(false)
const [previousOrderId, setPreviousOrderId] = useState<string>() const [previousOrderId, setPreviousOrderId] = useState<string>()
const { isInPurgatory, price, type } = useAsset() const { isInPurgatory, price, type } = useAsset()
@ -131,7 +131,7 @@ export default function Consume({
ddo.id, ddo.id,
ddo.dataToken, ddo.dataToken,
'access', 'access',
marketFeeAddress, appConfig.marketFeeAddress,
previousOrderId previousOrderId
) )
setHasPreviousOrder(true) setHasPreviousOrder(true)

View File

@ -1,5 +1,35 @@
import { useStaticQuery, graphql } from 'gatsby' 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: {
infuraProjectId: string
network: string
marketFeeAddress: string
currencies: string[]
portisId: string
allowFixedPricing: string
allowDynamicPricing: string
}
}
const query = graphql` const query = graphql`
query { query {
site { site {
@ -53,10 +83,10 @@ const query = graphql`
} }
` `
export function useSiteMetadata() { export function useSiteMetadata(): UseSiteMetadata {
const data = useStaticQuery(query) const data = useStaticQuery(query)
const siteMeta = { const siteMeta: UseSiteMetadata = {
...data.siteImage.edges[0].node.childContentJson.site, ...data.siteImage.edges[0].node.childContentJson.site,
...data.site.siteMetadata ...data.site.siteMetadata
} }