mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
some more fixes regarding currency and prices use
This commit is contained in:
parent
2c1df58efc
commit
3a3feda675
@ -1,9 +1,19 @@
|
|||||||
|
import { Prices } from '@context/Prices'
|
||||||
import { Asset } from '@oceanprotocol/lib'
|
import { Asset } from '@oceanprotocol/lib'
|
||||||
import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
||||||
import { AssetExtended } from 'src/@types/AssetExtended'
|
import { AssetExtended } from 'src/@types/AssetExtended'
|
||||||
|
|
||||||
export const locale: string = 'en-US'
|
export const locale: string = 'en-US'
|
||||||
|
|
||||||
|
export const currency: string = 'USD'
|
||||||
|
|
||||||
|
export const prices: Prices = {
|
||||||
|
eur: 0.0,
|
||||||
|
usd: 0.0,
|
||||||
|
eth: 0.0,
|
||||||
|
btc: 0.0
|
||||||
|
}
|
||||||
|
|
||||||
export const mockWallet: string = '0x02f28391AAECE3654F4ece783d777dde4300d5ef' // dummy account for stories
|
export const mockWallet: string = '0x02f28391AAECE3654F4ece783d777dde4300d5ef' // dummy account for stories
|
||||||
|
|
||||||
export const asset: Asset = {
|
export const asset: Asset = {
|
||||||
|
@ -5,6 +5,7 @@ import PriceUnit from '@shared/Price/PriceUnit'
|
|||||||
import Loader from '@shared/atoms/Loader'
|
import Loader from '@shared/atoms/Loader'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection'
|
||||||
|
import { Prices } from '@context/Prices'
|
||||||
|
|
||||||
function Empty() {
|
function Empty() {
|
||||||
return <div className={styles.empty}>No assets found.</div>
|
return <div className={styles.empty}>No assets found.</div>
|
||||||
@ -13,11 +14,15 @@ function Empty() {
|
|||||||
export interface AssetComputeListProps {
|
export interface AssetComputeListProps {
|
||||||
assets: AssetSelectionAsset[]
|
assets: AssetSelectionAsset[]
|
||||||
locale: string
|
locale: string
|
||||||
|
currency: string
|
||||||
|
prices: Prices
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AssetComputeSelection({
|
export default function AssetComputeSelection({
|
||||||
assets,
|
assets,
|
||||||
locale
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
}: AssetComputeListProps): JSX.Element {
|
}: AssetComputeListProps): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div className={styles.display}>
|
<div className={styles.display}>
|
||||||
@ -45,6 +50,8 @@ export default function AssetComputeSelection({
|
|||||||
size="small"
|
size="small"
|
||||||
className={styles.price}
|
className={styles.price}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -9,6 +9,7 @@ import { useIsMounted } from '@hooks/useIsMounted'
|
|||||||
import { AssetExtended } from 'src/@types/AssetExtended'
|
import { AssetExtended } from 'src/@types/AssetExtended'
|
||||||
import { Asset } from '@oceanprotocol/lib'
|
import { Asset } from '@oceanprotocol/lib'
|
||||||
import { getAccessDetailsForAssets } from '@utils/accessDetailsAndPricing'
|
import { getAccessDetailsForAssets } from '@utils/accessDetailsAndPricing'
|
||||||
|
import { Prices } from '@context/Prices'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
@ -32,6 +33,8 @@ export interface AssetListProps {
|
|||||||
chainIds: number[]
|
chainIds: number[]
|
||||||
accountId: string
|
accountId: string
|
||||||
locale: string
|
locale: string
|
||||||
|
currency: string
|
||||||
|
prices: Prices
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AssetList({
|
export default function AssetList({
|
||||||
@ -45,7 +48,9 @@ export default function AssetList({
|
|||||||
noPublisher,
|
noPublisher,
|
||||||
chainIds,
|
chainIds,
|
||||||
accountId,
|
accountId,
|
||||||
locale
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
}: AssetListProps): ReactElement {
|
}: AssetListProps): ReactElement {
|
||||||
const [assetsWithPrices, setAssetsWithPrices] = useState<AssetExtended[]>()
|
const [assetsWithPrices, setAssetsWithPrices] = useState<AssetExtended[]>()
|
||||||
const [loading, setLoading] = useState<boolean>(isLoading)
|
const [loading, setLoading] = useState<boolean>(isLoading)
|
||||||
@ -90,6 +95,8 @@ export default function AssetList({
|
|||||||
key={`${assetWithPrice.id}_${i}`}
|
key={`${assetWithPrice.id}_${i}`}
|
||||||
noPublisher={noPublisher}
|
noPublisher={noPublisher}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
import { assetExtended, locale } from '../../../../.storybook/__mockdata__'
|
import {
|
||||||
|
assetExtended,
|
||||||
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
|
} from '../../../../.storybook/__mockdata__'
|
||||||
import AssetTeaser, { AssetTeaserProps } from '@shared/AssetTeaser'
|
import AssetTeaser, { AssetTeaserProps } from '@shared/AssetTeaser'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -21,5 +26,7 @@ interface Props {
|
|||||||
export const Default: Props = Template.bind({})
|
export const Default: Props = Template.bind({})
|
||||||
Default.args = {
|
Default.args = {
|
||||||
locale,
|
locale,
|
||||||
|
currency,
|
||||||
|
prices,
|
||||||
asset: assetExtended
|
asset: assetExtended
|
||||||
}
|
}
|
||||||
|
@ -9,17 +9,22 @@ import NetworkName from '@shared/NetworkName'
|
|||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import { getServiceByName } from '@utils/ddo'
|
import { getServiceByName } from '@utils/ddo'
|
||||||
import { AssetExtended } from 'src/@types/AssetExtended'
|
import { AssetExtended } from 'src/@types/AssetExtended'
|
||||||
|
import { Prices } from '@context/Prices'
|
||||||
|
|
||||||
export interface AssetTeaserProps {
|
export interface AssetTeaserProps {
|
||||||
asset: AssetExtended
|
asset: AssetExtended
|
||||||
noPublisher?: boolean
|
noPublisher?: boolean
|
||||||
locale: string
|
locale: string
|
||||||
|
prices: Prices
|
||||||
|
currency: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AssetTeaser({
|
export default function AssetTeaser({
|
||||||
asset,
|
asset,
|
||||||
noPublisher,
|
noPublisher,
|
||||||
locale
|
locale,
|
||||||
|
prices,
|
||||||
|
currency
|
||||||
}: AssetTeaserProps): ReactElement {
|
}: AssetTeaserProps): ReactElement {
|
||||||
const { name, type, description } = asset.metadata
|
const { name, type, description } = asset.metadata
|
||||||
const { datatokens } = asset
|
const { datatokens } = asset
|
||||||
@ -57,6 +62,8 @@ export default function AssetTeaser({
|
|||||||
accessDetails={asset.accessDetails}
|
accessDetails={asset.accessDetails}
|
||||||
size="small"
|
size="small"
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
prices={prices}
|
||||||
|
currency={currency}
|
||||||
/>
|
/>
|
||||||
<NetworkName networkId={asset.chainId} className={styles.network} />
|
<NetworkName networkId={asset.chainId} className={styles.network} />
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -7,7 +7,7 @@ import External from '@images/external.svg'
|
|||||||
import InputElement from '@shared/FormInput/InputElement'
|
import InputElement from '@shared/FormInput/InputElement'
|
||||||
import Loader from '@shared/atoms/Loader'
|
import Loader from '@shared/atoms/Loader'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
import { Prices } from '@context/Prices'
|
||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
@ -21,6 +21,9 @@ export interface AssetSelectionAsset {
|
|||||||
|
|
||||||
export interface AssetSelectionProps {
|
export interface AssetSelectionProps {
|
||||||
assets: AssetSelectionAsset[]
|
assets: AssetSelectionAsset[]
|
||||||
|
currency: string
|
||||||
|
locale: string
|
||||||
|
prices: Prices
|
||||||
multiple?: boolean
|
multiple?: boolean
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
}
|
}
|
||||||
@ -33,10 +36,13 @@ 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 { locale } = useUserPreferences()
|
||||||
|
|
||||||
const styleClassesInput = cx({
|
const styleClassesInput = cx({
|
||||||
input: true,
|
input: true,
|
||||||
@ -117,6 +123,8 @@ export default function AssetSelection({
|
|||||||
size="small"
|
size="small"
|
||||||
className={styles.price}
|
className={styles.price}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
prices={prices}
|
||||||
|
currency={currency}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
import Conversion, { ConversionProps } from '@shared/Price/Conversion'
|
import Conversion, { ConversionProps } from '@shared/Price/Conversion'
|
||||||
import { locale } from '../../../../../.storybook/__mockdata__'
|
import {
|
||||||
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
|
} from '../../../../../.storybook/__mockdata__'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/Price/Conversion',
|
title: 'Component/@shared/Price/Conversion',
|
||||||
@ -19,12 +23,16 @@ interface Props {
|
|||||||
export const Default: Props = Template.bind({})
|
export const Default: Props = Template.bind({})
|
||||||
Default.args = {
|
Default.args = {
|
||||||
price: '11.12333',
|
price: '11.12333',
|
||||||
locale
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
}
|
}
|
||||||
|
|
||||||
export const HideApproximateSymbol: Props = Template.bind({})
|
export const HideApproximateSymbol: Props = Template.bind({})
|
||||||
HideApproximateSymbol.args = {
|
HideApproximateSymbol.args = {
|
||||||
price: '11.12333',
|
price: '11.12333',
|
||||||
locale,
|
locale,
|
||||||
|
currency,
|
||||||
|
prices,
|
||||||
hideApproximateSymbol: true
|
hideApproximateSymbol: true
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
import PriceUnit, { PriceUnitProps } from '@shared/Price/PriceUnit'
|
import PriceUnit, { PriceUnitProps } from '@shared/Price/PriceUnit'
|
||||||
import { locale } from '../../../../../.storybook/__mockdata__'
|
import {
|
||||||
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
|
} from '../../../../../.storybook/__mockdata__'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/Price/PriceUnit',
|
title: 'Component/@shared/Price/PriceUnit',
|
||||||
@ -19,5 +23,7 @@ interface Props {
|
|||||||
export const Default: Props = Template.bind({})
|
export const Default: Props = Template.bind({})
|
||||||
Default.args = {
|
Default.args = {
|
||||||
price: '11.12333',
|
price: '11.12333',
|
||||||
locale
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
import Price, { PriceProps } from '@shared/Price'
|
import Price, { PriceProps } from '@shared/Price'
|
||||||
import { AccessDetails } from 'src/@types/Price'
|
import { AccessDetails } from 'src/@types/Price'
|
||||||
import { locale } from '../../../../.storybook/__mockdata__'
|
import { locale, currency, prices } from '../../../../.storybook/__mockdata__'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/Price',
|
title: 'Component/@shared/Price',
|
||||||
@ -41,5 +41,7 @@ const accessDetailsData = {
|
|||||||
export const Default: Props = Template.bind({})
|
export const Default: Props = Template.bind({})
|
||||||
Default.args = {
|
Default.args = {
|
||||||
accessDetails: accessDetailsData as AccessDetails,
|
accessDetails: accessDetailsData as AccessDetails,
|
||||||
locale
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ 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,6 +13,8 @@ export interface PriceProps {
|
|||||||
conversion?: boolean
|
conversion?: boolean
|
||||||
size?: 'small' | 'mini' | 'large'
|
size?: 'small' | 'mini' | 'large'
|
||||||
locale: string
|
locale: string
|
||||||
|
currency: string
|
||||||
|
prices: Prices
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Price({
|
export default function Price({
|
||||||
@ -20,7 +23,9 @@ export default function Price({
|
|||||||
className,
|
className,
|
||||||
size,
|
size,
|
||||||
conversion,
|
conversion,
|
||||||
locale
|
locale,
|
||||||
|
currency,
|
||||||
|
prices
|
||||||
}: PriceProps): ReactElement {
|
}: PriceProps): ReactElement {
|
||||||
return accessDetails?.price || accessDetails?.type === 'free' ? (
|
return accessDetails?.price || accessDetails?.type === 'free' ? (
|
||||||
<PriceUnit
|
<PriceUnit
|
||||||
@ -31,6 +36,8 @@ export default function Price({
|
|||||||
conversion={conversion}
|
conversion={conversion}
|
||||||
type={accessDetails.type}
|
type={accessDetails.type}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>
|
/>
|
||||||
) : !accessDetails || accessDetails?.type === '' ? (
|
) : !accessDetails || accessDetails?.type === '' ? (
|
||||||
<div className={styles.empty}>
|
<div className={styles.empty}>
|
||||||
|
@ -4,6 +4,7 @@ import PriceUnit from '@shared/Price/PriceUnit'
|
|||||||
import Logo from '@shared/atoms/Logo'
|
import Logo from '@shared/atoms/Logo'
|
||||||
import Conversion from '@shared/Price/Conversion'
|
import Conversion from '@shared/Price/Conversion'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
|
import { usePrices } from '@context/Prices'
|
||||||
|
|
||||||
export default function Token({
|
export default function Token({
|
||||||
symbol,
|
symbol,
|
||||||
@ -18,7 +19,8 @@ export default function Token({
|
|||||||
noIcon?: boolean
|
noIcon?: boolean
|
||||||
size?: 'small' | 'mini'
|
size?: 'small' | 'mini'
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { locale } = useUserPreferences()
|
const { locale, currency } = useUserPreferences()
|
||||||
|
const { prices } = usePrices()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${styles.token} ${size ? styles[size] : ''}`}>
|
<div className={`${styles.token} ${size ? styles[size] : ''}`}>
|
||||||
@ -32,6 +34,8 @@ export default function Token({
|
|||||||
symbol={symbol}
|
symbol={symbol}
|
||||||
size={size}
|
size={size}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
prices={prices}
|
||||||
|
currency={currency}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{conversion && (
|
{conversion && (
|
||||||
@ -39,6 +43,8 @@ export default function Token({
|
|||||||
price={balance}
|
price={balance}
|
||||||
className={`${styles.conversion}`}
|
className={`${styles.conversion}`}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
prices={prices}
|
||||||
|
currency={currency}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
@ -16,10 +16,12 @@ import { getOpcFees } from '@utils/subgraph'
|
|||||||
import { useWeb3 } from '@context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
import Decimal from 'decimal.js'
|
import Decimal from 'decimal.js'
|
||||||
import { useUserPreferences } from '@context/UserPreferences'
|
import { useUserPreferences } from '@context/UserPreferences'
|
||||||
|
import { usePrices } from '@context/Prices'
|
||||||
|
|
||||||
export default function PoolSections() {
|
export default function PoolSections() {
|
||||||
const { asset } = useAsset()
|
const { asset } = useAsset()
|
||||||
const { locale } = useUserPreferences()
|
const { locale, currency } = useUserPreferences()
|
||||||
|
const { prices } = usePrices()
|
||||||
const { poolData, poolInfo, poolInfoUser, poolInfoOwner } = usePool()
|
const { poolData, poolInfo, poolInfoUser, poolInfoOwner } = usePool()
|
||||||
const { getOpcFeeForToken } = useMarketMetadata()
|
const { getOpcFeeForToken } = useMarketMetadata()
|
||||||
const { chainId } = useWeb3()
|
const { chainId } = useWeb3()
|
||||||
@ -42,6 +44,8 @@ export default function PoolSections() {
|
|||||||
symbol={poolInfo?.datatokenSymbol}
|
symbol={poolInfo?.datatokenSymbol}
|
||||||
size="large"
|
size="large"
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>{' '}
|
/>{' '}
|
||||||
={' '}
|
={' '}
|
||||||
<PriceUnit
|
<PriceUnit
|
||||||
@ -49,6 +53,8 @@ export default function PoolSections() {
|
|||||||
symbol={poolInfo?.baseTokenSymbol}
|
symbol={poolInfo?.baseTokenSymbol}
|
||||||
size="large"
|
size="large"
|
||||||
locale={locale}
|
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}>
|
||||||
|
@ -11,12 +11,20 @@ import { AssetExtended } from 'src/@types/AssetExtended'
|
|||||||
import { getAccessDetailsForAssets } from '@utils/accessDetailsAndPricing'
|
import { getAccessDetailsForAssets } from '@utils/accessDetailsAndPricing'
|
||||||
import { useWeb3 } from '@context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
import { useMarketMetadata } from '@context/MarketMetadata'
|
import { useMarketMetadata } from '@context/MarketMetadata'
|
||||||
|
import { usePrices } from '@context/Prices'
|
||||||
|
|
||||||
export function PriceComponent(row: AssetExtended) {
|
export function PriceComponent(row: AssetExtended) {
|
||||||
const { locale } = useUserPreferences()
|
const { locale, currency } = useUserPreferences()
|
||||||
|
const { prices } = usePrices()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Price accessDetails={row.accessDetails} size="small" locale={locale} />
|
<Price
|
||||||
|
accessDetails={row.accessDetails}
|
||||||
|
size="small"
|
||||||
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import { useIsMounted } from '@hooks/useIsMounted'
|
|||||||
import { useCancelToken } from '@hooks/useCancelToken'
|
import { useCancelToken } from '@hooks/useCancelToken'
|
||||||
import { SortTermOptions } from '../../@types/aquarius/SearchQuery'
|
import { SortTermOptions } from '../../@types/aquarius/SearchQuery'
|
||||||
import { useWeb3 } from '@context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
|
import { usePrices } from '@context/Prices'
|
||||||
|
|
||||||
async function getQueryHighest(
|
async function getQueryHighest(
|
||||||
chainIds: number[]
|
chainIds: number[]
|
||||||
@ -52,7 +53,8 @@ function SectionQueryResult({
|
|||||||
action?: ReactElement
|
action?: ReactElement
|
||||||
queryData?: string[]
|
queryData?: string[]
|
||||||
}) {
|
}) {
|
||||||
const { chainIds, locale } = useUserPreferences()
|
const { chainIds, locale, currency } = useUserPreferences()
|
||||||
|
const { prices } = usePrices()
|
||||||
const { accountId } = useWeb3()
|
const { accountId } = useWeb3()
|
||||||
const [result, setResult] = useState<PagedAssets>()
|
const [result, setResult] = useState<PagedAssets>()
|
||||||
const [loading, setLoading] = useState<boolean>()
|
const [loading, setLoading] = useState<boolean>()
|
||||||
@ -104,6 +106,8 @@ function SectionQueryResult({
|
|||||||
chainIds={chainIds}
|
chainIds={chainIds}
|
||||||
accountId={accountId}
|
accountId={accountId}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{action && action}
|
{action && action}
|
||||||
|
@ -8,6 +8,7 @@ import { useCancelToken } from '@hooks/useCancelToken'
|
|||||||
import Filters from '../../Search/Filters'
|
import Filters from '../../Search/Filters'
|
||||||
import { useMarketMetadata } from '@context/MarketMetadata'
|
import { useMarketMetadata } from '@context/MarketMetadata'
|
||||||
import { CancelToken } from 'axios'
|
import { CancelToken } from 'axios'
|
||||||
|
import { usePrices } from '@context/Prices'
|
||||||
|
|
||||||
export default function PublishedList({
|
export default function PublishedList({
|
||||||
accountId
|
accountId
|
||||||
@ -15,7 +16,8 @@ export default function PublishedList({
|
|||||||
accountId: string
|
accountId: string
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { appConfig } = useMarketMetadata()
|
const { appConfig } = useMarketMetadata()
|
||||||
const { chainIds, locale } = useUserPreferences()
|
const { chainIds, locale, currency } = useUserPreferences()
|
||||||
|
const { prices } = usePrices()
|
||||||
|
|
||||||
const [queryResult, setQueryResult] = useState<PagedAssets>()
|
const [queryResult, setQueryResult] = useState<PagedAssets>()
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
@ -97,6 +99,8 @@ export default function PublishedList({
|
|||||||
chainIds={chainIds}
|
chainIds={chainIds}
|
||||||
accountId={accountId}
|
accountId={accountId}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
@ -9,6 +9,7 @@ import { useCancelToken } from '@hooks/useCancelToken'
|
|||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useWeb3 } from '@context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
|
import { usePrices } from '@context/Prices'
|
||||||
|
|
||||||
export default function SearchPage({
|
export default function SearchPage({
|
||||||
setTotalResults,
|
setTotalResults,
|
||||||
@ -19,7 +20,8 @@ export default function SearchPage({
|
|||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const [parsed, setParsed] = useState<queryString.ParsedQuery<string>>()
|
const [parsed, setParsed] = useState<queryString.ParsedQuery<string>>()
|
||||||
const { chainIds, locale } = useUserPreferences()
|
const { chainIds, locale, currency } = useUserPreferences()
|
||||||
|
const { prices } = usePrices()
|
||||||
const { accountId } = useWeb3()
|
const { accountId } = useWeb3()
|
||||||
const [queryResult, setQueryResult] = useState<PagedAssets>()
|
const [queryResult, setQueryResult] = useState<PagedAssets>()
|
||||||
const [loading, setLoading] = useState<boolean>()
|
const [loading, setLoading] = useState<boolean>()
|
||||||
@ -111,6 +113,8 @@ export default function SearchPage({
|
|||||||
chainIds={chainIds}
|
chainIds={chainIds}
|
||||||
accountId={accountId}
|
accountId={accountId}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
|
currency={currency}
|
||||||
|
prices={prices}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user