1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

more changes reverted

This commit is contained in:
ClaudiaHolhos 2022-06-17 13:06:18 +03:00
parent 87c7d239ad
commit 8f2b5839de
13 changed files with 12 additions and 124 deletions

View File

@ -58,13 +58,7 @@ export default function AssetTeaser({
</div>
<footer className={styles.foot}>
<Price
accessDetails={asset.accessDetails}
size="small"
locale={locale}
prices={prices}
currency={currency}
/>
<Price accessDetails={asset.accessDetails} size="small" />
<NetworkName networkId={asset.chainId} className={styles.network} />
</footer>
</a>

View File

@ -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 ? (
<p>
Gas fee estimation for this artwork
<Conversion
locale={locale}
price={gasFee}
prices={prices}
currency={currency}
/>
<Conversion price={gasFee} />
</p>
) : accountId ? (
<p>

View File

@ -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
}

View File

@ -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
}

View File

@ -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({

View File

@ -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<string>()
@ -392,14 +389,7 @@ export default function Compute({
<>
<div className={styles.info}>
<FileIcon file={file} isLoading={fileIsLoading} small />
<Price
accessDetails={accessDetails}
conversion
size="large"
locale={locale}
currency={currency}
prices={prices}
/>
<Price accessDetails={accessDetails} conversion size="large" />
</div>
{ddo.metadata.type === 'algorithm' ? (

View File

@ -217,9 +217,6 @@ export default function Download({
orderPriceAndFees={orderPriceAndFees}
conversion
size="large"
locale={locale}
currency={currency}
prices={prices}
/>
{!isInPurgatory && <PurchaseButton />}
</div>

View File

@ -83,9 +83,6 @@ export default function PoolSections() {
symbol={poolInfo?.baseTokenSymbol}
balance={poolInfoUser?.liquidity}
conversion
locale={locale}
currency={currency}
prices={prices}
/>
</PoolSection>
@ -97,9 +94,6 @@ export default function PoolSections() {
symbol={poolInfo?.baseTokenSymbol}
balance={poolInfoOwner?.liquidity}
conversion
locale={locale}
currency={currency}
prices={prices}
/>
</PoolSection>
@ -108,9 +102,6 @@ export default function PoolSections() {
symbol={poolInfo?.baseTokenSymbol}
balance={poolData?.baseTokenLiquidity.toString()}
conversion
locale={locale}
currency={currency}
prices={prices}
/>
</PoolSection>
@ -131,27 +122,18 @@ export default function PoolSections() {
balance={poolInfo?.liquidityProviderSwapFee}
noIcon
size="mini"
locale={locale}
currency={currency}
prices={prices}
/>
<Token
symbol="% market fee"
balance={poolInfo?.publishMarketSwapFee}
noIcon
size="mini"
locale={locale}
currency={currency}
prices={prices}
/>
<Token
symbol="% OPC fee"
balance={oceanCommunitySwapFee}
noIcon
size="mini"
locale={locale}
currency={currency}
prices={prices}
/>
</PoolSection>

View File

@ -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<string>()
const [oceanTokenMetadata, setOceanTokenMetadata] = useState<{
@ -68,14 +66,7 @@ export default function Details(): ReactElement {
{formatCurrency(Number(value), '', locale, false, {
significantFigures: 4
})}
{key === 'ocean' && (
<Conversion
price={value}
locale={locale}
currency={currency}
prices={prices}
/>
)}
{key === 'ocean' && <Conversion price={value} />}
</li>
))}

View File

@ -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 (
<Price
accessDetails={row.accessDetails}
size="small"
locale={locale}
currency={currency}
prices={prices}
/>
)
return <Price accessDetails={row.accessDetails} size="small" />
}
const columns = [

View File

@ -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({
<div className={styles.stats}>
<NumberUnit
label="Liquidity in Own Assets"
value={
<Conversion
price={publisherTvl}
hideApproximateSymbol
locale={locale}
prices={prices}
currency={currency}
/>
}
value={<Conversion price={publisherTvl} hideApproximateSymbol />}
/>
<NumberUnit
label="Liquidity"
value={
<Conversion
price={totalTvl}
hideApproximateSymbol
locale={locale}
prices={prices}
currency={currency}
/>
}
value={<Conversion price={totalTvl} hideApproximateSymbol />}
/>
<NumberUnit label={`Sale${sales === 1 ? '' : 's'}`} value={sales} />
<NumberUnit label="Published" value={assetsTotal} />

View File

@ -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}
/>
<Token
symbol={row.poolShare.pool.baseToken.symbol}
balance={liquidity}
noIcon
locale={locale}
currency={currency}
prices={prices}
/>
</div>
)

View File

@ -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 (
<div className={styles.coin}>
@ -51,12 +49,7 @@ export default function Coin({
{...field}
/>
{datatokenOptions?.symbol === 'OCEAN' && (
<Conversion
price={field.value}
locale={locale}
currency={currency}
prices={prices}
/>
<Conversion price={field.value} />
)}
<div>
<Error meta={meta} />