From 51785d54dd3081d415a39bbb420bdbd620570b78 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 18 Oct 2021 19:44:33 +0100 Subject: [PATCH] more reorganization --- content/site.json | 2 +- gatsby-config.js | 2 +- gatsby-node.js | 8 +-- src/{context => @context}/Asset.tsx | 0 src/{context => @context}/CookieConsent.tsx | 0 src/{context => @context}/Ocean.tsx | 0 src/{context => @context}/Prices.tsx | 0 src/{context => @context}/Profile.tsx | 10 +-- src/{context => @context}/UrqlProvider.tsx | 2 +- src/{context => @context}/UserPreferences.tsx | 2 +- src/{context => @context}/Web3.tsx | 10 +-- src/{hooks => @hooks}/useAccountPurgatory.ts | 5 +- src/{hooks => @hooks}/useCancelToken.ts | 0 src/{hooks => @hooks}/useConsume.ts | 6 +- src/{hooks => @hooks}/useGdprMetadata.ts | 0 src/{hooks => @hooks}/useGraphSyncStatus.ts | 4 +- src/{hooks => @hooks}/useIsMounted.ts | 0 src/{hooks => @hooks}/useNetworkMetadata.ts | 2 +- src/{hooks => @hooks}/usePricing.ts | 9 ++- src/{hooks => @hooks}/usePrivacyMetadata.ts | 0 src/{hooks => @hooks}/usePublish.ts | 10 +-- .../useSiteMetadata/_types.ts | 0 .../useSiteMetadata/index.ts | 0 src/{images => @images}/arrow.svg | 0 src/{images => @images}/bookmark.svg | 0 src/{images => @images}/bsc.svg | 0 src/{images => @images}/caret.svg | 0 src/{images => @images}/cog.svg | 0 src/{images => @images}/compute.svg | 0 src/{images => @images}/copy.svg | 0 src/{images => @images}/cross.svg | 0 src/{images => @images}/download.svg | 0 src/{images => @images}/energyweb.svg | 0 src/{images => @images}/eth.svg | 0 src/{images => @images}/external.svg | 0 src/{images => @images}/eye.svg | 0 src/{images => @images}/fishfail.gif | Bin src/{images => @images}/info.svg | 0 src/{images => @images}/lock.svg | 0 src/{images => @images}/logo.svg | 0 src/{images => @images}/moon.svg | 0 src/{images => @images}/moonbeam.svg | 0 src/{images => @images}/network.svg | 0 src/{images => @images}/polygon.svg | 0 src/{images => @images}/refresh.svg | 0 src/{images => @images}/search.svg | 0 src/{images => @images}/share.png | Bin src/{images => @images}/star.svg | 0 src/{images => @images}/sun.svg | 0 src/{utils => @utils}/aquarius.ts | 0 src/{utils => @utils}/checkPreviousOrder.ts | 0 src/{utils => @utils}/cleanupContentType.ts | 0 src/{utils => @utils}/compute.ts | 0 src/{utils => @utils}/cookies.ts | 0 src/{utils => @utils}/ens.ts | 0 src/{utils => @utils}/feedback.ts | 0 src/{utils => @utils}/fetch.ts | 0 src/{utils => @utils}/freePrice.ts | 0 src/{utils => @utils}/index.ts | 0 src/{utils => @utils}/metadata.ts | 0 src/{utils => @utils}/numbers.ts | 0 src/{utils => @utils}/ocean.ts | 0 src/{utils => @utils}/pricingFeedback.ts | 0 src/{utils => @utils}/profile.ts | 7 +- src/{utils => @utils}/provider.ts | 6 +- src/{utils => @utils}/purgatory.ts | 9 ++- src/{utils => @utils}/subgraph.ts | 2 +- src/{utils => @utils}/web3.ts | 0 .../index.module.css} | 0 .../AddToken.tsx => AddToken/index.tsx} | 4 +- .../index.module.css} | 0 .../index.tsx} | 6 +- .../@shared/AssetList/AssetComputeList.tsx | 2 +- .../@shared/AssetList/AssetList.tsx | 6 +- .../@shared/AssetList/AssetListTitle.tsx | 4 +- .../@shared/AssetTeaser/AssetTeaser.tsx | 8 +-- .../index.module.css} | 0 .../AssetType.tsx => AssetType/index.tsx} | 2 +- .../index.module.css} | 0 .../ButtonBuy.tsx => ButtonBuy/index.tsx} | 6 +- .../@shared/{atoms => }/DebugOutput.tsx | 0 .../index.module.css} | 0 .../index.tsx} | 2 +- .../index.module.css} | 0 .../{atoms/File.tsx => FileIcon/index.tsx} | 6 +- .../Form/FormFields/AssetSelection.tsx | 2 +- .../Form/FormFields/CustomProvider.tsx | 2 +- .../NetworkIcon.tsx} | 30 +------- .../index.module.css} | 0 src/components/@shared/NetworkName/index.tsx | 31 +++++++++ src/components/@shared/Pagination/_types.ts | 7 ++ .../index.module.css} | 0 .../{Pagination.tsx => Pagination/index.tsx} | 11 +-- .../@shared/PoolTransactions/Title.tsx | 4 +- .../@shared/PoolTransactions/index.tsx | 4 +- .../{atoms => }/Price/Conversion.module.css | 0 .../@shared/{atoms => }/Price/Conversion.tsx | 0 .../{atoms => }/Price/PriceUnit.module.css | 0 .../@shared/{atoms => }/Price/PriceUnit.tsx | 2 +- .../{atoms => }/Price/index.module.css | 0 .../@shared/{atoms => }/Price/index.tsx | 4 +- .../{atoms => }/Publisher/Add.module.css | 0 .../@shared/{atoms => }/Publisher/Add.tsx | 0 .../{atoms => }/Publisher/index.module.css | 0 .../@shared/{atoms => }/Publisher/index.tsx | 0 .../index.module.css} | 0 .../index.tsx} | 4 +- .../index.module.css} | 0 .../{SyncStatus.tsx => SyncStatus/index.tsx} | 2 +- .../@shared/TokenApproval/ButtonApprove.tsx | 63 +++++++++++++++++ .../index.tsx} | 64 +----------------- .../index.module.css} | 0 .../index.tsx} | 2 +- .../index.module.css} | 0 .../index.tsx} | 4 +- .../atoms/SearchFilterSection.module.css | 3 - .../@shared/atoms/SearchFilterSection.tsx | 20 ------ src/components/@shared/atoms/Table.module.css | 4 +- src/components/App.tsx | 10 +-- .../AssetActionHistoryTable.module.css | 0 .../AssetActions}/AssetActionHistoryTable.tsx | 0 .../Compute/FormComputeDataset.tsx | 2 +- .../AssetActions/Compute/PriceOutput.tsx | 4 +- .../Asset/AssetActions/Compute/index.tsx | 10 +-- src/components/Asset/AssetActions/Consume.tsx | 26 +++---- .../AssetActions/Edit/DebugEditCompute.tsx | 6 +- .../AssetActions/Edit/DebugEditMetadata.tsx | 2 +- .../AssetActions/Edit/FormEditMetadata.tsx | 4 +- .../Asset/AssetActions/Pool/Actions.tsx | 4 +- .../Asset/AssetActions/Pool/Add/FormAdd.tsx | 2 +- .../Asset/AssetActions/Pool/Add/index.tsx | 4 +- .../Asset/AssetActions/Pool/Graph.tsx | 8 +-- .../Asset/AssetActions/Pool/Remove.tsx | 2 +- .../Asset/AssetActions/Pool/Token.tsx | 2 +- .../Asset/AssetActions/Pool/TokenList.tsx | 2 +- .../Asset/AssetActions/Pool/index.tsx | 12 ++-- .../Asset/AssetActions/Pool/utils.ts | 3 +- .../Asset/AssetActions/Trade/FormTrade.tsx | 8 +-- .../Asset/AssetActions/Trade/Output.tsx | 6 +- .../Asset/AssetActions/Trade/Swap.tsx | 4 +- .../Asset/AssetActions/Trade/TradeInput.tsx | 4 +- .../AssetActions}/UserLiquidity.module.css | 0 .../AssetActions}/UserLiquidity.tsx | 2 +- .../Asset/AssetContent/EditHistory.tsx | 2 +- .../Asset/AssetContent/MetaFull.tsx | 2 +- .../Asset/AssetContent/MetaMain.tsx | 8 +-- src/components/Asset/AssetContent/index.tsx | 6 +- src/components/Footer/MarketStats.tsx | 6 +- .../Header/UserPreferences/Appearance.tsx | 4 +- .../UserPreferences/Networks/NetworkItem.tsx | 2 +- .../Header/UserPreferences/index.tsx | 4 +- src/components/Header/Wallet/Details.tsx | 4 +- src/components/Header/Wallet/Network.tsx | 2 +- src/components/Home/Bookmarks.tsx | 2 +- src/components/Profile/Header/Account.tsx | 4 +- .../Header}/NumberUnit.module.css | 0 .../Header}/NumberUnit.tsx | 0 .../Profile/Header/PublisherLinks.module.css | 2 +- src/components/Profile/Header/Stats.tsx | 4 +- .../Profile/History/ComputeJobs/index.tsx | 2 +- src/components/Profile/History/Downloads.tsx | 2 +- src/components/Profile/History/PoolShares.tsx | 4 +- src/components/Publish/Debug.tsx | 2 +- src/components/Publish/FormAlgoPublish.tsx | 6 +- src/components/Publish/FormPublish.tsx | 4 +- src/components/Publish/FormTitle.tsx | 2 +- src/components/Publish/MetadataFeedback.tsx | 2 +- src/components/Publish/MetadataPreview.tsx | 8 +-- src/components/Publish/Pricing/Feedback.tsx | 2 +- .../Publish/Pricing/FormPricing/Coin.tsx | 2 +- .../Publish/Pricing/FormPricing/Dynamic.tsx | 6 +- .../Publish/Pricing/FormPricing/Price.tsx | 4 +- src/components/Publish/Pricing/index.tsx | 4 +- src/components/wrapRootElement.tsx | 10 +-- src/global/Typography.stories.tsx | 33 --------- .../StylesGlobal.tsx} | 4 +- src/{global => stylesGlobal}/_code.css | 0 src/{global => stylesGlobal}/_toast.css | 0 src/{global => stylesGlobal}/_variables.css | 0 src/{global => stylesGlobal}/_web3modal.css | 0 src/{global => stylesGlobal}/datepicker.css | 0 src/{global => stylesGlobal}/styles.css | 0 tsconfig.json | 8 +-- 183 files changed, 321 insertions(+), 368 deletions(-) rename src/{context => @context}/Asset.tsx (100%) rename src/{context => @context}/CookieConsent.tsx (100%) rename src/{context => @context}/Ocean.tsx (100%) rename src/{context => @context}/Prices.tsx (100%) rename src/{context => @context}/Profile.tsx (97%) rename src/{context => @context}/UrqlProvider.tsx (96%) rename src/{context => @context}/UserPreferences.tsx (99%) rename src/{context => @context}/Web3.tsx (98%) rename src/{hooks => @hooks}/useAccountPurgatory.ts (93%) rename src/{hooks => @hooks}/useCancelToken.ts (100%) rename src/{hooks => @hooks}/useConsume.ts (95%) rename src/{hooks => @hooks}/useGdprMetadata.ts (100%) rename src/{hooks => @hooks}/useGraphSyncStatus.ts (97%) rename src/{hooks => @hooks}/useIsMounted.ts (100%) rename src/{hooks => @hooks}/useNetworkMetadata.ts (93%) rename src/{hooks => @hooks}/usePricing.ts (98%) rename src/{hooks => @hooks}/usePrivacyMetadata.ts (100%) rename src/{hooks => @hooks}/usePublish.ts (95%) rename src/{hooks => @hooks}/useSiteMetadata/_types.ts (100%) rename src/{hooks => @hooks}/useSiteMetadata/index.ts (100%) rename src/{images => @images}/arrow.svg (100%) rename src/{images => @images}/bookmark.svg (100%) rename src/{images => @images}/bsc.svg (100%) rename src/{images => @images}/caret.svg (100%) rename src/{images => @images}/cog.svg (100%) rename src/{images => @images}/compute.svg (100%) rename src/{images => @images}/copy.svg (100%) rename src/{images => @images}/cross.svg (100%) rename src/{images => @images}/download.svg (100%) rename src/{images => @images}/energyweb.svg (100%) rename src/{images => @images}/eth.svg (100%) rename src/{images => @images}/external.svg (100%) rename src/{images => @images}/eye.svg (100%) rename src/{images => @images}/fishfail.gif (100%) rename src/{images => @images}/info.svg (100%) rename src/{images => @images}/lock.svg (100%) rename src/{images => @images}/logo.svg (100%) rename src/{images => @images}/moon.svg (100%) rename src/{images => @images}/moonbeam.svg (100%) rename src/{images => @images}/network.svg (100%) rename src/{images => @images}/polygon.svg (100%) rename src/{images => @images}/refresh.svg (100%) rename src/{images => @images}/search.svg (100%) rename src/{images => @images}/share.png (100%) rename src/{images => @images}/star.svg (100%) rename src/{images => @images}/sun.svg (100%) rename src/{utils => @utils}/aquarius.ts (100%) rename src/{utils => @utils}/checkPreviousOrder.ts (100%) rename src/{utils => @utils}/cleanupContentType.ts (100%) rename src/{utils => @utils}/compute.ts (100%) rename src/{utils => @utils}/cookies.ts (100%) rename src/{utils => @utils}/ens.ts (100%) rename src/{utils => @utils}/feedback.ts (100%) rename src/{utils => @utils}/fetch.ts (100%) rename src/{utils => @utils}/freePrice.ts (100%) rename src/{utils => @utils}/index.ts (100%) rename src/{utils => @utils}/metadata.ts (100%) rename src/{utils => @utils}/numbers.ts (100%) rename src/{utils => @utils}/ocean.ts (100%) rename src/{utils => @utils}/pricingFeedback.ts (100%) rename src/{utils => @utils}/profile.ts (93%) rename src/{utils => @utils}/provider.ts (93%) rename src/{utils => @utils}/purgatory.ts (73%) rename src/{utils => @utils}/subgraph.ts (99%) rename src/{utils => @utils}/web3.ts (100%) rename src/components/@shared/{atoms/AddToken.module.css => AddToken/index.module.css} (100%) rename src/components/@shared/{atoms/AddToken.tsx => AddToken/index.tsx} (92%) rename src/components/@shared/{atoms/AnnouncementBanner.module.css => AnnouncementBanner/index.module.css} (100%) rename src/components/@shared/{atoms/AnnouncementBanner.tsx => AnnouncementBanner/index.tsx} (87%) rename src/components/@shared/{atoms/AssetType.module.css => AssetType/index.module.css} (100%) rename src/components/@shared/{atoms/AssetType.tsx => AssetType/index.tsx} (95%) rename src/components/@shared/{atoms/ButtonBuy.module.css => ButtonBuy/index.module.css} (100%) rename src/components/@shared/{atoms/ButtonBuy.tsx => ButtonBuy/index.tsx} (98%) rename src/components/@shared/{atoms => }/DebugOutput.tsx (100%) rename src/components/@shared/{atoms/ExplorerLink.module.css => ExplorerLink/index.module.css} (100%) rename src/components/@shared/{atoms/ExplorerLink.tsx => ExplorerLink/index.tsx} (96%) rename src/components/@shared/{atoms/File.module.css => FileIcon/index.module.css} (100%) rename src/components/@shared/{atoms/File.tsx => FileIcon/index.tsx} (91%) rename src/components/@shared/{atoms/NetworkName.tsx => NetworkName/NetworkIcon.tsx} (50%) rename src/components/@shared/{atoms/NetworkName.module.css => NetworkName/index.module.css} (100%) create mode 100644 src/components/@shared/NetworkName/index.tsx create mode 100644 src/components/@shared/Pagination/_types.ts rename src/components/@shared/{Pagination.module.css => Pagination/index.module.css} (100%) rename src/components/@shared/{Pagination.tsx => Pagination/index.tsx} (92%) rename src/components/@shared/{atoms => }/Price/Conversion.module.css (100%) rename src/components/@shared/{atoms => }/Price/Conversion.tsx (100%) rename src/components/@shared/{atoms => }/Price/PriceUnit.module.css (100%) rename src/components/@shared/{atoms => }/Price/PriceUnit.tsx (97%) rename src/components/@shared/{atoms => }/Price/index.module.css (100%) rename src/components/@shared/{atoms => }/Price/index.tsx (93%) rename src/components/@shared/{atoms => }/Publisher/Add.module.css (100%) rename src/components/@shared/{atoms => }/Publisher/Add.tsx (100%) rename src/components/@shared/{atoms => }/Publisher/index.module.css (100%) rename src/components/@shared/{atoms => }/Publisher/index.tsx (100%) rename src/components/@shared/{atoms/SuccessConfetti.module.css => SuccessConfetti/index.module.css} (100%) rename src/components/@shared/{atoms/SuccessConfetti.tsx => SuccessConfetti/index.tsx} (93%) rename src/components/@shared/{SyncStatus.module.css => SyncStatus/index.module.css} (100%) rename src/components/@shared/{SyncStatus.tsx => SyncStatus/index.tsx} (93%) create mode 100644 src/components/@shared/TokenApproval/ButtonApprove.tsx rename src/components/@shared/{TokenApproval.tsx => TokenApproval/index.tsx} (56%) rename src/components/@shared/{WalletNetworkSwitcher.module.css => WalletNetworkSwitcher/index.module.css} (100%) rename src/components/@shared/{WalletNetworkSwitcher.tsx => WalletNetworkSwitcher/index.tsx} (96%) rename src/components/@shared/{Web3Feedback.module.css => Web3Feedback/index.module.css} (100%) rename src/components/@shared/{Web3Feedback.tsx => Web3Feedback/index.tsx} (95%) delete mode 100644 src/components/@shared/atoms/SearchFilterSection.module.css delete mode 100644 src/components/@shared/atoms/SearchFilterSection.tsx rename src/components/{@shared => Asset/AssetActions}/AssetActionHistoryTable.module.css (100%) rename src/components/{@shared => Asset/AssetActions}/AssetActionHistoryTable.tsx (100%) rename src/components/{@shared/atoms => Asset/AssetActions}/UserLiquidity.module.css (100%) rename src/components/{@shared/atoms => Asset/AssetActions}/UserLiquidity.tsx (95%) rename src/components/{@shared => Profile/Header}/NumberUnit.module.css (100%) rename src/components/{@shared => Profile/Header}/NumberUnit.tsx (100%) delete mode 100644 src/global/Typography.stories.tsx rename src/{global/Styles.tsx => stylesGlobal/StylesGlobal.tsx} (83%) rename src/{global => stylesGlobal}/_code.css (100%) rename src/{global => stylesGlobal}/_toast.css (100%) rename src/{global => stylesGlobal}/_variables.css (100%) rename src/{global => stylesGlobal}/_web3modal.css (100%) rename src/{global => stylesGlobal}/datepicker.css (100%) rename src/{global => stylesGlobal}/styles.css (100%) diff --git a/content/site.json b/content/site.json index 7cef28e78..db50582a1 100644 --- a/content/site.json +++ b/content/site.json @@ -4,7 +4,7 @@ "siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.", "siteUrl": "https://market.oceanprotocol.com", "siteIcon": "node_modules/@oceanprotocol/art/logo/favicon-white.png", - "siteImage": "../src/images/share.png", + "siteImage": "../src/@images/share.png", "copyright": "All Rights Reserved. Powered by [Ocean Protocol](https://oceanprotocol.com)", "menu": [ { diff --git a/gatsby-config.js b/gatsby-config.js index 8ecf9ef1b..2bca6400c 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -22,7 +22,7 @@ module.exports = { resolve: 'gatsby-source-filesystem', options: { name: 'images', - path: `${__dirname}/src/images` + path: `${__dirname}/src/@images` } }, { diff --git a/gatsby-node.js b/gatsby-node.js index 531b64834..6440a0c04 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -77,10 +77,10 @@ exports.onCreateWebpackConfig = ({ actions }) => { resolve: { alias: { '@shared': path.resolve(__dirname, 'src/components/@shared'), - '@hooks': path.resolve(__dirname, 'src/hooks'), - '@context': path.resolve(__dirname, 'src/context'), - '@images': path.resolve(__dirname, 'src/images'), - '@utils': path.resolve(__dirname, 'src/utils') + '@hooks': path.resolve(__dirname, 'src/@hooks'), + '@context': path.resolve(__dirname, 'src/@context'), + '@images': path.resolve(__dirname, 'src/@images'), + '@utils': path.resolve(__dirname, 'src/@utils') } }, node: { diff --git a/src/context/Asset.tsx b/src/@context/Asset.tsx similarity index 100% rename from src/context/Asset.tsx rename to src/@context/Asset.tsx diff --git a/src/context/CookieConsent.tsx b/src/@context/CookieConsent.tsx similarity index 100% rename from src/context/CookieConsent.tsx rename to src/@context/CookieConsent.tsx diff --git a/src/context/Ocean.tsx b/src/@context/Ocean.tsx similarity index 100% rename from src/context/Ocean.tsx rename to src/@context/Ocean.tsx diff --git a/src/context/Prices.tsx b/src/@context/Prices.tsx similarity index 100% rename from src/context/Prices.tsx rename to src/@context/Prices.tsx diff --git a/src/context/Profile.tsx b/src/@context/Profile.tsx similarity index 97% rename from src/context/Profile.tsx rename to src/@context/Profile.tsx index faf481976..62fa145cc 100644 --- a/src/context/Profile.tsx +++ b/src/@context/Profile.tsx @@ -11,16 +11,18 @@ import { getPoolSharesData, getUserSales, getUserTokenOrders -} from '../utils/subgraph' +} from '@utils/subgraph' import { useUserPreferences } from './UserPreferences' import { PoolShares_poolShares as PoolShare } from '../@types/apollo/PoolShares' import { DDO, Logger } from '@oceanprotocol/lib' import { getDownloadAssets, getPublishedAssets } from '../utils/aquarius' -import { useSiteMetadata } from '../hooks/useSiteMetadata' -import { accountTruncate } from '../utils/web3' + getPublishedAssets +} from '@utils/aquarius' +import { useSiteMetadata } from '@hooks/useSiteMetadata' +import { accountTruncate } from '@utils/web3' import axios, { CancelToken } from 'axios' import ethereumAddress from 'ethereum-address' -import get3BoxProfile from '../utils/profile' +import get3BoxProfile from '@utils/profile' import web3 from 'web3' import { DownloadedAsset } from '../models/aquarius/DownloadedAsset' diff --git a/src/context/UrqlProvider.tsx b/src/@context/UrqlProvider.tsx similarity index 96% rename from src/context/UrqlProvider.tsx rename to src/@context/UrqlProvider.tsx index c74d4ce43..eff9cd830 100644 --- a/src/context/UrqlProvider.tsx +++ b/src/@context/UrqlProvider.tsx @@ -1,7 +1,7 @@ import { createClient, Provider, Client } from 'urql' import React, { useState, useEffect, ReactNode, ReactElement } from 'react' import { Logger } from '@oceanprotocol/lib' -import { getOceanConfig } from '../utils/ocean' +import { getOceanConfig } from '@utils/ocean' let urqlClient: Client diff --git a/src/context/UserPreferences.tsx b/src/@context/UserPreferences.tsx similarity index 99% rename from src/context/UserPreferences.tsx rename to src/@context/UserPreferences.tsx index e2b23677b..275ae1304 100644 --- a/src/context/UserPreferences.tsx +++ b/src/@context/UserPreferences.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react' import { Logger, LogLevel } from '@oceanprotocol/lib' -import { isBrowser } from '../utils' +import { isBrowser } from '@utils/index' import { useSiteMetadata } from '@hooks/useSiteMetadata' interface UserPreferencesValue { diff --git a/src/context/Web3.tsx b/src/@context/Web3.tsx similarity index 98% rename from src/context/Web3.tsx rename to src/@context/Web3.tsx index df3ed1826..ebc0af0d8 100644 --- a/src/context/Web3.tsx +++ b/src/@context/Web3.tsx @@ -12,15 +12,15 @@ import Web3Modal, { getProviderInfo, IProviderInfo } from 'web3modal' import { infuraProjectId as infuraId, portisId } from '../../app.config' import WalletConnectProvider from '@walletconnect/web3-provider' import { Logger } from '@oceanprotocol/lib' -import { isBrowser } from '../utils' +import { isBrowser } from '@utils/index' import { EthereumListsChain, getNetworkDataById, getNetworkDisplayName -} from '../utils/web3' -import { getEnsName } from '../utils/ens' -import { getOceanBalance } from '../utils/ocean' -import useNetworkMetadata from '../hooks/useNetworkMetadata' +} from '@utils/web3' +import { getEnsName } from '@utils/ens' +import { getOceanBalance } from '@utils/ocean' +import useNetworkMetadata from '@hooks/useNetworkMetadata' interface Web3ProviderValue { web3: Web3 diff --git a/src/hooks/useAccountPurgatory.ts b/src/@hooks/useAccountPurgatory.ts similarity index 93% rename from src/hooks/useAccountPurgatory.ts rename to src/@hooks/useAccountPurgatory.ts index 2f578aab9..79e644cfb 100644 --- a/src/hooks/useAccountPurgatory.ts +++ b/src/@hooks/useAccountPurgatory.ts @@ -1,9 +1,6 @@ import { useCallback, useEffect, useState } from 'react' import { Logger } from '@oceanprotocol/lib' -import { - PurgatoryDataAccount, - getAccountPurgatoryData -} from '../utils/purgatory' +import { PurgatoryDataAccount, getAccountPurgatoryData } from '@utils/purgatory' interface UseAccountPurgatory { isInPurgatory: boolean diff --git a/src/hooks/useCancelToken.ts b/src/@hooks/useCancelToken.ts similarity index 100% rename from src/hooks/useCancelToken.ts rename to src/@hooks/useCancelToken.ts diff --git a/src/hooks/useConsume.ts b/src/@hooks/useConsume.ts similarity index 95% rename from src/hooks/useConsume.ts rename to src/@hooks/useConsume.ts index d4ad4d19f..3d35d4819 100644 --- a/src/hooks/useConsume.ts +++ b/src/@hooks/useConsume.ts @@ -1,8 +1,8 @@ import { useState } from 'react' -import { consumeFeedback } from '../utils/feedback' +import { consumeFeedback } from '@utils/feedback' import { DID, Logger, ServiceType } from '@oceanprotocol/lib' -import { useOcean } from '../context/Ocean' -import { useWeb3 } from '../context/Web3' +import { useOcean } from '@context/Ocean' +import { useWeb3 } from '@context/Web3' interface UseConsume { consume: ( diff --git a/src/hooks/useGdprMetadata.ts b/src/@hooks/useGdprMetadata.ts similarity index 100% rename from src/hooks/useGdprMetadata.ts rename to src/@hooks/useGdprMetadata.ts diff --git a/src/hooks/useGraphSyncStatus.ts b/src/@hooks/useGraphSyncStatus.ts similarity index 97% rename from src/hooks/useGraphSyncStatus.ts rename to src/@hooks/useGraphSyncStatus.ts index 3dc55fcfc..d6216cfbe 100644 --- a/src/hooks/useGraphSyncStatus.ts +++ b/src/@hooks/useGraphSyncStatus.ts @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react' -import { useOcean } from '../context/Ocean' -import { useWeb3 } from '../context/Web3' +import { useOcean } from '@context/Ocean' +import { useWeb3 } from '@context/Web3' import { Logger } from '@oceanprotocol/lib' import Web3 from 'web3' import { ConfigHelperConfig } from '@oceanprotocol/lib/dist/node/utils/ConfigHelper' diff --git a/src/hooks/useIsMounted.ts b/src/@hooks/useIsMounted.ts similarity index 100% rename from src/hooks/useIsMounted.ts rename to src/@hooks/useIsMounted.ts diff --git a/src/hooks/useNetworkMetadata.ts b/src/@hooks/useNetworkMetadata.ts similarity index 93% rename from src/hooks/useNetworkMetadata.ts rename to src/@hooks/useNetworkMetadata.ts index 6e049382a..d7104ab7d 100644 --- a/src/hooks/useNetworkMetadata.ts +++ b/src/@hooks/useNetworkMetadata.ts @@ -1,5 +1,5 @@ import { useStaticQuery, graphql } from 'gatsby' -import { EthereumListsChain } from '../utils/web3' +import { EthereumListsChain } from '@utils/web3' export interface UseNetworkMetadata { networksList: { node: EthereumListsChain }[] diff --git a/src/hooks/usePricing.ts b/src/@hooks/usePricing.ts similarity index 98% rename from src/hooks/usePricing.ts rename to src/@hooks/usePricing.ts index f95ccc664..0a4c3ed01 100644 --- a/src/hooks/usePricing.ts +++ b/src/@hooks/usePricing.ts @@ -8,11 +8,10 @@ import { getBuyDTFeedback, getCreateFreePricingFeedback, getDispenseFeedback -} from '../utils/feedback' -import { sleep } from '../utils' - -import { useOcean } from '../context/Ocean' -import { useWeb3 } from '../context/Web3' +} from '@utils/feedback' +import { sleep } from '@utils/index' +import { useOcean } from '@context/Ocean' +import { useWeb3 } from '@context/Web3' interface UsePricing { getDTSymbol: (ddo: DDO) => Promise diff --git a/src/hooks/usePrivacyMetadata.ts b/src/@hooks/usePrivacyMetadata.ts similarity index 100% rename from src/hooks/usePrivacyMetadata.ts rename to src/@hooks/usePrivacyMetadata.ts diff --git a/src/hooks/usePublish.ts b/src/@hooks/usePublish.ts similarity index 95% rename from src/hooks/usePublish.ts rename to src/@hooks/usePublish.ts index ead096710..a17d16a34 100644 --- a/src/hooks/usePublish.ts +++ b/src/@hooks/usePublish.ts @@ -5,11 +5,11 @@ import { ServiceType } from '@oceanprotocol/lib/dist/node/ddo/interfaces/Service' import { useEffect, useState } from 'react' -import { sleep } from '../utils' -import { publishFeedback } from '../utils/feedback' -import { useOcean } from '../context/Ocean' -import { useWeb3 } from '../context/Web3' -import { getOceanConfig } from '../utils/ocean' +import { sleep } from '@utils/index' +import { publishFeedback } from '@utils/feedback' +import { useOcean } from '@context/Ocean' +import { useWeb3 } from '@context/Web3' +import { getOceanConfig } from '@utils/ocean' interface DataTokenOptions { cap?: string diff --git a/src/hooks/useSiteMetadata/_types.ts b/src/@hooks/useSiteMetadata/_types.ts similarity index 100% rename from src/hooks/useSiteMetadata/_types.ts rename to src/@hooks/useSiteMetadata/_types.ts diff --git a/src/hooks/useSiteMetadata/index.ts b/src/@hooks/useSiteMetadata/index.ts similarity index 100% rename from src/hooks/useSiteMetadata/index.ts rename to src/@hooks/useSiteMetadata/index.ts diff --git a/src/images/arrow.svg b/src/@images/arrow.svg similarity index 100% rename from src/images/arrow.svg rename to src/@images/arrow.svg diff --git a/src/images/bookmark.svg b/src/@images/bookmark.svg similarity index 100% rename from src/images/bookmark.svg rename to src/@images/bookmark.svg diff --git a/src/images/bsc.svg b/src/@images/bsc.svg similarity index 100% rename from src/images/bsc.svg rename to src/@images/bsc.svg diff --git a/src/images/caret.svg b/src/@images/caret.svg similarity index 100% rename from src/images/caret.svg rename to src/@images/caret.svg diff --git a/src/images/cog.svg b/src/@images/cog.svg similarity index 100% rename from src/images/cog.svg rename to src/@images/cog.svg diff --git a/src/images/compute.svg b/src/@images/compute.svg similarity index 100% rename from src/images/compute.svg rename to src/@images/compute.svg diff --git a/src/images/copy.svg b/src/@images/copy.svg similarity index 100% rename from src/images/copy.svg rename to src/@images/copy.svg diff --git a/src/images/cross.svg b/src/@images/cross.svg similarity index 100% rename from src/images/cross.svg rename to src/@images/cross.svg diff --git a/src/images/download.svg b/src/@images/download.svg similarity index 100% rename from src/images/download.svg rename to src/@images/download.svg diff --git a/src/images/energyweb.svg b/src/@images/energyweb.svg similarity index 100% rename from src/images/energyweb.svg rename to src/@images/energyweb.svg diff --git a/src/images/eth.svg b/src/@images/eth.svg similarity index 100% rename from src/images/eth.svg rename to src/@images/eth.svg diff --git a/src/images/external.svg b/src/@images/external.svg similarity index 100% rename from src/images/external.svg rename to src/@images/external.svg diff --git a/src/images/eye.svg b/src/@images/eye.svg similarity index 100% rename from src/images/eye.svg rename to src/@images/eye.svg diff --git a/src/images/fishfail.gif b/src/@images/fishfail.gif similarity index 100% rename from src/images/fishfail.gif rename to src/@images/fishfail.gif diff --git a/src/images/info.svg b/src/@images/info.svg similarity index 100% rename from src/images/info.svg rename to src/@images/info.svg diff --git a/src/images/lock.svg b/src/@images/lock.svg similarity index 100% rename from src/images/lock.svg rename to src/@images/lock.svg diff --git a/src/images/logo.svg b/src/@images/logo.svg similarity index 100% rename from src/images/logo.svg rename to src/@images/logo.svg diff --git a/src/images/moon.svg b/src/@images/moon.svg similarity index 100% rename from src/images/moon.svg rename to src/@images/moon.svg diff --git a/src/images/moonbeam.svg b/src/@images/moonbeam.svg similarity index 100% rename from src/images/moonbeam.svg rename to src/@images/moonbeam.svg diff --git a/src/images/network.svg b/src/@images/network.svg similarity index 100% rename from src/images/network.svg rename to src/@images/network.svg diff --git a/src/images/polygon.svg b/src/@images/polygon.svg similarity index 100% rename from src/images/polygon.svg rename to src/@images/polygon.svg diff --git a/src/images/refresh.svg b/src/@images/refresh.svg similarity index 100% rename from src/images/refresh.svg rename to src/@images/refresh.svg diff --git a/src/images/search.svg b/src/@images/search.svg similarity index 100% rename from src/images/search.svg rename to src/@images/search.svg diff --git a/src/images/share.png b/src/@images/share.png similarity index 100% rename from src/images/share.png rename to src/@images/share.png diff --git a/src/images/star.svg b/src/@images/star.svg similarity index 100% rename from src/images/star.svg rename to src/@images/star.svg diff --git a/src/images/sun.svg b/src/@images/sun.svg similarity index 100% rename from src/images/sun.svg rename to src/@images/sun.svg diff --git a/src/utils/aquarius.ts b/src/@utils/aquarius.ts similarity index 100% rename from src/utils/aquarius.ts rename to src/@utils/aquarius.ts diff --git a/src/utils/checkPreviousOrder.ts b/src/@utils/checkPreviousOrder.ts similarity index 100% rename from src/utils/checkPreviousOrder.ts rename to src/@utils/checkPreviousOrder.ts diff --git a/src/utils/cleanupContentType.ts b/src/@utils/cleanupContentType.ts similarity index 100% rename from src/utils/cleanupContentType.ts rename to src/@utils/cleanupContentType.ts diff --git a/src/utils/compute.ts b/src/@utils/compute.ts similarity index 100% rename from src/utils/compute.ts rename to src/@utils/compute.ts diff --git a/src/utils/cookies.ts b/src/@utils/cookies.ts similarity index 100% rename from src/utils/cookies.ts rename to src/@utils/cookies.ts diff --git a/src/utils/ens.ts b/src/@utils/ens.ts similarity index 100% rename from src/utils/ens.ts rename to src/@utils/ens.ts diff --git a/src/utils/feedback.ts b/src/@utils/feedback.ts similarity index 100% rename from src/utils/feedback.ts rename to src/@utils/feedback.ts diff --git a/src/utils/fetch.ts b/src/@utils/fetch.ts similarity index 100% rename from src/utils/fetch.ts rename to src/@utils/fetch.ts diff --git a/src/utils/freePrice.ts b/src/@utils/freePrice.ts similarity index 100% rename from src/utils/freePrice.ts rename to src/@utils/freePrice.ts diff --git a/src/utils/index.ts b/src/@utils/index.ts similarity index 100% rename from src/utils/index.ts rename to src/@utils/index.ts diff --git a/src/utils/metadata.ts b/src/@utils/metadata.ts similarity index 100% rename from src/utils/metadata.ts rename to src/@utils/metadata.ts diff --git a/src/utils/numbers.ts b/src/@utils/numbers.ts similarity index 100% rename from src/utils/numbers.ts rename to src/@utils/numbers.ts diff --git a/src/utils/ocean.ts b/src/@utils/ocean.ts similarity index 100% rename from src/utils/ocean.ts rename to src/@utils/ocean.ts diff --git a/src/utils/pricingFeedback.ts b/src/@utils/pricingFeedback.ts similarity index 100% rename from src/utils/pricingFeedback.ts rename to src/@utils/pricingFeedback.ts diff --git a/src/utils/profile.ts b/src/@utils/profile.ts similarity index 93% rename from src/utils/profile.ts rename to src/@utils/profile.ts index 32253c0dc..fa87e0151 100644 --- a/src/utils/profile.ts +++ b/src/@utils/profile.ts @@ -74,10 +74,9 @@ export default async function get3BoxProfile( cancelToken: CancelToken ): Promise { try { - const response: AxiosResponse = await axios( - `${apiUri}/profile/${accountId}`, - { cancelToken } - ) + const response = (await axios(`${apiUri}/profile/${accountId}`, { + cancelToken + })) as AxiosResponse if ( !response || diff --git a/src/utils/provider.ts b/src/@utils/provider.ts similarity index 93% rename from src/utils/provider.ts rename to src/@utils/provider.ts index 89c253c98..deae9236e 100644 --- a/src/utils/provider.ts +++ b/src/@utils/provider.ts @@ -8,13 +8,15 @@ export async function fileinfo( cancelToken: CancelToken ): Promise { try { - const response: AxiosResponse = await axios.post( + const response = (await axios.post( `${providerUri}/api/v1/services/fileinfo`, { url, cancelToken } - ) + )) as AxiosResponse< + { valid: boolean; contentLength: string; contentType: string }[] + > if (!response || response.status !== 200 || !response.data) { toast.error('Could not connect to File API') diff --git a/src/utils/purgatory.ts b/src/@utils/purgatory.ts similarity index 73% rename from src/utils/purgatory.ts rename to src/@utils/purgatory.ts index 88a0c6e18..ae4a5fe68 100644 --- a/src/utils/purgatory.ts +++ b/src/@utils/purgatory.ts @@ -11,13 +11,18 @@ export interface PurgatoryDataAccount { export default async function getAssetPurgatoryData( did: string ): Promise { - const data = await fetchData(`${purgatoryUrl}asset?did=${did}`) + const data = (await fetchData( + `${purgatoryUrl}asset?did=${did}` + )) as PurgatoryDataAsset[] + return { did: data[0]?.did, reason: data[0]?.reason } } export async function getAccountPurgatoryData( address: string ): Promise { - const data = await fetchData(`${purgatoryUrl}account?address=${address}`) + const data = (await fetchData( + `${purgatoryUrl}account?address=${address}` + )) as PurgatoryDataAccount[] return { address: data[0]?.address, reason: data[0]?.reason } } diff --git a/src/utils/subgraph.ts b/src/@utils/subgraph.ts similarity index 99% rename from src/utils/subgraph.ts rename to src/@utils/subgraph.ts index 43d6dce63..d3c8d3ee6 100644 --- a/src/utils/subgraph.ts +++ b/src/@utils/subgraph.ts @@ -252,7 +252,7 @@ const UserTokenOrders = gql` } ` const UserSalesQuery = gql` - query UserSalesQuery($userSalesId: String) { + query UserSalesQuery($userSalesId: ID) { users(where: { id: $userSalesId }) { id nrSales diff --git a/src/utils/web3.ts b/src/@utils/web3.ts similarity index 100% rename from src/utils/web3.ts rename to src/@utils/web3.ts diff --git a/src/components/@shared/atoms/AddToken.module.css b/src/components/@shared/AddToken/index.module.css similarity index 100% rename from src/components/@shared/atoms/AddToken.module.css rename to src/components/@shared/AddToken/index.module.css diff --git a/src/components/@shared/atoms/AddToken.tsx b/src/components/@shared/AddToken/index.tsx similarity index 92% rename from src/components/@shared/atoms/AddToken.tsx rename to src/components/@shared/AddToken/index.tsx index b6fb46c60..39c55e867 100644 --- a/src/components/@shared/atoms/AddToken.tsx +++ b/src/components/@shared/AddToken/index.tsx @@ -2,8 +2,8 @@ import React, { ReactElement } from 'react' import classNames from 'classnames/bind' import { addTokenToWallet } from '@utils/web3' import { useWeb3 } from '@context/Web3' -import Button from './Button' -import styles from './AddToken.module.css' +import Button from '@shared/atoms/Button' +import styles from './index.module.css' const cx = classNames.bind(styles) diff --git a/src/components/@shared/atoms/AnnouncementBanner.module.css b/src/components/@shared/AnnouncementBanner/index.module.css similarity index 100% rename from src/components/@shared/atoms/AnnouncementBanner.module.css rename to src/components/@shared/AnnouncementBanner/index.module.css diff --git a/src/components/@shared/atoms/AnnouncementBanner.tsx b/src/components/@shared/AnnouncementBanner/index.tsx similarity index 87% rename from src/components/@shared/atoms/AnnouncementBanner.tsx rename to src/components/@shared/AnnouncementBanner/index.tsx index 5a78520e3..364b0678d 100644 --- a/src/components/@shared/atoms/AnnouncementBanner.tsx +++ b/src/components/@shared/AnnouncementBanner/index.tsx @@ -1,8 +1,8 @@ import React, { ReactElement } from 'react' import classNames from 'classnames/bind' -import Markdown from './Markdown' -import Button from './Button' -import styles from './AnnouncementBanner.module.css' +import Markdown from '@shared/atoms/Markdown' +import Button from '@shared/atoms/Button' +import styles from './index.module.css' const cx = classNames.bind(styles) diff --git a/src/components/@shared/AssetList/AssetComputeList.tsx b/src/components/@shared/AssetList/AssetComputeList.tsx index 0f5b3d558..edea9238b 100644 --- a/src/components/@shared/AssetList/AssetComputeList.tsx +++ b/src/components/@shared/AssetList/AssetComputeList.tsx @@ -1,7 +1,7 @@ import React from 'react' import Dotdotdot from 'react-dotdotdot' import { Link } from 'gatsby' -import PriceUnit from '@shared/atoms/Price/PriceUnit' +import PriceUnit from '@shared/Price/PriceUnit' import Loader from '@shared/atoms/Loader' import styles from './AssetComputeList.module.css' import { AssetSelectionAsset } from '@shared/Form/FormFields/AssetSelection' diff --git a/src/components/@shared/AssetList/AssetList.tsx b/src/components/@shared/AssetList/AssetList.tsx index bd19c6d08..edcb792c1 100644 --- a/src/components/@shared/AssetList/AssetList.tsx +++ b/src/components/@shared/AssetList/AssetList.tsx @@ -4,10 +4,10 @@ import Pagination from '@shared/Pagination' import styles from './AssetList.module.css' import { DDO } from '@oceanprotocol/lib' import classNames from 'classnames/bind' -import { getAssetsBestPrices, AssetListPrices } from '../../../utils/subgraph' +import { getAssetsBestPrices, AssetListPrices } from '@utils/subgraph' import Loader from '../atoms/Loader' -import { useUserPreferences } from '../../../context/UserPreferences' -import { useIsMounted } from '../../../hooks/useIsMounted' +import { useUserPreferences } from '@context/UserPreferences' +import { useIsMounted } from '@hooks/useIsMounted' const cx = classNames.bind(styles) diff --git a/src/components/@shared/AssetList/AssetListTitle.tsx b/src/components/@shared/AssetList/AssetListTitle.tsx index 0771e834a..ab278f100 100644 --- a/src/components/@shared/AssetList/AssetListTitle.tsx +++ b/src/components/@shared/AssetList/AssetListTitle.tsx @@ -1,10 +1,10 @@ import { DDO } from '@oceanprotocol/lib' import { Link } from 'gatsby' import React, { ReactElement, useEffect, useState } from 'react' -import { getAssetsNames } from '../../../utils/aquarius' +import { getAssetsNames } from '@utils/aquarius' import styles from './AssetListTitle.module.css' import axios from 'axios' -import { useSiteMetadata } from '../../../hooks/useSiteMetadata' +import { useSiteMetadata } from '@hooks/useSiteMetadata' export default function AssetListTitle({ ddo, diff --git a/src/components/@shared/AssetTeaser/AssetTeaser.tsx b/src/components/@shared/AssetTeaser/AssetTeaser.tsx index a64966ec2..2cbf3bd0a 100644 --- a/src/components/@shared/AssetTeaser/AssetTeaser.tsx +++ b/src/components/@shared/AssetTeaser/AssetTeaser.tsx @@ -1,12 +1,12 @@ import React from 'react' import { Link } from 'gatsby' import Dotdotdot from 'react-dotdotdot' -import Price from '../atoms/Price' +import Price from '@shared/Price' import { DDO } from '@oceanprotocol/lib' import removeMarkdown from 'remove-markdown' -import Publisher from '../atoms/Publisher' -import AssetType from '../atoms/AssetType' -import NetworkName from '../atoms/NetworkName' +import Publisher from '@shared/Publisher' +import AssetType from '@shared/AssetType' +import NetworkName from '@shared/NetworkName' import styles from './AssetTeaser.module.css' declare type AssetTeaserProps = { diff --git a/src/components/@shared/atoms/AssetType.module.css b/src/components/@shared/AssetType/index.module.css similarity index 100% rename from src/components/@shared/atoms/AssetType.module.css rename to src/components/@shared/AssetType/index.module.css diff --git a/src/components/@shared/atoms/AssetType.tsx b/src/components/@shared/AssetType/index.tsx similarity index 95% rename from src/components/@shared/atoms/AssetType.tsx rename to src/components/@shared/AssetType/index.tsx index 9b63450db..5d30111e9 100644 --- a/src/components/@shared/atoms/AssetType.tsx +++ b/src/components/@shared/AssetType/index.tsx @@ -1,5 +1,5 @@ import React, { ReactElement } from 'react' -import styles from './AssetType.module.css' +import styles from './index.module.css' import classNames from 'classnames/bind' import { ReactComponent as Compute } from '@images/compute.svg' import { ReactComponent as Download } from '@images/download.svg' diff --git a/src/components/@shared/atoms/ButtonBuy.module.css b/src/components/@shared/ButtonBuy/index.module.css similarity index 100% rename from src/components/@shared/atoms/ButtonBuy.module.css rename to src/components/@shared/ButtonBuy/index.module.css diff --git a/src/components/@shared/atoms/ButtonBuy.tsx b/src/components/@shared/ButtonBuy/index.tsx similarity index 98% rename from src/components/@shared/atoms/ButtonBuy.tsx rename to src/components/@shared/ButtonBuy/index.tsx index 91f15d1a1..8033b9f5b 100644 --- a/src/components/@shared/atoms/ButtonBuy.tsx +++ b/src/components/@shared/ButtonBuy/index.tsx @@ -1,7 +1,7 @@ import React, { FormEvent, ReactElement } from 'react' -import Button from './Button' -import styles from './ButtonBuy.module.css' -import Loader from './Loader' +import Button from '../atoms/Button' +import styles from './index.module.css' +import Loader from '../atoms/Loader' interface ButtonBuyProps { action: 'download' | 'compute' diff --git a/src/components/@shared/atoms/DebugOutput.tsx b/src/components/@shared/DebugOutput.tsx similarity index 100% rename from src/components/@shared/atoms/DebugOutput.tsx rename to src/components/@shared/DebugOutput.tsx diff --git a/src/components/@shared/atoms/ExplorerLink.module.css b/src/components/@shared/ExplorerLink/index.module.css similarity index 100% rename from src/components/@shared/atoms/ExplorerLink.module.css rename to src/components/@shared/ExplorerLink/index.module.css diff --git a/src/components/@shared/atoms/ExplorerLink.tsx b/src/components/@shared/ExplorerLink/index.tsx similarity index 96% rename from src/components/@shared/atoms/ExplorerLink.tsx rename to src/components/@shared/ExplorerLink/index.tsx index af0695acf..08d2ac53d 100644 --- a/src/components/@shared/atoms/ExplorerLink.tsx +++ b/src/components/@shared/ExplorerLink/index.tsx @@ -3,7 +3,7 @@ import { ReactComponent as External } from '@images/external.svg' import classNames from 'classnames/bind' import { ConfigHelperConfig } from '@oceanprotocol/lib' import { useOcean } from '@context/Ocean' -import styles from './ExplorerLink.module.css' +import styles from './index.module.css' import { getOceanConfig } from '@utils/ocean' const cx = classNames.bind(styles) diff --git a/src/components/@shared/atoms/File.module.css b/src/components/@shared/FileIcon/index.module.css similarity index 100% rename from src/components/@shared/atoms/File.module.css rename to src/components/@shared/FileIcon/index.module.css diff --git a/src/components/@shared/atoms/File.tsx b/src/components/@shared/FileIcon/index.tsx similarity index 91% rename from src/components/@shared/atoms/File.tsx rename to src/components/@shared/FileIcon/index.tsx index 77a490489..6e3588e17 100644 --- a/src/components/@shared/atoms/File.tsx +++ b/src/components/@shared/FileIcon/index.tsx @@ -3,8 +3,8 @@ import { File as FileMetadata } from '@oceanprotocol/lib' import filesize from 'filesize' import classNames from 'classnames/bind' import cleanupContentType from '@utils/cleanupContentType' -import styles from './File.module.css' -import Loader from './Loader' +import styles from './index.module.css' +import Loader from '@shared/atoms/Loader' const cx = classNames.bind(styles) @@ -16,7 +16,7 @@ function LoaderArea() { ) } -export default function File({ +export default function FileIcon({ file, className, small, diff --git a/src/components/@shared/Form/FormFields/AssetSelection.tsx b/src/components/@shared/Form/FormFields/AssetSelection.tsx index aaef28acc..c229993ed 100644 --- a/src/components/@shared/Form/FormFields/AssetSelection.tsx +++ b/src/components/@shared/Form/FormFields/AssetSelection.tsx @@ -2,7 +2,7 @@ import React, { ChangeEvent, useState } from 'react' import Dotdotdot from 'react-dotdotdot' import slugify from 'slugify' import classNames from 'classnames/bind' -import PriceUnit from '@shared/atoms/Price/PriceUnit' +import PriceUnit from '@shared/Price/PriceUnit' import { ReactComponent as External } from '@images/external.svg' import InputElement from '@shared/Form/Input/InputElement' import Loader from '@shared/atoms/Loader' diff --git a/src/components/@shared/Form/FormFields/CustomProvider.tsx b/src/components/@shared/Form/FormFields/CustomProvider.tsx index 625567f0a..5347b85e7 100644 --- a/src/components/@shared/Form/FormFields/CustomProvider.tsx +++ b/src/components/@shared/Form/FormFields/CustomProvider.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, useState, useEffect } from 'react' import { useField } from 'formik' import { toast } from 'react-toastify' import CustomInput from './URLInput/Input' -import { useOcean } from '../../../../context/Ocean' +import { useOcean } from '@context/Ocean' import { InputProps } from '@shared/Form/Input' export default function CustomProvider(props: InputProps): ReactElement { diff --git a/src/components/@shared/atoms/NetworkName.tsx b/src/components/@shared/NetworkName/NetworkIcon.tsx similarity index 50% rename from src/components/@shared/atoms/NetworkName.tsx rename to src/components/@shared/NetworkName/NetworkIcon.tsx index 99aa0b0eb..88f7ce3e4 100644 --- a/src/components/@shared/atoms/NetworkName.tsx +++ b/src/components/@shared/NetworkName/NetworkIcon.tsx @@ -4,9 +4,7 @@ import { ReactComponent as PolygonIcon } from '@images/polygon.svg' import { ReactComponent as MoonbeamIcon } from '@images/moonbeam.svg' import { ReactComponent as BscIcon } from '@images/bsc.svg' import { ReactComponent as EnergywebIcon } from '@images/energyweb.svg' -import { getNetworkDataById, getNetworkDisplayName } from '@utils/web3' -import styles from './NetworkName.module.css' -import useNetworkMetadata from '@hooks/useNetworkMetadata' +import styles from './index.module.css' export function NetworkIcon({ name }: { name: string }): ReactElement { const IconMapped = name.includes('ETH') @@ -23,29 +21,3 @@ export function NetworkIcon({ name }: { name: string }): ReactElement { return IconMapped ? : null } - -export default function NetworkName({ - networkId, - minimal, - className -}: { - networkId: number - minimal?: boolean - className?: string -}): ReactElement { - const { networksList } = useNetworkMetadata() - const networkData = getNetworkDataById(networksList, networkId) - const networkName = getNetworkDisplayName(networkData, networkId) - - return ( - - {' '} - {networkName} - - ) -} diff --git a/src/components/@shared/atoms/NetworkName.module.css b/src/components/@shared/NetworkName/index.module.css similarity index 100% rename from src/components/@shared/atoms/NetworkName.module.css rename to src/components/@shared/NetworkName/index.module.css diff --git a/src/components/@shared/NetworkName/index.tsx b/src/components/@shared/NetworkName/index.tsx new file mode 100644 index 000000000..84c9dd216 --- /dev/null +++ b/src/components/@shared/NetworkName/index.tsx @@ -0,0 +1,31 @@ +import React, { ReactElement } from 'react' +import { getNetworkDataById, getNetworkDisplayName } from '@utils/web3' +import styles from './index.module.css' +import useNetworkMetadata from '@hooks/useNetworkMetadata' +import { NetworkIcon } from './NetworkIcon' + +export default function NetworkName({ + networkId, + minimal, + className +}: { + networkId: number + minimal?: boolean + className?: string +}): ReactElement { + const { networksList } = useNetworkMetadata() + const networkData = getNetworkDataById(networksList, networkId) + const networkName = getNetworkDisplayName(networkData, networkId) + + return ( + + {' '} + {networkName} + + ) +} diff --git a/src/components/@shared/Pagination/_types.ts b/src/components/@shared/Pagination/_types.ts new file mode 100644 index 000000000..297cf6386 --- /dev/null +++ b/src/components/@shared/Pagination/_types.ts @@ -0,0 +1,7 @@ +export interface PaginationProps { + totalPages?: number + currentPage?: number + onChangePage?(selected: number): void + rowsPerPage?: number + rowCount?: number +} diff --git a/src/components/@shared/Pagination.module.css b/src/components/@shared/Pagination/index.module.css similarity index 100% rename from src/components/@shared/Pagination.module.css rename to src/components/@shared/Pagination/index.module.css diff --git a/src/components/@shared/Pagination.tsx b/src/components/@shared/Pagination/index.tsx similarity index 92% rename from src/components/@shared/Pagination.tsx rename to src/components/@shared/Pagination/index.tsx index 4ab4fedde..19060d84c 100644 --- a/src/components/@shared/Pagination.tsx +++ b/src/components/@shared/Pagination/index.tsx @@ -1,16 +1,9 @@ import React, { useState, useEffect, ReactElement } from 'react' import ReactPaginate from 'react-paginate' -import styles from './Pagination.module.css' +import styles from './index.module.css' import { MAXIMUM_NUMBER_OF_PAGES_WITH_RESULTS } from '@utils/aquarius' import { ReactComponent as Arrow } from '@images/arrow.svg' - -interface PaginationProps { - totalPages?: number - currentPage?: number - onChangePage?(selected: number): void - rowsPerPage?: number - rowCount?: number -} +import { PaginationProps } from './_types' export default function Pagination({ totalPages, diff --git a/src/components/@shared/PoolTransactions/Title.tsx b/src/components/@shared/PoolTransactions/Title.tsx index bf158e192..5134c86ba 100644 --- a/src/components/@shared/PoolTransactions/Title.tsx +++ b/src/components/@shared/PoolTransactions/Title.tsx @@ -1,8 +1,8 @@ import React, { useState, useEffect, ReactElement } from 'react' import { PoolTransaction } from '.' import { useUserPreferences } from '@context/UserPreferences' -import ExplorerLink from '@shared/atoms/ExplorerLink' -import { formatPrice } from '@shared/atoms/Price/PriceUnit' +import ExplorerLink from '@shared/ExplorerLink' +import { formatPrice } from '@shared/Price/PriceUnit' import styles from './Title.module.css' async function getTitle(row: PoolTransaction, locale: string) { diff --git a/src/components/@shared/PoolTransactions/index.tsx b/src/components/@shared/PoolTransactions/index.tsx index 29c68976e..3094ef70b 100644 --- a/src/components/@shared/PoolTransactions/index.tsx +++ b/src/components/@shared/PoolTransactions/index.tsx @@ -8,13 +8,13 @@ import { TransactionHistory_poolTransactions as TransactionHistoryPoolTransactio import web3 from 'web3' import { fetchDataForMultipleChains } from '@utils/subgraph' import { useSiteMetadata } from '@hooks/useSiteMetadata' -import NetworkName from '@shared/atoms/NetworkName' +import NetworkName from '@shared/NetworkName' import { retrieveDDOListByDIDs } from '@utils/aquarius' import { CancelToken } from 'axios' import Title from './Title' import styles from './index.module.css' import { DDO, Logger } from '@oceanprotocol/lib' -import { useCancelToken } from '../../../hooks/useCancelToken' +import { useCancelToken } from '@hooks/useCancelToken' const REFETCH_INTERVAL = 20000 diff --git a/src/components/@shared/atoms/Price/Conversion.module.css b/src/components/@shared/Price/Conversion.module.css similarity index 100% rename from src/components/@shared/atoms/Price/Conversion.module.css rename to src/components/@shared/Price/Conversion.module.css diff --git a/src/components/@shared/atoms/Price/Conversion.tsx b/src/components/@shared/Price/Conversion.tsx similarity index 100% rename from src/components/@shared/atoms/Price/Conversion.tsx rename to src/components/@shared/Price/Conversion.tsx diff --git a/src/components/@shared/atoms/Price/PriceUnit.module.css b/src/components/@shared/Price/PriceUnit.module.css similarity index 100% rename from src/components/@shared/atoms/Price/PriceUnit.module.css rename to src/components/@shared/Price/PriceUnit.module.css diff --git a/src/components/@shared/atoms/Price/PriceUnit.tsx b/src/components/@shared/Price/PriceUnit.tsx similarity index 97% rename from src/components/@shared/atoms/Price/PriceUnit.tsx rename to src/components/@shared/Price/PriceUnit.tsx index e9ce599e7..a1baa95dc 100644 --- a/src/components/@shared/atoms/Price/PriceUnit.tsx +++ b/src/components/@shared/Price/PriceUnit.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames/bind' import Conversion from './Conversion' import styles from './PriceUnit.module.css' import { useUserPreferences } from '@context/UserPreferences' -import Badge from '../Badge' +import Badge from '@shared/atoms/Badge' const cx = classNames.bind(styles) diff --git a/src/components/@shared/atoms/Price/index.module.css b/src/components/@shared/Price/index.module.css similarity index 100% rename from src/components/@shared/atoms/Price/index.module.css rename to src/components/@shared/Price/index.module.css diff --git a/src/components/@shared/atoms/Price/index.tsx b/src/components/@shared/Price/index.tsx similarity index 93% rename from src/components/@shared/atoms/Price/index.tsx rename to src/components/@shared/Price/index.tsx index 2af0a768e..e2eeaef73 100644 --- a/src/components/@shared/atoms/Price/index.tsx +++ b/src/components/@shared/Price/index.tsx @@ -1,7 +1,7 @@ import React, { ReactElement } from 'react' import styles from './index.module.css' -import Loader from '../Loader' -import Tooltip from '../Tooltip' +import Loader from '../atoms/Loader' +import Tooltip from '../atoms/Tooltip' import PriceUnit from './PriceUnit' export default function Price({ diff --git a/src/components/@shared/atoms/Publisher/Add.module.css b/src/components/@shared/Publisher/Add.module.css similarity index 100% rename from src/components/@shared/atoms/Publisher/Add.module.css rename to src/components/@shared/Publisher/Add.module.css diff --git a/src/components/@shared/atoms/Publisher/Add.tsx b/src/components/@shared/Publisher/Add.tsx similarity index 100% rename from src/components/@shared/atoms/Publisher/Add.tsx rename to src/components/@shared/Publisher/Add.tsx diff --git a/src/components/@shared/atoms/Publisher/index.module.css b/src/components/@shared/Publisher/index.module.css similarity index 100% rename from src/components/@shared/atoms/Publisher/index.module.css rename to src/components/@shared/Publisher/index.module.css diff --git a/src/components/@shared/atoms/Publisher/index.tsx b/src/components/@shared/Publisher/index.tsx similarity index 100% rename from src/components/@shared/atoms/Publisher/index.tsx rename to src/components/@shared/Publisher/index.tsx diff --git a/src/components/@shared/atoms/SuccessConfetti.module.css b/src/components/@shared/SuccessConfetti/index.module.css similarity index 100% rename from src/components/@shared/atoms/SuccessConfetti.module.css rename to src/components/@shared/SuccessConfetti/index.module.css diff --git a/src/components/@shared/atoms/SuccessConfetti.tsx b/src/components/@shared/SuccessConfetti/index.tsx similarity index 93% rename from src/components/@shared/atoms/SuccessConfetti.tsx rename to src/components/@shared/SuccessConfetti/index.tsx index 329080741..6b2c24caf 100644 --- a/src/components/@shared/atoms/SuccessConfetti.tsx +++ b/src/components/@shared/SuccessConfetti/index.tsx @@ -1,7 +1,7 @@ -import Alert from './Alert' import React, { ReactElement, ReactNode, useEffect } from 'react' import { confetti } from 'dom-confetti' -import styles from './SuccessConfetti.module.css' +import Alert from '@shared/atoms/Alert' +import styles from './index.module.css' const confettiConfig = { angle: 90, diff --git a/src/components/@shared/SyncStatus.module.css b/src/components/@shared/SyncStatus/index.module.css similarity index 100% rename from src/components/@shared/SyncStatus.module.css rename to src/components/@shared/SyncStatus/index.module.css diff --git a/src/components/@shared/SyncStatus.tsx b/src/components/@shared/SyncStatus/index.tsx similarity index 93% rename from src/components/@shared/SyncStatus.tsx rename to src/components/@shared/SyncStatus/index.tsx index 4739984e8..e92a22cf1 100644 --- a/src/components/@shared/SyncStatus.tsx +++ b/src/components/@shared/SyncStatus/index.tsx @@ -2,7 +2,7 @@ import React, { ReactElement } from 'react' import Tooltip from '@shared/atoms/Tooltip' import Status from '@shared/atoms/Status' import { useGraphSyncStatus } from '@hooks/useGraphSyncStatus' -import styles from './SyncStatus.module.css' +import styles from './index.module.css' export default function SyncStatus(): ReactElement { const { isGraphSynced, blockGraph, blockHead } = useGraphSyncStatus() diff --git a/src/components/@shared/TokenApproval/ButtonApprove.tsx b/src/components/@shared/TokenApproval/ButtonApprove.tsx new file mode 100644 index 000000000..359c82b0d --- /dev/null +++ b/src/components/@shared/TokenApproval/ButtonApprove.tsx @@ -0,0 +1,63 @@ +import React from 'react' +import Button from '@shared/atoms/Button' +import Loader from '@shared/atoms/Loader' +import { useUserPreferences } from '@context/UserPreferences' +import Tooltip from '@shared/atoms/Tooltip' +import { useStaticQuery, graphql } from 'gatsby' +import { ReactElement } from 'react-markdown' + +export const query = graphql` + query { + content: allFile(filter: { relativePath: { eq: "price.json" } }) { + edges { + node { + childContentJson { + pool { + tooltips { + approveSpecific + approveInfinite + } + } + } + } + } + } + } +` + +export function ButtonApprove({ + amount, + coin, + approveTokens, + isLoading +}: { + amount: string + coin: string + approveTokens: (amount: string) => void + isLoading: boolean +}): ReactElement { + // Get content + const data = useStaticQuery(query) + const content = data.content.edges[0].node.childContentJson.pool.tooltips + + const { infiniteApproval } = useUserPreferences() + + return isLoading ? ( + + ) : infiniteApproval ? ( + + ) : ( + + ) +} diff --git a/src/components/@shared/TokenApproval.tsx b/src/components/@shared/TokenApproval/index.tsx similarity index 56% rename from src/components/@shared/TokenApproval.tsx rename to src/components/@shared/TokenApproval/index.tsx index 59d7baaef..590da0660 100644 --- a/src/components/@shared/TokenApproval.tsx +++ b/src/components/@shared/TokenApproval/index.tsx @@ -1,70 +1,10 @@ import React, { ReactElement, useCallback, useEffect, useState } from 'react' -import Button from '@shared/atoms/Button' import { useOcean } from '@context/Ocean' import { useAsset } from '@context/Asset' -import Loader from '@shared/atoms/Loader' import { useWeb3 } from '@context/Web3' -import { useUserPreferences } from '@context/UserPreferences' -import Tooltip from '@shared/atoms/Tooltip' -import { graphql, useStaticQuery } from 'gatsby' import Decimal from 'decimal.js' import { getOceanConfig } from '@utils/ocean' - -const query = graphql` - query { - content: allFile(filter: { relativePath: { eq: "price.json" } }) { - edges { - node { - childContentJson { - pool { - tooltips { - approveSpecific - approveInfinite - } - } - } - } - } - } - } -` - -function ButtonApprove({ - amount, - coin, - approveTokens, - isLoading -}: { - amount: string - coin: string - approveTokens: (amount: string) => void - isLoading: boolean -}) { - // Get content - const data = useStaticQuery(query) - const content = data.content.edges[0].node.childContentJson.pool.tooltips - - const { infiniteApproval } = useUserPreferences() - - return isLoading ? ( - - ) : infiniteApproval ? ( - - ) : ( - - ) -} +import { ButtonApprove } from './ButtonApprove' export default function TokenApproval({ actionButton, @@ -104,7 +44,7 @@ export default function TokenApproval({ setTokenApproved( new Decimal(allowance).greaterThanOrEqualTo(new Decimal(amount)) ) - }, [ocean, tokenAddress, spender, accountId, amount]) + }, [ocean, tokenAddress, spender, accountId, amount, isAssetNetwork]) useEffect(() => { checkTokenApproval() diff --git a/src/components/@shared/WalletNetworkSwitcher.module.css b/src/components/@shared/WalletNetworkSwitcher/index.module.css similarity index 100% rename from src/components/@shared/WalletNetworkSwitcher.module.css rename to src/components/@shared/WalletNetworkSwitcher/index.module.css diff --git a/src/components/@shared/WalletNetworkSwitcher.tsx b/src/components/@shared/WalletNetworkSwitcher/index.tsx similarity index 96% rename from src/components/@shared/WalletNetworkSwitcher.tsx rename to src/components/@shared/WalletNetworkSwitcher/index.tsx index 9ccd9e4e8..5d69af6ad 100644 --- a/src/components/@shared/WalletNetworkSwitcher.tsx +++ b/src/components/@shared/WalletNetworkSwitcher/index.tsx @@ -6,7 +6,7 @@ import { getNetworkDataById } from '@utils/web3' import Button from '@shared/atoms/Button' -import styles from './WalletNetworkSwitcher.module.css' +import styles from './index.module.css' import useNetworkMetadata from '@hooks/useNetworkMetadata' import { useAsset } from '@context/Asset' diff --git a/src/components/@shared/Web3Feedback.module.css b/src/components/@shared/Web3Feedback/index.module.css similarity index 100% rename from src/components/@shared/Web3Feedback.module.css rename to src/components/@shared/Web3Feedback/index.module.css diff --git a/src/components/@shared/Web3Feedback.tsx b/src/components/@shared/Web3Feedback/index.tsx similarity index 95% rename from src/components/@shared/Web3Feedback.tsx rename to src/components/@shared/Web3Feedback/index.tsx index 893746af1..94bbffe4d 100644 --- a/src/components/@shared/Web3Feedback.tsx +++ b/src/components/@shared/Web3Feedback/index.tsx @@ -1,8 +1,8 @@ import React, { ReactElement, useEffect, useState } from 'react' import { useWeb3 } from '@context/Web3' import Status from '@shared/atoms/Status' -import styles from './Web3Feedback.module.css' -import WalletNetworkSwitcher from './WalletNetworkSwitcher' +import styles from './index.module.css' +import WalletNetworkSwitcher from '../WalletNetworkSwitcher' import { useGraphSyncStatus } from '@hooks/useGraphSyncStatus' export declare type Web3Error = { diff --git a/src/components/@shared/atoms/SearchFilterSection.module.css b/src/components/@shared/atoms/SearchFilterSection.module.css deleted file mode 100644 index f598be3d0..000000000 --- a/src/components/@shared/atoms/SearchFilterSection.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.filterSection { - margin-bottom: var(--spacer); -} diff --git a/src/components/@shared/atoms/SearchFilterSection.tsx b/src/components/@shared/atoms/SearchFilterSection.tsx deleted file mode 100644 index e9c8d23df..000000000 --- a/src/components/@shared/atoms/SearchFilterSection.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react' - -import styles from './SearchFilterSection.module.css' - -const SearchFilterSection = ({ - title, - children -}: { - title?: string - children: React.ReactNode -}) => { - return ( -
- {title ?

{title}

: null} - {children} -
- ) -} - -export default SearchFilterSection diff --git a/src/components/@shared/atoms/Table.module.css b/src/components/@shared/atoms/Table.module.css index cd3b05044..3401fcdbc 100644 --- a/src/components/@shared/atoms/Table.module.css +++ b/src/components/@shared/atoms/Table.module.css @@ -74,9 +74,9 @@ div [class*='Table-module'] { } .arrow { - composes: arrow from '@shared/Pagination.module.css'; + composes: arrow from '@shared/Pagination/index.module.css'; } .previous { - composes: previous from '@shared/Pagination.module.css'; + composes: previous from '@shared/Pagination/index.module.css'; } diff --git a/src/components/App.tsx b/src/components/App.tsx index 701eb35ce..85b722e26 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -3,13 +3,13 @@ import { graphql, PageProps, useStaticQuery } from 'gatsby' import Alert from '@shared/atoms/Alert' import Footer from './Footer/Footer' import Header from './Header' -import Styles from '../global/Styles' +import StylesGlobal from '../stylesGlobal/StylesGlobal' import { useWeb3 } from '@context/Web3' import { useSiteMetadata } from '@hooks/useSiteMetadata' import { useAccountPurgatory } from '@hooks/useAccountPurgatory' -import AnnouncementBanner from '@shared/atoms/AnnouncementBanner' -import styles from './App.module.css' +import AnnouncementBanner from '@shared/AnnouncementBanner' import PrivacyPreferenceCenter from './Privacy/PrivacyPreferenceCenter' +import styles from './App.module.css' const contentQuery = graphql` query AppQuery { @@ -42,7 +42,7 @@ export default function App({ const { isInPurgatory, purgatoryData } = useAccountPurgatory(accountId) return ( - +
{(props as PageProps).uri === '/' && ( @@ -64,6 +64,6 @@ export default function App({ )}
-
+ ) } diff --git a/src/components/@shared/AssetActionHistoryTable.module.css b/src/components/Asset/AssetActions/AssetActionHistoryTable.module.css similarity index 100% rename from src/components/@shared/AssetActionHistoryTable.module.css rename to src/components/Asset/AssetActions/AssetActionHistoryTable.module.css diff --git a/src/components/@shared/AssetActionHistoryTable.tsx b/src/components/Asset/AssetActions/AssetActionHistoryTable.tsx similarity index 100% rename from src/components/@shared/AssetActionHistoryTable.tsx rename to src/components/Asset/AssetActions/AssetActionHistoryTable.tsx diff --git a/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx b/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx index bff871984..76dbeb7f1 100644 --- a/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx +++ b/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx @@ -6,7 +6,7 @@ import { useStaticQuery, graphql } from 'gatsby' import { DDO } from '@oceanprotocol/lib' import { AssetSelectionAsset } from '@shared/Form/FormFields/AssetSelection' import { compareAsBN } from '@utils/numbers' -import ButtonBuy from '@shared/atoms/ButtonBuy' +import ButtonBuy from '@shared/ButtonBuy' import PriceOutput from './PriceOutput' import { useAsset } from '@context/Asset' import { useOcean } from '@context/Ocean' diff --git a/src/components/Asset/AssetActions/Compute/PriceOutput.tsx b/src/components/Asset/AssetActions/Compute/PriceOutput.tsx index 9b38571b9..c947a805a 100644 --- a/src/components/Asset/AssetActions/Compute/PriceOutput.tsx +++ b/src/components/Asset/AssetActions/Compute/PriceOutput.tsx @@ -1,6 +1,6 @@ import React, { ReactElement } from 'react' -import { useAsset } from '../../../../context/Asset' -import PriceUnit from '@shared/atoms/Price/PriceUnit' +import { useAsset } from '@context/Asset' +import PriceUnit from '@shared/Price/PriceUnit' import Tooltip from '@shared/atoms/Tooltip' import styles from './PriceOutput.module.css' diff --git a/src/components/Asset/AssetActions/Compute/index.tsx b/src/components/Asset/AssetActions/Compute/index.tsx index 9989129f8..0424e60f6 100644 --- a/src/components/Asset/AssetActions/Compute/index.tsx +++ b/src/components/Asset/AssetActions/Compute/index.tsx @@ -6,8 +6,8 @@ import { publisherTrustedAlgorithm } from '@oceanprotocol/lib' import { toast } from 'react-toastify' -import Price from '@shared/atoms/Price' -import File from '@shared/atoms/File' +import Price from '@shared/Price' +import FileIcon from '@shared/FileIcon' import Alert from '@shared/atoms/Alert' import { useSiteMetadata } from '@hooks/useSiteMetadata' import { useOcean } from '@context/Ocean' @@ -28,13 +28,13 @@ import { import axios from 'axios' import FormStartComputeDataset from './FormComputeDataset' import styles from './index.module.css' -import SuccessConfetti from '@shared/atoms/SuccessConfetti' +import SuccessConfetti from '@shared/SuccessConfetti' import Button from '@shared/atoms/Button' import { secondsToString } from '@utils/metadata' import { AssetSelectionAsset } from '@shared/Form/FormFields/AssetSelection' import AlgorithmDatasetsListForCompute from '../../AssetContent/AlgorithmDatasetsListForCompute' import { getPreviousOrders, getPrice } from '@utils/subgraph' -import AssetActionHistoryTable from '@shared/AssetActionHistoryTable' +import AssetActionHistoryTable from '../AssetActionHistoryTable' import ComputeJobs from '../../../Profile/History/ComputeJobs' import { useCancelToken } from '@hooks/useCancelToken' import { useIsMounted } from '@hooks/useIsMounted' @@ -406,7 +406,7 @@ export default function Compute({ return ( <>
- +
diff --git a/src/components/Asset/AssetActions/Consume.tsx b/src/components/Asset/AssetActions/Consume.tsx index 3a6b04d2a..ae013decf 100644 --- a/src/components/Asset/AssetActions/Consume.tsx +++ b/src/components/Asset/AssetActions/Consume.tsx @@ -1,23 +1,23 @@ import React, { ReactElement, useEffect, useState } from 'react' import { toast } from 'react-toastify' import { File as FileMetadata, DDO } from '@oceanprotocol/lib' -import File from '@shared/atoms/File' -import Price from '@shared/atoms/Price' -import { useSiteMetadata } from '../../../hooks/useSiteMetadata' -import { useAsset } from '../../../context/Asset' +import FileIcon from '@shared/FileIcon' +import Price from '@shared/Price' +import { useSiteMetadata } from '@hooks/useSiteMetadata' +import { useAsset } from '@context/Asset' import { gql } from 'urql' -import { fetchData, getQueryContext } from '../../../utils/subgraph' +import { fetchData, getQueryContext } from '@utils/subgraph' import { OrdersData } from '../../../@types/apollo/OrdersData' import BigNumber from 'bignumber.js' -import { useOcean } from '../../../context/Ocean' -import { useWeb3 } from '../../../context/Web3' -import { usePricing } from '../../../hooks/usePricing' -import { useConsume } from '../../../hooks/useConsume' -import ButtonBuy from '@shared/atoms/ButtonBuy' -import { secondsToString } from '../../../utils/metadata' +import { useOcean } from '@context/Ocean' +import { useWeb3 } from '@context/Web3' +import { usePricing } from '@hooks/usePricing' +import { useConsume } from '@hooks/useConsume' +import ButtonBuy from '@shared/ButtonBuy' +import { secondsToString } from '@utils/metadata' import AlgorithmDatasetsListForCompute from '../AssetContent/AlgorithmDatasetsListForCompute' import styles from './Consume.module.css' -import { useIsMounted } from '../../../hooks/useIsMounted' +import { useIsMounted } from '@hooks/useIsMounted' const previousOrderQuery = gql` query PreviousOrder($id: String!, $account: String!) { @@ -196,7 +196,7 @@ export default function Consume({