From 4123dae431f67548741b7062ab0bae6fb31d5c2c Mon Sep 17 00:00:00 2001 From: Norbi <37236152+KatunaNorbert@users.noreply.github.com> Date: Wed, 1 Sep 2021 17:05:59 +0300 Subject: [PATCH] fix ocean symbol on Polygon (#487) * updated Price component * fixed on Pool Shares * fixed on Pool * fixed on Trade * removed hardcoded data * temp fixes * fixes for subgraph2 * fixed token symbol in price for pools * remove console.log * remove comment default symbol * remove temp values * add tokens to query * add token symbol * remove console.log Co-authored-by: Norbi Co-authored-by: mihaisc --- src/components/atoms/Price/PriceUnit.tsx | 3 ++- src/components/atoms/Price/index.tsx | 3 ++- src/components/molecules/AssetTeaser.tsx | 4 +-- src/components/molecules/Bookmarks.tsx | 2 +- .../Compute/FormComputeDataset.tsx | 3 ++- .../AssetActions/Compute/PriceOutput.tsx | 2 +- .../organisms/AssetActions/Compute/index.tsx | 4 +-- .../organisms/AssetActions/Consume.tsx | 3 ++- .../organisms/AssetActions/Pool/TokenList.tsx | 4 ++- .../organisms/AssetActions/Pool/index.tsx | 20 +++++++++++--- .../AssetActions/Trade/FormTrade.tsx | 3 ++- .../organisms/AssetActions/Trade/Output.tsx | 6 +++-- .../organisms/AssetActions/Trade/Swap.tsx | 10 ++++--- src/components/pages/History/PoolShares.tsx | 26 ++++++++++++------- src/hooks/usePricing.ts | 3 ++- src/models/BestPrice.ts | 12 +++++++++ src/providers/Asset.tsx | 3 ++- src/utils/ocean.ts | 3 +-- src/utils/subgraph.ts | 17 +++++++++--- 19 files changed, 93 insertions(+), 38 deletions(-) create mode 100644 src/models/BestPrice.ts diff --git a/src/components/atoms/Price/PriceUnit.tsx b/src/components/atoms/Price/PriceUnit.tsx index a1f3bf54f..ca6ab0d06 100644 --- a/src/components/atoms/Price/PriceUnit.tsx +++ b/src/components/atoms/Price/PriceUnit.tsx @@ -4,6 +4,7 @@ import classNames from 'classnames/bind' import Conversion from './Conversion' import styles from './PriceUnit.module.css' import { useUserPreferences } from '../../../providers/UserPreferences' +import { useOcean } from '../../../providers/Ocean' import Badge from '../Badge' const cx = classNames.bind(styles) @@ -48,7 +49,7 @@ export default function PriceUnit({ <>
{Number.isNaN(Number(price)) ? '-' : formatPrice(price, locale)}{' '} - {symbol || 'OCEAN'} + {symbol} {type && type === 'pool' && ( )} diff --git a/src/components/atoms/Price/index.tsx b/src/components/atoms/Price/index.tsx index 940aca870..8c31eceba 100644 --- a/src/components/atoms/Price/index.tsx +++ b/src/components/atoms/Price/index.tsx @@ -1,9 +1,9 @@ import React, { ReactElement } from 'react' import styles from './index.module.css' -import { BestPrice } from '@oceanprotocol/lib' import Loader from '../Loader' import Tooltip from '../Tooltip' import PriceUnit from './PriceUnit' +import { BestPrice } from '../../../models/BestPrice' export default function Price({ price, @@ -19,6 +19,7 @@ export default function Price({ return price?.value || price?.type === 'free' ? ( (