1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Always showing available networks in tooltip

This commit is contained in:
Jamie Hewitt 2022-04-11 14:41:45 +03:00
parent faf9be8d3a
commit 8aebf9fe3f
7 changed files with 9 additions and 10 deletions

View File

@ -1,6 +1,5 @@
{ {
"title": "Publish", "title": "Publish",
"description": "Highlight the important features of your data set or algorithm to make it more discoverable and catch the interest of data consumers.", "description": "Highlight the important features of your data set or algorithm to make it more discoverable and catch the interest of data consumers.",
"warning": "Publishing into a test network first is strongly recommended. Please familiarize yourself with [the market](https://oceanprotocol.com/technology/marketplaces), [the risks](https://blog.oceanprotocol.com/on-staking-on-data-in-ocean-market-3d8e09eb0a13), and the [Terms of Use](/terms).", "warning": "Publishing into a test network first is strongly recommended. Please familiarize yourself with [the market](https://oceanprotocol.com/technology/marketplaces), [the risks](https://blog.oceanprotocol.com/on-staking-on-data-in-ocean-market-3d8e09eb0a13), and the [Terms of Use](/terms)."
"tooltipNetwork": "Assets are published into the network your wallet is connected to. Switch your wallet's network to publish into another one."
} }

View File

@ -6,7 +6,7 @@ import useNetworkMetadata, {
filterNetworksByType filterNetworksByType
} from '@hooks/useNetworkMetadata' } from '@hooks/useNetworkMetadata'
export default function UnsuportedNetwork(): ReactElement { export default function AvailableNetworks(): ReactElement {
const { networksList } = useNetworkMetadata() const { networksList } = useNetworkMetadata()
const { appConfig } = useSiteMetadata() const { appConfig } = useSiteMetadata()
@ -33,8 +33,8 @@ export default function UnsuportedNetwork(): ReactElement {
return ( return (
<> <>
You are currently on an unsupported network. To proceed with publishing, Assets are published to the network your wallet is conected to. These
please switch to one of our supported networks: networks are currently supported:
{networkCategories.map( {networkCategories.map(
(networkCategory) => (networkCategory) =>
networkCategory.data.length > 0 && ( networkCategory.data.length > 0 && (

View File

@ -7,7 +7,7 @@ import { wizardSteps } from '../_constants'
import SuccessConfetti from '@shared/SuccessConfetti' import SuccessConfetti from '@shared/SuccessConfetti'
import { useWeb3 } from '@context/Web3' import { useWeb3 } from '@context/Web3'
import Tooltip from '@shared/atoms/Tooltip' import Tooltip from '@shared/atoms/Tooltip'
import UnsuportedNetwork from '@shared/UnsupportedNetwork' import AvailableNetworks from '@shared/AvailableNetworks'
export default function Actions({ export default function Actions({
scrollToRef, scrollToRef,
@ -83,7 +83,7 @@ export default function Actions({
</Button> </Button>
) : !isSupportedOceanNetwork ? ( ) : !isSupportedOceanNetwork ? (
<Tooltip <Tooltip
content={<UnsuportedNetwork />} content={<AvailableNetworks />}
className={styles.errorTooltip} className={styles.errorTooltip}
> >
<Button type="submit" style="primary" disabled> <Button type="submit" style="primary" disabled>

View File

@ -5,7 +5,7 @@ import styles from './index.module.css'
import content from '../../../../content/publish/index.json' import content from '../../../../content/publish/index.json'
import { useWeb3 } from '@context/Web3' import { useWeb3 } from '@context/Web3'
import Info from '@images/info.svg' import Info from '@images/info.svg'
import UnsuportedNetwork from '@shared/UnsupportedNetwork' import AvailableNetworks from '@shared/AvailableNetworks'
export default function Title({ export default function Title({
networkId networkId
@ -27,12 +27,12 @@ export default function Title({
/> />
{isSupportedOceanNetwork ? ( {isSupportedOceanNetwork ? (
<Tooltip <Tooltip
content={content.tooltipNetwork} content={<AvailableNetworks />}
className={styles.tooltip} className={styles.tooltip}
/> />
) : ( ) : (
<Tooltip <Tooltip
content={<UnsuportedNetwork />} content={<AvailableNetworks />}
className={styles.errorTooltip} className={styles.errorTooltip}
> >
<Info className={styles.errorIcon} /> <Info className={styles.errorIcon} />