more reorganization
@ -4,7 +4,7 @@
|
|||||||
"siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.",
|
"siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.",
|
||||||
"siteUrl": "https://market.oceanprotocol.com",
|
"siteUrl": "https://market.oceanprotocol.com",
|
||||||
"siteIcon": "node_modules/@oceanprotocol/art/logo/favicon-white.png",
|
"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)",
|
"copyright": "All Rights Reserved. Powered by [Ocean Protocol](https://oceanprotocol.com)",
|
||||||
"menu": [
|
"menu": [
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ module.exports = {
|
|||||||
resolve: 'gatsby-source-filesystem',
|
resolve: 'gatsby-source-filesystem',
|
||||||
options: {
|
options: {
|
||||||
name: 'images',
|
name: 'images',
|
||||||
path: `${__dirname}/src/images`
|
path: `${__dirname}/src/@images`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -77,10 +77,10 @@ exports.onCreateWebpackConfig = ({ actions }) => {
|
|||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@shared': path.resolve(__dirname, 'src/components/@shared'),
|
'@shared': path.resolve(__dirname, 'src/components/@shared'),
|
||||||
'@hooks': path.resolve(__dirname, 'src/hooks'),
|
'@hooks': path.resolve(__dirname, 'src/@hooks'),
|
||||||
'@context': path.resolve(__dirname, 'src/context'),
|
'@context': path.resolve(__dirname, 'src/@context'),
|
||||||
'@images': path.resolve(__dirname, 'src/images'),
|
'@images': path.resolve(__dirname, 'src/@images'),
|
||||||
'@utils': path.resolve(__dirname, 'src/utils')
|
'@utils': path.resolve(__dirname, 'src/@utils')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
|
@ -11,16 +11,18 @@ import {
|
|||||||
getPoolSharesData,
|
getPoolSharesData,
|
||||||
getUserSales,
|
getUserSales,
|
||||||
getUserTokenOrders
|
getUserTokenOrders
|
||||||
} from '../utils/subgraph'
|
} from '@utils/subgraph'
|
||||||
import { useUserPreferences } from './UserPreferences'
|
import { useUserPreferences } from './UserPreferences'
|
||||||
import { PoolShares_poolShares as PoolShare } from '../@types/apollo/PoolShares'
|
import { PoolShares_poolShares as PoolShare } from '../@types/apollo/PoolShares'
|
||||||
import { DDO, Logger } from '@oceanprotocol/lib'
|
import { DDO, Logger } from '@oceanprotocol/lib'
|
||||||
import { getDownloadAssets, getPublishedAssets } from '../utils/aquarius'
|
import { getDownloadAssets, getPublishedAssets } from '../utils/aquarius'
|
||||||
import { useSiteMetadata } from '../hooks/useSiteMetadata'
|
getPublishedAssets
|
||||||
import { accountTruncate } from '../utils/web3'
|
} from '@utils/aquarius'
|
||||||
|
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
||||||
|
import { accountTruncate } from '@utils/web3'
|
||||||
import axios, { CancelToken } from 'axios'
|
import axios, { CancelToken } from 'axios'
|
||||||
import ethereumAddress from 'ethereum-address'
|
import ethereumAddress from 'ethereum-address'
|
||||||
import get3BoxProfile from '../utils/profile'
|
import get3BoxProfile from '@utils/profile'
|
||||||
import web3 from 'web3'
|
import web3 from 'web3'
|
||||||
import { DownloadedAsset } from '../models/aquarius/DownloadedAsset'
|
import { DownloadedAsset } from '../models/aquarius/DownloadedAsset'
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
import { createClient, Provider, Client } from 'urql'
|
import { createClient, Provider, Client } from 'urql'
|
||||||
import React, { useState, useEffect, ReactNode, ReactElement } from 'react'
|
import React, { useState, useEffect, ReactNode, ReactElement } from 'react'
|
||||||
import { Logger } from '@oceanprotocol/lib'
|
import { Logger } from '@oceanprotocol/lib'
|
||||||
import { getOceanConfig } from '../utils/ocean'
|
import { getOceanConfig } from '@utils/ocean'
|
||||||
|
|
||||||
let urqlClient: Client
|
let urqlClient: Client
|
||||||
|
|
@ -7,7 +7,7 @@ import React, {
|
|||||||
useEffect
|
useEffect
|
||||||
} from 'react'
|
} from 'react'
|
||||||
import { Logger, LogLevel } from '@oceanprotocol/lib'
|
import { Logger, LogLevel } from '@oceanprotocol/lib'
|
||||||
import { isBrowser } from '../utils'
|
import { isBrowser } from '@utils/index'
|
||||||
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
||||||
|
|
||||||
interface UserPreferencesValue {
|
interface UserPreferencesValue {
|
@ -12,15 +12,15 @@ import Web3Modal, { getProviderInfo, IProviderInfo } from 'web3modal'
|
|||||||
import { infuraProjectId as infuraId, portisId } from '../../app.config'
|
import { infuraProjectId as infuraId, portisId } from '../../app.config'
|
||||||
import WalletConnectProvider from '@walletconnect/web3-provider'
|
import WalletConnectProvider from '@walletconnect/web3-provider'
|
||||||
import { Logger } from '@oceanprotocol/lib'
|
import { Logger } from '@oceanprotocol/lib'
|
||||||
import { isBrowser } from '../utils'
|
import { isBrowser } from '@utils/index'
|
||||||
import {
|
import {
|
||||||
EthereumListsChain,
|
EthereumListsChain,
|
||||||
getNetworkDataById,
|
getNetworkDataById,
|
||||||
getNetworkDisplayName
|
getNetworkDisplayName
|
||||||
} from '../utils/web3'
|
} from '@utils/web3'
|
||||||
import { getEnsName } from '../utils/ens'
|
import { getEnsName } from '@utils/ens'
|
||||||
import { getOceanBalance } from '../utils/ocean'
|
import { getOceanBalance } from '@utils/ocean'
|
||||||
import useNetworkMetadata from '../hooks/useNetworkMetadata'
|
import useNetworkMetadata from '@hooks/useNetworkMetadata'
|
||||||
|
|
||||||
interface Web3ProviderValue {
|
interface Web3ProviderValue {
|
||||||
web3: Web3
|
web3: Web3
|
@ -1,9 +1,6 @@
|
|||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import { Logger } from '@oceanprotocol/lib'
|
import { Logger } from '@oceanprotocol/lib'
|
||||||
import {
|
import { PurgatoryDataAccount, getAccountPurgatoryData } from '@utils/purgatory'
|
||||||
PurgatoryDataAccount,
|
|
||||||
getAccountPurgatoryData
|
|
||||||
} from '../utils/purgatory'
|
|
||||||
|
|
||||||
interface UseAccountPurgatory {
|
interface UseAccountPurgatory {
|
||||||
isInPurgatory: boolean
|
isInPurgatory: boolean
|
@ -1,8 +1,8 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { consumeFeedback } from '../utils/feedback'
|
import { consumeFeedback } from '@utils/feedback'
|
||||||
import { DID, Logger, ServiceType } from '@oceanprotocol/lib'
|
import { DID, Logger, ServiceType } from '@oceanprotocol/lib'
|
||||||
import { useOcean } from '../context/Ocean'
|
import { useOcean } from '@context/Ocean'
|
||||||
import { useWeb3 } from '../context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
|
|
||||||
interface UseConsume {
|
interface UseConsume {
|
||||||
consume: (
|
consume: (
|
@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { useOcean } from '../context/Ocean'
|
import { useOcean } from '@context/Ocean'
|
||||||
import { useWeb3 } from '../context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
import { Logger } from '@oceanprotocol/lib'
|
import { Logger } from '@oceanprotocol/lib'
|
||||||
import Web3 from 'web3'
|
import Web3 from 'web3'
|
||||||
import { ConfigHelperConfig } from '@oceanprotocol/lib/dist/node/utils/ConfigHelper'
|
import { ConfigHelperConfig } from '@oceanprotocol/lib/dist/node/utils/ConfigHelper'
|
@ -1,5 +1,5 @@
|
|||||||
import { useStaticQuery, graphql } from 'gatsby'
|
import { useStaticQuery, graphql } from 'gatsby'
|
||||||
import { EthereumListsChain } from '../utils/web3'
|
import { EthereumListsChain } from '@utils/web3'
|
||||||
|
|
||||||
export interface UseNetworkMetadata {
|
export interface UseNetworkMetadata {
|
||||||
networksList: { node: EthereumListsChain }[]
|
networksList: { node: EthereumListsChain }[]
|
@ -8,11 +8,10 @@ import {
|
|||||||
getBuyDTFeedback,
|
getBuyDTFeedback,
|
||||||
getCreateFreePricingFeedback,
|
getCreateFreePricingFeedback,
|
||||||
getDispenseFeedback
|
getDispenseFeedback
|
||||||
} from '../utils/feedback'
|
} from '@utils/feedback'
|
||||||
import { sleep } from '../utils'
|
import { sleep } from '@utils/index'
|
||||||
|
import { useOcean } from '@context/Ocean'
|
||||||
import { useOcean } from '../context/Ocean'
|
import { useWeb3 } from '@context/Web3'
|
||||||
import { useWeb3 } from '../context/Web3'
|
|
||||||
|
|
||||||
interface UsePricing {
|
interface UsePricing {
|
||||||
getDTSymbol: (ddo: DDO) => Promise<string>
|
getDTSymbol: (ddo: DDO) => Promise<string>
|
@ -5,11 +5,11 @@ import {
|
|||||||
ServiceType
|
ServiceType
|
||||||
} from '@oceanprotocol/lib/dist/node/ddo/interfaces/Service'
|
} from '@oceanprotocol/lib/dist/node/ddo/interfaces/Service'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { sleep } from '../utils'
|
import { sleep } from '@utils/index'
|
||||||
import { publishFeedback } from '../utils/feedback'
|
import { publishFeedback } from '@utils/feedback'
|
||||||
import { useOcean } from '../context/Ocean'
|
import { useOcean } from '@context/Ocean'
|
||||||
import { useWeb3 } from '../context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
import { getOceanConfig } from '../utils/ocean'
|
import { getOceanConfig } from '@utils/ocean'
|
||||||
|
|
||||||
interface DataTokenOptions {
|
interface DataTokenOptions {
|
||||||
cap?: string
|
cap?: string
|
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 217 B After Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 364 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 698 B |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@ -74,10 +74,9 @@ export default async function get3BoxProfile(
|
|||||||
cancelToken: CancelToken
|
cancelToken: CancelToken
|
||||||
): Promise<Profile> {
|
): Promise<Profile> {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ResponseData3Box> = await axios(
|
const response = (await axios(`${apiUri}/profile/${accountId}`, {
|
||||||
`${apiUri}/profile/${accountId}`,
|
cancelToken
|
||||||
{ cancelToken }
|
})) as AxiosResponse<ResponseData3Box>
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!response ||
|
!response ||
|
@ -8,13 +8,15 @@ export async function fileinfo(
|
|||||||
cancelToken: CancelToken
|
cancelToken: CancelToken
|
||||||
): Promise<FileMetadata> {
|
): Promise<FileMetadata> {
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse = await axios.post(
|
const response = (await axios.post(
|
||||||
`${providerUri}/api/v1/services/fileinfo`,
|
`${providerUri}/api/v1/services/fileinfo`,
|
||||||
{
|
{
|
||||||
url,
|
url,
|
||||||
cancelToken
|
cancelToken
|
||||||
}
|
}
|
||||||
)
|
)) as AxiosResponse<
|
||||||
|
{ valid: boolean; contentLength: string; contentType: string }[]
|
||||||
|
>
|
||||||
|
|
||||||
if (!response || response.status !== 200 || !response.data) {
|
if (!response || response.status !== 200 || !response.data) {
|
||||||
toast.error('Could not connect to File API')
|
toast.error('Could not connect to File API')
|
@ -11,13 +11,18 @@ export interface PurgatoryDataAccount {
|
|||||||
export default async function getAssetPurgatoryData(
|
export default async function getAssetPurgatoryData(
|
||||||
did: string
|
did: string
|
||||||
): Promise<PurgatoryDataAsset> {
|
): Promise<PurgatoryDataAsset> {
|
||||||
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 }
|
return { did: data[0]?.did, reason: data[0]?.reason }
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAccountPurgatoryData(
|
export async function getAccountPurgatoryData(
|
||||||
address: string
|
address: string
|
||||||
): Promise<PurgatoryDataAccount> {
|
): Promise<PurgatoryDataAccount> {
|
||||||
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 }
|
return { address: data[0]?.address, reason: data[0]?.reason }
|
||||||
}
|
}
|
@ -252,7 +252,7 @@ const UserTokenOrders = gql`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
const UserSalesQuery = gql`
|
const UserSalesQuery = gql`
|
||||||
query UserSalesQuery($userSalesId: String) {
|
query UserSalesQuery($userSalesId: ID) {
|
||||||
users(where: { id: $userSalesId }) {
|
users(where: { id: $userSalesId }) {
|
||||||
id
|
id
|
||||||
nrSales
|
nrSales
|
@ -2,8 +2,8 @@ import React, { ReactElement } from 'react'
|
|||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import { addTokenToWallet } from '@utils/web3'
|
import { addTokenToWallet } from '@utils/web3'
|
||||||
import { useWeb3 } from '@context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
import Button from './Button'
|
import Button from '@shared/atoms/Button'
|
||||||
import styles from './AddToken.module.css'
|
import styles from './index.module.css'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import Markdown from './Markdown'
|
import Markdown from '@shared/atoms/Markdown'
|
||||||
import Button from './Button'
|
import Button from '@shared/atoms/Button'
|
||||||
import styles from './AnnouncementBanner.module.css'
|
import styles from './index.module.css'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Dotdotdot from 'react-dotdotdot'
|
import Dotdotdot from 'react-dotdotdot'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import PriceUnit from '@shared/atoms/Price/PriceUnit'
|
import PriceUnit from '@shared/Price/PriceUnit'
|
||||||
import Loader from '@shared/atoms/Loader'
|
import Loader from '@shared/atoms/Loader'
|
||||||
import styles from './AssetComputeList.module.css'
|
import styles from './AssetComputeList.module.css'
|
||||||
import { AssetSelectionAsset } from '@shared/Form/FormFields/AssetSelection'
|
import { AssetSelectionAsset } from '@shared/Form/FormFields/AssetSelection'
|
||||||
|
@ -4,10 +4,10 @@ import Pagination from '@shared/Pagination'
|
|||||||
import styles from './AssetList.module.css'
|
import styles from './AssetList.module.css'
|
||||||
import { DDO } from '@oceanprotocol/lib'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import { getAssetsBestPrices, AssetListPrices } from '../../../utils/subgraph'
|
import { getAssetsBestPrices, AssetListPrices } from '@utils/subgraph'
|
||||||
import Loader from '../atoms/Loader'
|
import Loader from '../atoms/Loader'
|
||||||
import { useUserPreferences } from '../../../context/UserPreferences'
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
import { useIsMounted } from '../../../hooks/useIsMounted'
|
import { useIsMounted } from '@hooks/useIsMounted'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { DDO } from '@oceanprotocol/lib'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import React, { ReactElement, useEffect, useState } from 'react'
|
import React, { ReactElement, useEffect, useState } from 'react'
|
||||||
import { getAssetsNames } from '../../../utils/aquarius'
|
import { getAssetsNames } from '@utils/aquarius'
|
||||||
import styles from './AssetListTitle.module.css'
|
import styles from './AssetListTitle.module.css'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { useSiteMetadata } from '../../../hooks/useSiteMetadata'
|
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
||||||
|
|
||||||
export default function AssetListTitle({
|
export default function AssetListTitle({
|
||||||
ddo,
|
ddo,
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import Dotdotdot from 'react-dotdotdot'
|
import Dotdotdot from 'react-dotdotdot'
|
||||||
import Price from '../atoms/Price'
|
import Price from '@shared/Price'
|
||||||
import { DDO } from '@oceanprotocol/lib'
|
import { DDO } from '@oceanprotocol/lib'
|
||||||
import removeMarkdown from 'remove-markdown'
|
import removeMarkdown from 'remove-markdown'
|
||||||
import Publisher from '../atoms/Publisher'
|
import Publisher from '@shared/Publisher'
|
||||||
import AssetType from '../atoms/AssetType'
|
import AssetType from '@shared/AssetType'
|
||||||
import NetworkName from '../atoms/NetworkName'
|
import NetworkName from '@shared/NetworkName'
|
||||||
import styles from './AssetTeaser.module.css'
|
import styles from './AssetTeaser.module.css'
|
||||||
|
|
||||||
declare type AssetTeaserProps = {
|
declare type AssetTeaserProps = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import styles from './AssetType.module.css'
|
import styles from './index.module.css'
|
||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import { ReactComponent as Compute } from '@images/compute.svg'
|
import { ReactComponent as Compute } from '@images/compute.svg'
|
||||||
import { ReactComponent as Download } from '@images/download.svg'
|
import { ReactComponent as Download } from '@images/download.svg'
|
@ -1,7 +1,7 @@
|
|||||||
import React, { FormEvent, ReactElement } from 'react'
|
import React, { FormEvent, ReactElement } from 'react'
|
||||||
import Button from './Button'
|
import Button from '../atoms/Button'
|
||||||
import styles from './ButtonBuy.module.css'
|
import styles from './index.module.css'
|
||||||
import Loader from './Loader'
|
import Loader from '../atoms/Loader'
|
||||||
|
|
||||||
interface ButtonBuyProps {
|
interface ButtonBuyProps {
|
||||||
action: 'download' | 'compute'
|
action: 'download' | 'compute'
|
@ -3,7 +3,7 @@ import { ReactComponent as External } from '@images/external.svg'
|
|||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import { ConfigHelperConfig } from '@oceanprotocol/lib'
|
import { ConfigHelperConfig } from '@oceanprotocol/lib'
|
||||||
import { useOcean } from '@context/Ocean'
|
import { useOcean } from '@context/Ocean'
|
||||||
import styles from './ExplorerLink.module.css'
|
import styles from './index.module.css'
|
||||||
import { getOceanConfig } from '@utils/ocean'
|
import { getOceanConfig } from '@utils/ocean'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
@ -3,8 +3,8 @@ import { File as FileMetadata } from '@oceanprotocol/lib'
|
|||||||
import filesize from 'filesize'
|
import filesize from 'filesize'
|
||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import cleanupContentType from '@utils/cleanupContentType'
|
import cleanupContentType from '@utils/cleanupContentType'
|
||||||
import styles from './File.module.css'
|
import styles from './index.module.css'
|
||||||
import Loader from './Loader'
|
import Loader from '@shared/atoms/Loader'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ function LoaderArea() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function File({
|
export default function FileIcon({
|
||||||
file,
|
file,
|
||||||
className,
|
className,
|
||||||
small,
|
small,
|
@ -2,7 +2,7 @@ import React, { ChangeEvent, useState } from 'react'
|
|||||||
import Dotdotdot from 'react-dotdotdot'
|
import Dotdotdot from 'react-dotdotdot'
|
||||||
import slugify from 'slugify'
|
import slugify from 'slugify'
|
||||||
import classNames from 'classnames/bind'
|
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 { ReactComponent as External } from '@images/external.svg'
|
||||||
import InputElement from '@shared/Form/Input/InputElement'
|
import InputElement from '@shared/Form/Input/InputElement'
|
||||||
import Loader from '@shared/atoms/Loader'
|
import Loader from '@shared/atoms/Loader'
|
||||||
|
@ -2,7 +2,7 @@ import React, { ReactElement, useState, useEffect } from 'react'
|
|||||||
import { useField } from 'formik'
|
import { useField } from 'formik'
|
||||||
import { toast } from 'react-toastify'
|
import { toast } from 'react-toastify'
|
||||||
import CustomInput from './URLInput/Input'
|
import CustomInput from './URLInput/Input'
|
||||||
import { useOcean } from '../../../../context/Ocean'
|
import { useOcean } from '@context/Ocean'
|
||||||
import { InputProps } from '@shared/Form/Input'
|
import { InputProps } from '@shared/Form/Input'
|
||||||
|
|
||||||
export default function CustomProvider(props: InputProps): ReactElement {
|
export default function CustomProvider(props: InputProps): ReactElement {
|
||||||
|
@ -4,9 +4,7 @@ import { ReactComponent as PolygonIcon } from '@images/polygon.svg'
|
|||||||
import { ReactComponent as MoonbeamIcon } from '@images/moonbeam.svg'
|
import { ReactComponent as MoonbeamIcon } from '@images/moonbeam.svg'
|
||||||
import { ReactComponent as BscIcon } from '@images/bsc.svg'
|
import { ReactComponent as BscIcon } from '@images/bsc.svg'
|
||||||
import { ReactComponent as EnergywebIcon } from '@images/energyweb.svg'
|
import { ReactComponent as EnergywebIcon } from '@images/energyweb.svg'
|
||||||
import { getNetworkDataById, getNetworkDisplayName } from '@utils/web3'
|
import styles from './index.module.css'
|
||||||
import styles from './NetworkName.module.css'
|
|
||||||
import useNetworkMetadata from '@hooks/useNetworkMetadata'
|
|
||||||
|
|
||||||
export function NetworkIcon({ name }: { name: string }): ReactElement {
|
export function NetworkIcon({ name }: { name: string }): ReactElement {
|
||||||
const IconMapped = name.includes('ETH')
|
const IconMapped = name.includes('ETH')
|
||||||
@ -23,29 +21,3 @@ export function NetworkIcon({ name }: { name: string }): ReactElement {
|
|||||||
|
|
||||||
return IconMapped ? <IconMapped className={styles.icon} /> : null
|
return IconMapped ? <IconMapped className={styles.icon} /> : 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 (
|
|
||||||
<span
|
|
||||||
className={`${styles.network} ${minimal ? styles.minimal : null} ${
|
|
||||||
className || ''
|
|
||||||
}`}
|
|
||||||
title={networkName}
|
|
||||||
>
|
|
||||||
<NetworkIcon name={networkName} />{' '}
|
|
||||||
<span className={styles.name}>{networkName}</span>
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
}
|
|
31
src/components/@shared/NetworkName/index.tsx
Normal file
@ -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 (
|
||||||
|
<span
|
||||||
|
className={`${styles.network} ${minimal ? styles.minimal : null} ${
|
||||||
|
className || ''
|
||||||
|
}`}
|
||||||
|
title={networkName}
|
||||||
|
>
|
||||||
|
<NetworkIcon name={networkName} />{' '}
|
||||||
|
<span className={styles.name}>{networkName}</span>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
7
src/components/@shared/Pagination/_types.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface PaginationProps {
|
||||||
|
totalPages?: number
|
||||||
|
currentPage?: number
|
||||||
|
onChangePage?(selected: number): void
|
||||||
|
rowsPerPage?: number
|
||||||
|
rowCount?: number
|
||||||
|
}
|
@ -1,16 +1,9 @@
|
|||||||
import React, { useState, useEffect, ReactElement } from 'react'
|
import React, { useState, useEffect, ReactElement } from 'react'
|
||||||
import ReactPaginate from 'react-paginate'
|
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 { MAXIMUM_NUMBER_OF_PAGES_WITH_RESULTS } from '@utils/aquarius'
|
||||||
import { ReactComponent as Arrow } from '@images/arrow.svg'
|
import { ReactComponent as Arrow } from '@images/arrow.svg'
|
||||||
|
import { PaginationProps } from './_types'
|
||||||
interface PaginationProps {
|
|
||||||
totalPages?: number
|
|
||||||
currentPage?: number
|
|
||||||
onChangePage?(selected: number): void
|
|
||||||
rowsPerPage?: number
|
|
||||||
rowCount?: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Pagination({
|
export default function Pagination({
|
||||||
totalPages,
|
totalPages,
|
@ -1,8 +1,8 @@
|
|||||||
import React, { useState, useEffect, ReactElement } from 'react'
|
import React, { useState, useEffect, ReactElement } from 'react'
|
||||||
import { PoolTransaction } from '.'
|
import { PoolTransaction } from '.'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
import ExplorerLink from '@shared/atoms/ExplorerLink'
|
import ExplorerLink from '@shared/ExplorerLink'
|
||||||
import { formatPrice } from '@shared/atoms/Price/PriceUnit'
|
import { formatPrice } from '@shared/Price/PriceUnit'
|
||||||
import styles from './Title.module.css'
|
import styles from './Title.module.css'
|
||||||
|
|
||||||
async function getTitle(row: PoolTransaction, locale: string) {
|
async function getTitle(row: PoolTransaction, locale: string) {
|
||||||
|
@ -8,13 +8,13 @@ import { TransactionHistory_poolTransactions as TransactionHistoryPoolTransactio
|
|||||||
import web3 from 'web3'
|
import web3 from 'web3'
|
||||||
import { fetchDataForMultipleChains } from '@utils/subgraph'
|
import { fetchDataForMultipleChains } from '@utils/subgraph'
|
||||||
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
import { useSiteMetadata } from '@hooks/useSiteMetadata'
|
||||||
import NetworkName from '@shared/atoms/NetworkName'
|
import NetworkName from '@shared/NetworkName'
|
||||||
import { retrieveDDOListByDIDs } from '@utils/aquarius'
|
import { retrieveDDOListByDIDs } from '@utils/aquarius'
|
||||||
import { CancelToken } from 'axios'
|
import { CancelToken } from 'axios'
|
||||||
import Title from './Title'
|
import Title from './Title'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import { DDO, Logger } from '@oceanprotocol/lib'
|
import { DDO, Logger } from '@oceanprotocol/lib'
|
||||||
import { useCancelToken } from '../../../hooks/useCancelToken'
|
import { useCancelToken } from '@hooks/useCancelToken'
|
||||||
|
|
||||||
const REFETCH_INTERVAL = 20000
|
const REFETCH_INTERVAL = 20000
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import classNames from 'classnames/bind'
|
|||||||
import Conversion from './Conversion'
|
import Conversion from './Conversion'
|
||||||
import styles from './PriceUnit.module.css'
|
import styles from './PriceUnit.module.css'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
import Badge from '../Badge'
|
import Badge from '@shared/atoms/Badge'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|