mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
changes reverted for token and asset list components
This commit is contained in:
parent
8f2b5839de
commit
37d1c0cf82
@ -5,7 +5,6 @@ import PriceUnit from '@shared/Price/PriceUnit'
|
||||
import Loader from '@shared/atoms/Loader'
|
||||
import styles from './index.module.css'
|
||||
import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
||||
import { Prices } from '@context/Prices'
|
||||
|
||||
function Empty() {
|
||||
return <div className={styles.empty}>No assets found.</div>
|
||||
@ -13,9 +12,6 @@ function Empty() {
|
||||
|
||||
export interface AssetComputeListProps {
|
||||
assets: AssetSelectionAsset[]
|
||||
locale: string
|
||||
currency: string
|
||||
prices: Prices
|
||||
}
|
||||
|
||||
export default function AssetComputeSelection({
|
||||
|
@ -32,9 +32,6 @@ export interface AssetListProps {
|
||||
noPublisher?: boolean
|
||||
chainIds: number[]
|
||||
accountId: string
|
||||
locale: string
|
||||
currency: string
|
||||
prices: Prices
|
||||
}
|
||||
|
||||
export default function AssetList({
|
||||
@ -47,10 +44,7 @@ export default function AssetList({
|
||||
className,
|
||||
noPublisher,
|
||||
chainIds,
|
||||
accountId,
|
||||
locale,
|
||||
currency,
|
||||
prices
|
||||
accountId
|
||||
}: AssetListProps): ReactElement {
|
||||
const [assetsWithPrices, setAssetsWithPrices] = useState<AssetExtended[]>()
|
||||
const [loading, setLoading] = useState<boolean>(isLoading)
|
||||
@ -94,9 +88,6 @@ export default function AssetList({
|
||||
asset={assetWithPrice}
|
||||
key={`${assetWithPrice.id}_${i}`}
|
||||
noPublisher={noPublisher}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
|
@ -9,22 +9,15 @@ import NetworkName from '@shared/NetworkName'
|
||||
import styles from './index.module.css'
|
||||
import { getServiceByName } from '@utils/ddo'
|
||||
import { AssetExtended } from 'src/@types/AssetExtended'
|
||||
import { Prices } from '@context/Prices'
|
||||
|
||||
export interface AssetTeaserProps {
|
||||
asset: AssetExtended
|
||||
noPublisher?: boolean
|
||||
locale: string
|
||||
prices: Prices
|
||||
currency: string
|
||||
}
|
||||
|
||||
export default function AssetTeaser({
|
||||
asset,
|
||||
noPublisher,
|
||||
locale,
|
||||
prices,
|
||||
currency
|
||||
noPublisher
|
||||
}: AssetTeaserProps): ReactElement {
|
||||
const { name, type, description } = asset.metadata
|
||||
const { datatokens } = asset
|
||||
|
@ -6,8 +6,6 @@ import AssetComputeList from '@shared/AssetList/AssetComputeList'
|
||||
import { useCancelToken } from '@hooks/useCancelToken'
|
||||
import { getServiceByName } from '@utils/ddo'
|
||||
import { AssetExtended } from 'src/@types/AssetExtended'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function AlgorithmDatasetsListForCompute({
|
||||
asset,
|
||||
@ -19,8 +17,6 @@ export default function AlgorithmDatasetsListForCompute({
|
||||
const [datasetsForCompute, setDatasetsForCompute] =
|
||||
useState<AssetSelectionAsset[]>()
|
||||
const newCancelToken = useCancelToken()
|
||||
const { locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
|
||||
useEffect(() => {
|
||||
if (!asset) return
|
||||
@ -45,12 +41,7 @@ export default function AlgorithmDatasetsListForCompute({
|
||||
return (
|
||||
<div className={styles.datasetsContainer}>
|
||||
<h3 className={styles.text}>Datasets algorithm is allowed to run on</h3>
|
||||
<AssetComputeList
|
||||
assets={datasetsForCompute}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
<AssetComputeList assets={datasetsForCompute} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -33,9 +33,6 @@ import { SortTermOptions } from '../../../../@types/aquarius/SearchQuery'
|
||||
import { getAccessDetails } from '@utils/accessDetailsAndPricing'
|
||||
import { AccessDetails } from 'src/@types/Price'
|
||||
import { transformAssetToAssetSelection } from '@utils/assetConvertor'
|
||||
import { useMarketMetadata } from '@context/MarketMetadata'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function Compute({
|
||||
ddo,
|
||||
|
@ -19,8 +19,6 @@ import { toast } from 'react-toastify'
|
||||
import { useIsMounted } from '@hooks/useIsMounted'
|
||||
import { usePool } from '@context/Pool'
|
||||
import { useMarketMetadata } from '@context/MarketMetadata'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function Download({
|
||||
asset,
|
||||
@ -38,8 +36,6 @@ export default function Download({
|
||||
consumableFeedback?: string
|
||||
}): ReactElement {
|
||||
const { accountId, web3 } = useWeb3()
|
||||
const { locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const { getOpcFeeForToken } = useMarketMetadata()
|
||||
const { isInPurgatory, isAssetNetwork } = useAsset()
|
||||
const { poolData } = usePool()
|
||||
|
@ -4,8 +4,6 @@ import Token from '../../../../@shared/Token'
|
||||
import styles from './Output.module.css'
|
||||
import content from '../../../../../../content/price.json'
|
||||
import { usePool } from '@context/Pool'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function Output({
|
||||
newPoolTokens,
|
||||
@ -16,8 +14,6 @@ export default function Output({
|
||||
}): ReactElement {
|
||||
const { help, titleIn } = content.pool.add.output
|
||||
const { poolInfo } = usePool()
|
||||
const { locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -26,22 +22,8 @@ export default function Output({
|
||||
</FormHelp>
|
||||
<div className={styles.output}>
|
||||
<p>{titleIn}</p>
|
||||
<Token
|
||||
symbol="pool shares"
|
||||
balance={newPoolTokens}
|
||||
noIcon
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
<Token
|
||||
symbol="% of pool"
|
||||
balance={newPoolShare}
|
||||
noIcon
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
<Token symbol="pool shares" balance={newPoolTokens} noIcon />
|
||||
<Token symbol="% of pool" balance={newPoolShare} noIcon />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
@ -22,8 +22,6 @@ import { useAsset } from '@context/Asset'
|
||||
import content from '../../../../../../content/price.json'
|
||||
import { usePool } from '@context/Pool'
|
||||
import { getMax } from './_utils'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
const slippagePresets = ['5', '10', '15', '25', '50']
|
||||
|
||||
@ -34,8 +32,6 @@ export default function Remove({
|
||||
}): ReactElement {
|
||||
const { accountId, web3 } = useWeb3()
|
||||
const { isAssetNetwork } = useAsset()
|
||||
const { locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const { poolData, poolInfo, poolInfoUser, fetchAllData } = usePool()
|
||||
|
||||
const [amountPercent, setAmountPercent] = useState('0')
|
||||
@ -197,20 +193,11 @@ export default function Remove({
|
||||
symbol={poolInfo?.baseTokenSymbol}
|
||||
balance={amountOcean}
|
||||
noIcon
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>{content.pool.remove.output.titleOutMinimum}</p>
|
||||
<Token
|
||||
symbol={poolInfo?.baseTokenSymbol}
|
||||
balance={minOceanAmount}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
<Token symbol={poolInfo?.baseTokenSymbol} balance={minOceanAmount} />
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.slippage}>
|
||||
|
@ -10,20 +10,14 @@ import Token from '../../../../@shared/Token'
|
||||
import content from '../../../../../../content/price.json'
|
||||
import styles from './index.module.css'
|
||||
import Update from './Update'
|
||||
import { useMarketMetadata } from '@context/MarketMetadata'
|
||||
import { OpcFeesQuery_opc as OpcFeesData } from '../../../../../@types/subgraph/OpcFeesQuery'
|
||||
import { getOpcFees } from '@utils/subgraph'
|
||||
import { useWeb3 } from '@context/Web3'
|
||||
import Decimal from 'decimal.js'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function PoolSections() {
|
||||
const { asset } = useAsset()
|
||||
const { locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const { poolData, poolInfo, poolInfoUser, poolInfoOwner } = usePool()
|
||||
const { getOpcFeeForToken } = useMarketMetadata()
|
||||
const { chainId } = useWeb3()
|
||||
const [oceanCommunitySwapFee, setOceanCommunitySwapFee] = useState<string>('')
|
||||
useEffect(() => {
|
||||
|
@ -7,8 +7,6 @@ import styles from './Output.module.css'
|
||||
import Decimal from 'decimal.js'
|
||||
import { FormTradeData } from './_types'
|
||||
import { usePool } from '@context/Pool'
|
||||
import { useUserPreferences } from '@context/UserPreferences'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
Decimal.set({ toExpNeg: -18, precision: 18, rounding: 1 })
|
||||
|
||||
@ -21,8 +19,6 @@ export default function Output({
|
||||
}): ReactElement {
|
||||
const { isAssetNetwork } = useAsset()
|
||||
const { poolInfo } = usePool()
|
||||
const { locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const [outputWithSlippage, setOutputWithSlippage] = useState<string>('0')
|
||||
// Connect with form
|
||||
const { values }: FormikContextType<FormTradeData> = useFormikContext()
|
||||
@ -77,9 +73,6 @@ export default function Output({
|
||||
: poolInfo.datatokenSymbol
|
||||
}
|
||||
balance={outputWithSlippage}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@ -95,9 +88,6 @@ export default function Output({
|
||||
: ''
|
||||
}`}
|
||||
balance={lpSwapFee}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -15,7 +15,6 @@ import { useIsMounted } from '@hooks/useIsMounted'
|
||||
import { useCancelToken } from '@hooks/useCancelToken'
|
||||
import { SortTermOptions } from '../../@types/aquarius/SearchQuery'
|
||||
import { useWeb3 } from '@context/Web3'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
async function getQueryHighest(
|
||||
chainIds: number[]
|
||||
@ -53,8 +52,7 @@ function SectionQueryResult({
|
||||
action?: ReactElement
|
||||
queryData?: string[]
|
||||
}) {
|
||||
const { chainIds, locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const { chainIds } = useUserPreferences()
|
||||
const { accountId } = useWeb3()
|
||||
const [result, setResult] = useState<PagedAssets>()
|
||||
const [loading, setLoading] = useState<boolean>()
|
||||
@ -105,9 +103,6 @@ function SectionQueryResult({
|
||||
isLoading={loading || !query}
|
||||
chainIds={chainIds}
|
||||
accountId={accountId}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
|
||||
{action && action}
|
||||
|
@ -8,7 +8,6 @@ import { useCancelToken } from '@hooks/useCancelToken'
|
||||
import Filters from '../../Search/Filters'
|
||||
import { useMarketMetadata } from '@context/MarketMetadata'
|
||||
import { CancelToken } from 'axios'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function PublishedList({
|
||||
accountId
|
||||
@ -16,8 +15,7 @@ export default function PublishedList({
|
||||
accountId: string
|
||||
}): ReactElement {
|
||||
const { appConfig } = useMarketMetadata()
|
||||
const { chainIds, locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const { chainIds } = useUserPreferences()
|
||||
|
||||
const [queryResult, setQueryResult] = useState<PagedAssets>()
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
@ -98,9 +96,6 @@ export default function PublishedList({
|
||||
noPublisher
|
||||
chainIds={chainIds}
|
||||
accountId={accountId}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
|
@ -9,7 +9,6 @@ import { useCancelToken } from '@hooks/useCancelToken'
|
||||
import styles from './index.module.css'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useWeb3 } from '@context/Web3'
|
||||
import { usePrices } from '@context/Prices'
|
||||
|
||||
export default function SearchPage({
|
||||
setTotalResults,
|
||||
@ -20,8 +19,7 @@ export default function SearchPage({
|
||||
}): ReactElement {
|
||||
const router = useRouter()
|
||||
const [parsed, setParsed] = useState<queryString.ParsedQuery<string>>()
|
||||
const { chainIds, locale, currency } = useUserPreferences()
|
||||
const { prices } = usePrices()
|
||||
const { chainIds } = useUserPreferences()
|
||||
const { accountId } = useWeb3()
|
||||
const [queryResult, setQueryResult] = useState<PagedAssets>()
|
||||
const [loading, setLoading] = useState<boolean>()
|
||||
@ -112,9 +110,6 @@ export default function SearchPage({
|
||||
onPageChange={updatePage}
|
||||
chainIds={chainIds}
|
||||
accountId={accountId}
|
||||
locale={locale}
|
||||
currency={currency}
|
||||
prices={prices}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user