1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-29 00:57:50 +02:00
market/src/hooks/useSiteMetadata.ts
Matthias Kretschmann a760935564
Add Portis wallet connection (#291)
* add portis

* library loading tinkering

* bump packages

* typings fix

* pip as addon

* remove setuptools

* revert typings fix

* modal styling

* show portis button

* provider name workaround

* for faulty getInjectedProviderName()
* fixes https://github.com/oceanprotocol/market/issues/332

* more usage of provider info object

* output respective wallet logos

* add network switcher for Portis

* add functionality

* prototype for portis network switching

* improve user experience when reconnecting to cached provider

* support mainnet only, leave networking switching code commented out
2021-01-29 13:40:54 +01:00

57 lines
1013 B
TypeScript

import { useStaticQuery, graphql } from 'gatsby'
const query = graphql`
query {
site {
siteMetadata {
siteTitle
siteTagline
siteUrl
siteIcon
copyright
menu {
name
link
}
warning
appConfig {
infuraProjectId
network
marketFeeAddress
currencies
portisId
}
}
}
siteImage: allFile(filter: { relativePath: { eq: "site.json" } }) {
edges {
node {
childContentJson {
site {
siteImage {
childImageSharp {
original {
src
}
}
}
}
}
}
}
}
}
`
export function useSiteMetadata() {
const data = useStaticQuery(query)
const siteMeta = {
...data.siteImage.edges[0].node.childContentJson.site,
...data.site.siteMetadata
}
return siteMeta
}