mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
consume fixes, tab fixes
This commit is contained in:
parent
b5356e6c42
commit
d7ff2694f7
@ -27,18 +27,21 @@ export default function Consume({
|
||||
toast.error(consumeError)
|
||||
}
|
||||
|
||||
const PurchaseButton = () =>
|
||||
consumeStepText ? (
|
||||
<Loader message={consumeStepText} />
|
||||
) : (
|
||||
<Button
|
||||
style="primary"
|
||||
onClick={() => consume(ddo.id, ddo.dataToken, 'access')}
|
||||
disabled={isDisabled}
|
||||
>
|
||||
Buy
|
||||
</Button>
|
||||
)
|
||||
const PurchaseButton = () => (
|
||||
<div>
|
||||
{consumeStepText ? (
|
||||
<Loader message={consumeStepText} />
|
||||
) : (
|
||||
<Button
|
||||
style="primary"
|
||||
onClick={() => consume(ddo.id, ddo.dataToken, 'access')}
|
||||
disabled={isDisabled}
|
||||
>
|
||||
Buy
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<aside className={styles.consume}>
|
||||
|
@ -46,15 +46,20 @@ export default function AssetActions({ ddo }: { ddo: DDO }): ReactElement {
|
||||
{
|
||||
title: 'Use',
|
||||
content: UseContent
|
||||
},
|
||||
(!((attributes.additionalInformation as unknown) as AdditionalInformationMarket)
|
||||
?.priceType ||
|
||||
((attributes.additionalInformation as unknown) as AdditionalInformationMarket)
|
||||
?.priceType === 'dynamic') && {
|
||||
title: 'Pool',
|
||||
content: <Pool ddo={ddo} />
|
||||
}
|
||||
]
|
||||
|
||||
// Check from metadata, cause that is available earlier
|
||||
const hasPool =
|
||||
((attributes.additionalInformation as unknown) as AdditionalInformationMarket)
|
||||
?.priceType === 'dynamic'
|
||||
// price?.type === 'pool'
|
||||
|
||||
hasPool &&
|
||||
tabs.push({
|
||||
title: 'Pool',
|
||||
content: <Pool ddo={ddo} />
|
||||
})
|
||||
|
||||
return <Tabs items={tabs} className={styles.actions} />
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user