mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
revert prices, locale and currency changes for price components
This commit is contained in:
parent
5231f43648
commit
87c7d239ad
@ -19,10 +19,7 @@ export interface AssetComputeListProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function AssetComputeSelection({
|
export default function AssetComputeSelection({
|
||||||
assets,
|
assets
|
||||||
locale,
|
|
||||||
currency,
|
|
||||||
prices
|
|
||||||
}: AssetComputeListProps): JSX.Element {
|
}: AssetComputeListProps): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div className={styles.display}>
|
<div className={styles.display}>
|
||||||
@ -49,9 +46,6 @@ export default function AssetComputeSelection({
|
|||||||
price={asset.price}
|
price={asset.price}
|
||||||
size="small"
|
size="small"
|
||||||
className={styles.price}
|
className={styles.price}
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -26,7 +26,6 @@ export const Default: Props = Template.bind({})
|
|||||||
Default.args = {
|
Default.args = {
|
||||||
assets: assetSelectionAsset,
|
assets: assetSelectionAsset,
|
||||||
currency: 'OCEAN',
|
currency: 'OCEAN',
|
||||||
locale,
|
|
||||||
prices
|
prices
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +34,6 @@ Multiple.args = {
|
|||||||
assets: assetSelectionAsset,
|
assets: assetSelectionAsset,
|
||||||
multiple: true,
|
multiple: true,
|
||||||
currency: 'OCEAN',
|
currency: 'OCEAN',
|
||||||
locale,
|
|
||||||
prices
|
prices
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +42,5 @@ Disabled.args = {
|
|||||||
assets: assetSelectionAsset,
|
assets: assetSelectionAsset,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
currency: 'OCEAN',
|
currency: 'OCEAN',
|
||||||
locale,
|
|
||||||
prices
|
prices
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ export interface AssetSelectionAsset {
|
|||||||
export interface AssetSelectionProps {
|
export interface AssetSelectionProps {
|
||||||
assets: AssetSelectionAsset[]
|
assets: AssetSelectionAsset[]
|
||||||
currency: string
|
currency: string
|
||||||
locale: string
|
|
||||||
prices: Prices
|
prices: Prices
|
||||||
multiple?: boolean
|
multiple?: boolean
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
@ -36,13 +35,9 @@ export default function AssetSelection({
|
|||||||
assets,
|
assets,
|
||||||
multiple,
|
multiple,
|
||||||
disabled,
|
disabled,
|
||||||
currency,
|
|
||||||
locale,
|
|
||||||
prices,
|
|
||||||
...props
|
...props
|
||||||
}: AssetSelectionProps): JSX.Element {
|
}: AssetSelectionProps): JSX.Element {
|
||||||
const [searchValue, setSearchValue] = useState('')
|
const [searchValue, setSearchValue] = useState('')
|
||||||
// const { locale } = useUserPreferences()
|
|
||||||
|
|
||||||
const styleClassesInput = cx({
|
const styleClassesInput = cx({
|
||||||
input: true,
|
input: true,
|
||||||
@ -122,9 +117,6 @@ export default function AssetSelection({
|
|||||||
type={asset.price === '0' ? 'free' : undefined}
|
type={asset.price === '0' ? 'free' : undefined}
|
||||||
size="small"
|
size="small"
|
||||||
className={styles.price}
|
className={styles.price}
|
||||||
locale={locale}
|
|
||||||
prices={prices}
|
|
||||||
currency={currency}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
@ -2,7 +2,8 @@ import React, { useEffect, useState, ReactElement } from 'react'
|
|||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import { formatCurrency, isCrypto } from '@coingecko/cryptoformat'
|
import { formatCurrency, isCrypto } from '@coingecko/cryptoformat'
|
||||||
import { Prices } from '@context/Prices'
|
import { usePrices } from '@context/Prices'
|
||||||
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
@ -10,19 +11,15 @@ export interface ConversionProps {
|
|||||||
price: string // expects price in OCEAN, not wei
|
price: string // expects price in OCEAN, not wei
|
||||||
className?: string
|
className?: string
|
||||||
hideApproximateSymbol?: boolean
|
hideApproximateSymbol?: boolean
|
||||||
locale: string
|
|
||||||
prices: Prices
|
|
||||||
currency: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Conversion({
|
export default function Conversion({
|
||||||
price,
|
price,
|
||||||
className,
|
className,
|
||||||
hideApproximateSymbol,
|
hideApproximateSymbol
|
||||||
locale,
|
|
||||||
prices,
|
|
||||||
currency
|
|
||||||
}: ConversionProps): ReactElement {
|
}: ConversionProps): ReactElement {
|
||||||
|
const { prices } = usePrices()
|
||||||
|
const { currency, locale } = useUserPreferences()
|
||||||
const [priceConverted, setPriceConverted] = useState('0.00')
|
const [priceConverted, setPriceConverted] = useState('0.00')
|
||||||
// detect fiat, only have those kick in full @coingecko/cryptoformat formatting
|
// detect fiat, only have those kick in full @coingecko/cryptoformat formatting
|
||||||
const isFiat = !isCrypto(currency)
|
const isFiat = !isCrypto(currency)
|
||||||
|
@ -3,7 +3,7 @@ import { formatCurrency } from '@coingecko/cryptoformat'
|
|||||||
import Conversion from '../Conversion'
|
import Conversion from '../Conversion'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import Badge from '@shared/atoms/Badge'
|
import Badge from '@shared/atoms/Badge'
|
||||||
import { Prices } from '@context/Prices'
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
|
|
||||||
export function formatPrice(price: string, locale: string): string {
|
export function formatPrice(price: string, locale: string): string {
|
||||||
return formatCurrency(Number(price), '', locale, false, {
|
return formatCurrency(Number(price), '', locale, false, {
|
||||||
@ -21,9 +21,6 @@ export interface PriceUnitProps {
|
|||||||
size?: 'small' | 'mini' | 'large'
|
size?: 'small' | 'mini' | 'large'
|
||||||
conversion?: boolean
|
conversion?: boolean
|
||||||
symbol?: string
|
symbol?: string
|
||||||
locale: string
|
|
||||||
prices: Prices
|
|
||||||
currency: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PriceUnit({
|
export default function PriceUnit({
|
||||||
@ -32,11 +29,10 @@ export default function PriceUnit({
|
|||||||
size = 'small',
|
size = 'small',
|
||||||
conversion,
|
conversion,
|
||||||
symbol,
|
symbol,
|
||||||
type,
|
type
|
||||||
locale,
|
|
||||||
prices,
|
|
||||||
currency
|
|
||||||
}: PriceUnitProps): ReactElement {
|
}: PriceUnitProps): ReactElement {
|
||||||
|
const { locale } = useUserPreferences()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${styles.price} ${styles[size]} ${className}`}>
|
<div className={`${styles.price} ${styles[size]} ${className}`}>
|
||||||
{type && type === 'free' ? (
|
{type && type === 'free' ? (
|
||||||
@ -50,14 +46,7 @@ export default function PriceUnit({
|
|||||||
<Badge label="pool" className={styles.badge} />
|
<Badge label="pool" className={styles.badge} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{conversion && (
|
{conversion && <Conversion price={price} />}
|
||||||
<Conversion
|
|
||||||
price={price}
|
|
||||||
locale={locale}
|
|
||||||
prices={prices}
|
|
||||||
currency={currency}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,6 @@ import Loader from '../atoms/Loader'
|
|||||||
import Tooltip from '../atoms/Tooltip'
|
import Tooltip from '../atoms/Tooltip'
|
||||||
import PriceUnit from './PriceUnit'
|
import PriceUnit from './PriceUnit'
|
||||||
import { AccessDetails, OrderPriceAndFees } from 'src/@types/Price'
|
import { AccessDetails, OrderPriceAndFees } from 'src/@types/Price'
|
||||||
import { Prices } from '@context/Prices'
|
|
||||||
|
|
||||||
export interface PriceProps {
|
export interface PriceProps {
|
||||||
accessDetails: AccessDetails
|
accessDetails: AccessDetails
|
||||||
@ -12,9 +11,6 @@ export interface PriceProps {
|
|||||||
className?: string
|
className?: string
|
||||||
conversion?: boolean
|
conversion?: boolean
|
||||||
size?: 'small' | 'mini' | 'large'
|
size?: 'small' | 'mini' | 'large'
|
||||||
locale: string
|
|
||||||
currency: string
|
|
||||||
prices: Prices
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Price({
|
export default function Price({
|
||||||
@ -22,10 +18,7 @@ export default function Price({
|
|||||||
orderPriceAndFees,
|
orderPriceAndFees,
|
||||||
className,
|
className,
|
||||||
size,
|
size,
|
||||||
conversion,
|
conversion
|
||||||
locale,
|
|
||||||
currency,
|
|
||||||
prices
|
|
||||||
}: PriceProps): ReactElement {
|
}: PriceProps): ReactElement {
|
||||||
return accessDetails?.price || accessDetails?.type === 'free' ? (
|
return accessDetails?.price || accessDetails?.type === 'free' ? (
|
||||||
<PriceUnit
|
<PriceUnit
|
||||||
@ -35,9 +28,6 @@ export default function Price({
|
|||||||
size={size}
|
size={size}
|
||||||
conversion={conversion}
|
conversion={conversion}
|
||||||
type={accessDetails.type}
|
type={accessDetails.type}
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
) : !accessDetails || accessDetails?.type === '' ? (
|
) : !accessDetails || accessDetails?.type === '' ? (
|
||||||
<div className={styles.empty}>
|
<div className={styles.empty}>
|
||||||
|
@ -21,10 +21,7 @@ export default function Token({
|
|||||||
balance,
|
balance,
|
||||||
conversion,
|
conversion,
|
||||||
noIcon,
|
noIcon,
|
||||||
size,
|
size
|
||||||
locale,
|
|
||||||
currency,
|
|
||||||
prices
|
|
||||||
}: TokenProps): ReactElement {
|
}: TokenProps): ReactElement {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -34,23 +31,10 @@ export default function Token({
|
|||||||
>
|
>
|
||||||
<Logo noWordmark />
|
<Logo noWordmark />
|
||||||
</figure>
|
</figure>
|
||||||
<PriceUnit
|
<PriceUnit price={balance} symbol={symbol} size={size} />
|
||||||
price={balance}
|
|
||||||
symbol={symbol}
|
|
||||||
size={size}
|
|
||||||
locale={locale}
|
|
||||||
prices={prices}
|
|
||||||
currency={currency}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{conversion && (
|
{conversion && (
|
||||||
<Conversion
|
<Conversion price={balance} className={`${styles.conversion}`} />
|
||||||
price={balance}
|
|
||||||
className={`${styles.conversion}`}
|
|
||||||
locale={locale}
|
|
||||||
prices={prices}
|
|
||||||
currency={currency}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
@ -4,8 +4,7 @@ import PriceUnit from '@shared/Price/PriceUnit'
|
|||||||
import Tooltip from '@shared/atoms/Tooltip'
|
import Tooltip from '@shared/atoms/Tooltip'
|
||||||
import styles from './PriceOutput.module.css'
|
import styles from './PriceOutput.module.css'
|
||||||
import { AccessDetails } from 'src/@types/Price'
|
import { AccessDetails } from 'src/@types/Price'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
|
||||||
import { usePrices } from '@context/Prices'
|
|
||||||
interface PriceOutputProps {
|
interface PriceOutputProps {
|
||||||
totalPrice: number
|
totalPrice: number
|
||||||
hasPreviousOrder: boolean
|
hasPreviousOrder: boolean
|
||||||
@ -33,8 +32,6 @@ function Row({
|
|||||||
timeout?: string
|
timeout?: string
|
||||||
sign?: string
|
sign?: string
|
||||||
}) {
|
}) {
|
||||||
const { locale, currency } = useUserPreferences()
|
|
||||||
const { prices } = usePrices()
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.priceRow}>
|
<div className={styles.priceRow}>
|
||||||
<div className={styles.sign}>{sign}</div>
|
<div className={styles.sign}>{sign}</div>
|
||||||
@ -44,9 +41,6 @@ function Row({
|
|||||||
symbol={symbol}
|
symbol={symbol}
|
||||||
size="small"
|
size="small"
|
||||||
className={styles.price}
|
className={styles.price}
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
<span className={styles.timeout}>
|
<span className={styles.timeout}>
|
||||||
{timeout &&
|
{timeout &&
|
||||||
@ -71,19 +65,11 @@ export default function PriceOutput({
|
|||||||
selectedComputeAssetTimeout
|
selectedComputeAssetTimeout
|
||||||
}: PriceOutputProps): ReactElement {
|
}: PriceOutputProps): ReactElement {
|
||||||
const { asset } = useAsset()
|
const { asset } = useAsset()
|
||||||
const { locale, currency } = useUserPreferences()
|
|
||||||
const { prices } = usePrices()
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.priceComponent}>
|
<div className={styles.priceComponent}>
|
||||||
You will pay{' '}
|
You will pay{' '}
|
||||||
<PriceUnit
|
<PriceUnit price={`${totalPrice}`} symbol={symbol} size="small" />
|
||||||
price={`${totalPrice}`}
|
|
||||||
symbol={symbol}
|
|
||||||
size="small"
|
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={
|
content={
|
||||||
<div className={styles.calculation}>
|
<div className={styles.calculation}>
|
||||||
|
@ -39,22 +39,12 @@ export default function PoolSections() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PoolSection className={styles.dataToken}>
|
<PoolSection className={styles.dataToken}>
|
||||||
<PriceUnit
|
<PriceUnit price="1" symbol={poolInfo?.datatokenSymbol} size="large" />{' '}
|
||||||
price="1"
|
|
||||||
symbol={poolInfo?.datatokenSymbol}
|
|
||||||
size="large"
|
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>{' '}
|
|
||||||
={' '}
|
={' '}
|
||||||
<PriceUnit
|
<PriceUnit
|
||||||
price={`${poolData?.spotPrice}`}
|
price={`${poolData?.spotPrice}`}
|
||||||
symbol={poolInfo?.baseTokenSymbol}
|
symbol={poolInfo?.baseTokenSymbol}
|
||||||
size="large"
|
size="large"
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
<Tooltip content={content.pool.tooltips.price} />
|
<Tooltip content={content.pool.tooltips.price} />
|
||||||
<div className={styles.dataTokenLinks}>
|
<div className={styles.dataTokenLinks}>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import PriceUnit from '@shared/Price/PriceUnit'
|
import PriceUnit from '@shared/Price/PriceUnit'
|
||||||
import styles from './UserLiquidity.module.css'
|
import styles from './UserLiquidity.module.css'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
|
||||||
import { usePrices } from '@context/Prices'
|
|
||||||
|
|
||||||
function UserLiquidityLine({
|
function UserLiquidityLine({
|
||||||
title,
|
title,
|
||||||
@ -13,20 +11,10 @@ function UserLiquidityLine({
|
|||||||
amount: string
|
amount: string
|
||||||
symbol: string
|
symbol: string
|
||||||
}) {
|
}) {
|
||||||
const { locale, currency } = useUserPreferences()
|
|
||||||
const { prices } = usePrices()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<span>{title}</span>
|
<span>{title}</span>
|
||||||
<PriceUnit
|
<PriceUnit price={amount} symbol={symbol} size="small" />
|
||||||
price={amount}
|
|
||||||
symbol={symbol}
|
|
||||||
size="small"
|
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import PriceUnit from '@shared/Price/PriceUnit'
|
|||||||
import NetworkName from '@shared/NetworkName'
|
import NetworkName from '@shared/NetworkName'
|
||||||
import styles from './Tooltip.module.css'
|
import styles from './Tooltip.module.css'
|
||||||
import { StatsValue } from './_types'
|
import { StatsValue } from './_types'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
|
||||||
import { usePrices } from '@context/Prices'
|
|
||||||
import content from '../../../../content/footer.json'
|
import content from '../../../../content/footer.json'
|
||||||
import Markdown from '@shared/Markdown'
|
import Markdown from '@shared/Markdown'
|
||||||
|
|
||||||
@ -20,8 +18,6 @@ export default function MarketStatsTooltip({
|
|||||||
totalOceanLiquidity: StatsValue
|
totalOceanLiquidity: StatsValue
|
||||||
mainChainIds: number[]
|
mainChainIds: number[]
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { locale, currency } = useUserPreferences()
|
|
||||||
const { prices } = usePrices()
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ul className={styles.statsList}>
|
<ul className={styles.statsList}>
|
||||||
@ -32,9 +28,6 @@ export default function MarketStatsTooltip({
|
|||||||
<Conversion
|
<Conversion
|
||||||
price={totalValueLockedInOcean?.[chainId] || '0'}
|
price={totalValueLockedInOcean?.[chainId] || '0'}
|
||||||
hideApproximateSymbol
|
hideApproximateSymbol
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>{' '}
|
/>{' '}
|
||||||
<abbr title="Total Value Locked">TVL</abbr>
|
<abbr title="Total Value Locked">TVL</abbr>
|
||||||
{' | '}
|
{' | '}
|
||||||
@ -44,9 +37,6 @@ export default function MarketStatsTooltip({
|
|||||||
price={totalOceanLiquidity?.[chainId] || '0'}
|
price={totalOceanLiquidity?.[chainId] || '0'}
|
||||||
symbol="OCEAN"
|
symbol="OCEAN"
|
||||||
size="small"
|
size="small"
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
@ -2,16 +2,12 @@ import React, { ReactElement } from 'react'
|
|||||||
import Conversion from '@shared/Price/Conversion'
|
import Conversion from '@shared/Price/Conversion'
|
||||||
import PriceUnit from '@shared/Price/PriceUnit'
|
import PriceUnit from '@shared/Price/PriceUnit'
|
||||||
import { StatsTotal } from './_types'
|
import { StatsTotal } from './_types'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
|
||||||
import { usePrices } from '@context/Prices'
|
|
||||||
|
|
||||||
export default function MarketStatsTotal({
|
export default function MarketStatsTotal({
|
||||||
total
|
total
|
||||||
}: {
|
}: {
|
||||||
total: StatsTotal
|
total: StatsTotal
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { locale, currency } = useUserPreferences()
|
|
||||||
const { prices } = usePrices()
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p>
|
<p>
|
||||||
@ -22,9 +18,6 @@ export default function MarketStatsTotal({
|
|||||||
<Conversion
|
<Conversion
|
||||||
price={`${total.totalValueLockedInOcean}`}
|
price={`${total.totalValueLockedInOcean}`}
|
||||||
hideApproximateSymbol
|
hideApproximateSymbol
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>{' '}
|
/>{' '}
|
||||||
<abbr title="Total Value Locked">TVL</abbr> across{' '}
|
<abbr title="Total Value Locked">TVL</abbr> across{' '}
|
||||||
<strong>{total.pools}</strong> asset pools that contain{' '}
|
<strong>{total.pools}</strong> asset pools that contain{' '}
|
||||||
@ -32,9 +25,6 @@ export default function MarketStatsTotal({
|
|||||||
price={`${total.totalOceanLiquidity}`}
|
price={`${total.totalOceanLiquidity}`}
|
||||||
symbol="OCEAN"
|
symbol="OCEAN"
|
||||||
size="small"
|
size="small"
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
, plus datatokens for each pool.
|
, plus datatokens for each pool.
|
||||||
</>
|
</>
|
||||||
|
@ -7,8 +7,6 @@ import PriceUnit from '@shared/Price/PriceUnit'
|
|||||||
import styles from './Price.module.css'
|
import styles from './Price.module.css'
|
||||||
import { FormPublishData } from '../_types'
|
import { FormPublishData } from '../_types'
|
||||||
import { getFieldContent } from '../_utils'
|
import { getFieldContent } from '../_utils'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
|
||||||
import { usePrices } from '@context/Prices'
|
|
||||||
|
|
||||||
export default function Price({
|
export default function Price({
|
||||||
firstPrice,
|
firstPrice,
|
||||||
@ -18,8 +16,6 @@ export default function Price({
|
|||||||
content?: any
|
content?: any
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const [field, meta] = useField('pricing.price')
|
const [field, meta] = useField('pricing.price')
|
||||||
const { locale, currency } = useUserPreferences()
|
|
||||||
const { prices } = usePrices()
|
|
||||||
|
|
||||||
const { values } = useFormikContext<FormPublishData>()
|
const { values } = useFormikContext<FormPublishData>()
|
||||||
const { dataTokenOptions } = values.services[0]
|
const { dataTokenOptions } = values.services[0]
|
||||||
@ -50,13 +46,7 @@ export default function Price({
|
|||||||
<div className={styles.datatoken}>
|
<div className={styles.datatoken}>
|
||||||
<h4>
|
<h4>
|
||||||
= <strong>1</strong> {dataTokenOptions.symbol}{' '}
|
= <strong>1</strong> {dataTokenOptions.symbol}{' '}
|
||||||
<Conversion
|
<Conversion price={field.value} className={styles.conversion} />
|
||||||
price={field.value}
|
|
||||||
className={styles.conversion}
|
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -67,9 +57,6 @@ export default function Price({
|
|||||||
price={Number(firstPrice) > 0 ? firstPrice : '-'}
|
price={Number(firstPrice) > 0 ? firstPrice : '-'}
|
||||||
size="small"
|
size="small"
|
||||||
conversion
|
conversion
|
||||||
locale={locale}
|
|
||||||
currency={currency}
|
|
||||||
prices={prices}
|
|
||||||
/>
|
/>
|
||||||
</aside>
|
</aside>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user