From 8f2b5839de22c0145442e0cfb0d954f35abd301a Mon Sep 17 00:00:00 2001 From: ClaudiaHolhos Date: Fri, 17 Jun 2022 13:06:18 +0300 Subject: [PATCH] more changes reverted --- src/components/@shared/AssetTeaser/index.tsx | 8 +------ .../@shared/FormFields/Nft/TxFee.tsx | 9 +------- .../Price/Conversion/index.stories.tsx | 8 +------ .../@shared/Price/index.stories.tsx | 5 +--- src/components/@shared/Token/index.tsx | 4 ---- .../Asset/AssetActions/Compute/index.tsx | 12 +--------- .../Asset/AssetActions/Download.tsx | 3 --- .../AssetActions/Pool/Sections/index.tsx | 18 --------------- src/components/Header/Wallet/Details.tsx | 13 ++--------- src/components/Home/Bookmarks.tsx | 14 +---------- src/components/Profile/Header/Stats.tsx | 23 +++---------------- .../Profile/History/PoolShares/Liquidity.tsx | 10 -------- src/components/Publish/Pricing/Coin.tsx | 9 +------- 13 files changed, 12 insertions(+), 124 deletions(-) diff --git a/src/components/@shared/AssetTeaser/index.tsx b/src/components/@shared/AssetTeaser/index.tsx index a4206f9d8..1c5fb73cd 100644 --- a/src/components/@shared/AssetTeaser/index.tsx +++ b/src/components/@shared/AssetTeaser/index.tsx @@ -58,13 +58,7 @@ export default function AssetTeaser({ diff --git a/src/components/@shared/FormFields/Nft/TxFee.tsx b/src/components/@shared/FormFields/Nft/TxFee.tsx index b1f3e82bb..460d7da22 100644 --- a/src/components/@shared/FormFields/Nft/TxFee.tsx +++ b/src/components/@shared/FormFields/Nft/TxFee.tsx @@ -37,9 +37,7 @@ export default function TxFee({ }): ReactElement { const { accountId } = useWeb3() const { prices } = usePrices() - const { currency } = useUserPreferences() const nftFactory = useNftFactory() - const { locale } = useUserPreferences() const [gasFee, setGasFee] = useState('') @@ -59,12 +57,7 @@ export default function TxFee({ return gasFee ? (

Gas fee estimation for this artwork - +

) : accountId ? (

diff --git a/src/components/@shared/Price/Conversion/index.stories.tsx b/src/components/@shared/Price/Conversion/index.stories.tsx index c6dc8b334..48fc144a7 100644 --- a/src/components/@shared/Price/Conversion/index.stories.tsx +++ b/src/components/@shared/Price/Conversion/index.stories.tsx @@ -22,17 +22,11 @@ interface Props { export const Default: Props = Template.bind({}) Default.args = { - price: '11.12333', - locale, - currency, - prices + price: '11.12333' } export const HideApproximateSymbol: Props = Template.bind({}) HideApproximateSymbol.args = { price: '11.12333', - locale, - currency, - prices, hideApproximateSymbol: true } diff --git a/src/components/@shared/Price/index.stories.tsx b/src/components/@shared/Price/index.stories.tsx index 0a598735f..29f8e9042 100644 --- a/src/components/@shared/Price/index.stories.tsx +++ b/src/components/@shared/Price/index.stories.tsx @@ -40,8 +40,5 @@ const accessDetailsData = { export const Default: Props = Template.bind({}) Default.args = { - accessDetails: accessDetailsData as AccessDetails, - locale, - currency, - prices + accessDetails: accessDetailsData as AccessDetails } diff --git a/src/components/@shared/Token/index.tsx b/src/components/@shared/Token/index.tsx index bdee56068..9ff7743fd 100644 --- a/src/components/@shared/Token/index.tsx +++ b/src/components/@shared/Token/index.tsx @@ -3,7 +3,6 @@ import styles from './index.module.css' import PriceUnit from '@shared/Price/PriceUnit' import Logo from '@shared/atoms/Logo' import Conversion from '@shared/Price/Conversion' -import { Prices } from '@context/Prices' export interface TokenProps { symbol: string @@ -11,9 +10,6 @@ export interface TokenProps { conversion?: boolean noIcon?: boolean size?: 'small' | 'mini' - locale: string - currency: string - prices: Prices } export default function Token({ diff --git a/src/components/Asset/AssetActions/Compute/index.tsx b/src/components/Asset/AssetActions/Compute/index.tsx index 44291beaf..aa76608b7 100644 --- a/src/components/Asset/AssetActions/Compute/index.tsx +++ b/src/components/Asset/AssetActions/Compute/index.tsx @@ -54,9 +54,6 @@ export default function Compute({ isConsumable?: boolean consumableFeedback?: string }): ReactElement { - const { appConfig } = useMarketMetadata() - const { locale, currency } = useUserPreferences() - const { prices } = usePrices() const { accountId } = useWeb3() const [isJobStarting, setIsJobStarting] = useState(false) const [error, setError] = useState() @@ -392,14 +389,7 @@ export default function Compute({ <>

- +
{ddo.metadata.type === 'algorithm' ? ( diff --git a/src/components/Asset/AssetActions/Download.tsx b/src/components/Asset/AssetActions/Download.tsx index fa86bf37e..e0f4f5185 100644 --- a/src/components/Asset/AssetActions/Download.tsx +++ b/src/components/Asset/AssetActions/Download.tsx @@ -217,9 +217,6 @@ export default function Download({ orderPriceAndFees={orderPriceAndFees} conversion size="large" - locale={locale} - currency={currency} - prices={prices} /> {!isInPurgatory && } diff --git a/src/components/Asset/AssetActions/Pool/Sections/index.tsx b/src/components/Asset/AssetActions/Pool/Sections/index.tsx index 31f9388c9..85fc95467 100644 --- a/src/components/Asset/AssetActions/Pool/Sections/index.tsx +++ b/src/components/Asset/AssetActions/Pool/Sections/index.tsx @@ -83,9 +83,6 @@ export default function PoolSections() { symbol={poolInfo?.baseTokenSymbol} balance={poolInfoUser?.liquidity} conversion - locale={locale} - currency={currency} - prices={prices} /> @@ -97,9 +94,6 @@ export default function PoolSections() { symbol={poolInfo?.baseTokenSymbol} balance={poolInfoOwner?.liquidity} conversion - locale={locale} - currency={currency} - prices={prices} /> @@ -108,9 +102,6 @@ export default function PoolSections() { symbol={poolInfo?.baseTokenSymbol} balance={poolData?.baseTokenLiquidity.toString()} conversion - locale={locale} - currency={currency} - prices={prices} /> @@ -131,27 +122,18 @@ export default function PoolSections() { balance={poolInfo?.liquidityProviderSwapFee} noIcon size="mini" - locale={locale} - currency={currency} - prices={prices} /> diff --git a/src/components/Header/Wallet/Details.tsx b/src/components/Header/Wallet/Details.tsx index 05e1a67d2..031597ec1 100644 --- a/src/components/Header/Wallet/Details.tsx +++ b/src/components/Header/Wallet/Details.tsx @@ -8,7 +8,6 @@ import { useWeb3 } from '@context/Web3' import { getOceanConfig } from '@utils/ocean' import styles from './Details.module.css' import InputElement from '@shared/FormInput/InputElement' -import { usePrices } from '@context/Prices' export default function Details(): ReactElement { const { @@ -21,8 +20,7 @@ export default function Details(): ReactElement { networkId, balance } = useWeb3() - const { locale, currency } = useUserPreferences() - const { prices } = usePrices() + const { locale } = useUserPreferences() const [mainCurrency, setMainCurrency] = useState() const [oceanTokenMetadata, setOceanTokenMetadata] = useState<{ @@ -68,14 +66,7 @@ export default function Details(): ReactElement { {formatCurrency(Number(value), '', locale, false, { significantFigures: 4 })} - {key === 'ocean' && ( - - )} + {key === 'ocean' && } ))} diff --git a/src/components/Home/Bookmarks.tsx b/src/components/Home/Bookmarks.tsx index 6b89bbd72..570a971b9 100644 --- a/src/components/Home/Bookmarks.tsx +++ b/src/components/Home/Bookmarks.tsx @@ -11,21 +11,9 @@ import { AssetExtended } from 'src/@types/AssetExtended' import { getAccessDetailsForAssets } from '@utils/accessDetailsAndPricing' import { useWeb3 } from '@context/Web3' import { useMarketMetadata } from '@context/MarketMetadata' -import { usePrices } from '@context/Prices' export function PriceComponent(row: AssetExtended) { - const { locale, currency } = useUserPreferences() - const { prices } = usePrices() - - return ( - - ) + return } const columns = [ diff --git a/src/components/Profile/Header/Stats.tsx b/src/components/Profile/Header/Stats.tsx index 5560f6617..ab31542b5 100644 --- a/src/components/Profile/Header/Stats.tsx +++ b/src/components/Profile/Header/Stats.tsx @@ -33,9 +33,8 @@ export default function Stats({ }: { accountId: string }): ReactElement { - const { chainIds, locale, currency } = useUserPreferences() + const { chainIds } = useUserPreferences() const { poolShares, assets, assetsTotal, sales } = useProfile() - const { prices } = usePrices() const [publisherTvl, setPublisherTvl] = useState('0') const [totalTvl, setTotalTvl] = useState('0') @@ -92,27 +91,11 @@ export default function Stats({
- } + value={} /> - } + value={} /> diff --git a/src/components/Profile/History/PoolShares/Liquidity.tsx b/src/components/Profile/History/PoolShares/Liquidity.tsx index bbe4b1ae4..718671bdc 100644 --- a/src/components/Profile/History/PoolShares/Liquidity.tsx +++ b/src/components/Profile/History/PoolShares/Liquidity.tsx @@ -5,8 +5,6 @@ import Token from '../../../@shared/Token' import Decimal from 'decimal.js' import { AssetPoolShare } from './index' import { calcSingleOutGivenPoolIn } from '@utils/pool' -import { useUserPreferences } from '@context/UserPreferences' -import { usePrices } from '@context/Prices' export function Liquidity({ row, @@ -16,8 +14,6 @@ export function Liquidity({ type: string }) { const [liquidity, setLiquidity] = useState('0') - const { locale, currency } = useUserPreferences() - const { prices } = usePrices() useEffect(() => { let calculatedLiquidity = '0' @@ -47,17 +43,11 @@ export function Liquidity({ price={liquidity} className={styles.totalLiquidity} hideApproximateSymbol - locale={locale} - currency={currency} - prices={prices} />
) diff --git a/src/components/Publish/Pricing/Coin.tsx b/src/components/Publish/Pricing/Coin.tsx index 3c754aba5..66ca1d3d6 100644 --- a/src/components/Publish/Pricing/Coin.tsx +++ b/src/components/Publish/Pricing/Coin.tsx @@ -20,8 +20,6 @@ export default function Coin({ readOnly?: boolean }): ReactElement { const [field, meta] = useField(`pricing.${name}`) - const { locale, currency } = useUserPreferences() - const { prices } = usePrices() return (
@@ -51,12 +49,7 @@ export default function Coin({ {...field} /> {datatokenOptions?.symbol === 'OCEAN' && ( - + )}