mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-13 16:54:53 +01:00
more feedback fixes
This commit is contained in:
parent
1c38f30f8a
commit
e3892143c5
@ -12,9 +12,9 @@ export declare type Web3Error = {
|
||||
}
|
||||
|
||||
export default function Web3Feedback({
|
||||
isBalanceInsufficient
|
||||
isBalanceSufficient
|
||||
}: {
|
||||
isBalanceInsufficient?: boolean
|
||||
isBalanceSufficient?: boolean
|
||||
}): ReactElement {
|
||||
const { appConfig } = useSiteMetadata()
|
||||
const { account, status, chainId } = useOcean()
|
||||
@ -24,7 +24,7 @@ export default function Web3Feedback({
|
||||
!account ||
|
||||
isOceanConnectionError ||
|
||||
!correctNetwork ||
|
||||
isBalanceInsufficient === true
|
||||
isBalanceSufficient === false
|
||||
|
||||
const desiredNetworkName = appConfig.network.replace(/^\w/, (c: string) =>
|
||||
c.toUpperCase()
|
||||
@ -34,7 +34,7 @@ export default function Web3Feedback({
|
||||
? 'error'
|
||||
: !correctNetwork
|
||||
? 'warning'
|
||||
: account && !isBalanceInsufficient
|
||||
: account && isBalanceSufficient
|
||||
? 'success'
|
||||
: 'warning'
|
||||
|
||||
@ -45,7 +45,7 @@ export default function Web3Feedback({
|
||||
: !correctNetwork
|
||||
? 'Wrong Network'
|
||||
: account
|
||||
? isBalanceInsufficient === true
|
||||
? isBalanceSufficient === false
|
||||
? 'Insufficient balance'
|
||||
: 'Connected to Ocean'
|
||||
: 'Something went wrong'
|
||||
@ -56,7 +56,7 @@ export default function Web3Feedback({
|
||||
? 'Please try again.'
|
||||
: !correctNetwork
|
||||
? `Please connect to ${desiredNetworkName}.`
|
||||
: isBalanceInsufficient === true
|
||||
: isBalanceSufficient === false
|
||||
? 'You do not have enough OCEAN in your wallet to purchase this asset.'
|
||||
: 'Something went wrong.'
|
||||
|
||||
|
@ -129,7 +129,7 @@ export default function Compute({
|
||||
state="success"
|
||||
/>
|
||||
)}
|
||||
<Web3Feedback isBalanceInsufficient={!isBalanceSufficient} />
|
||||
<Web3Feedback isBalanceSufficient={isBalanceSufficient} />
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -55,7 +55,7 @@ export default function Consume({
|
||||
</div>
|
||||
|
||||
<footer className={styles.feedback}>
|
||||
<Web3Feedback isBalanceInsufficient />
|
||||
<Web3Feedback isBalanceSufficient={isBalanceSufficient} />
|
||||
</footer>
|
||||
</aside>
|
||||
)
|
||||
|
@ -17,7 +17,7 @@ export default function AssetActions({
|
||||
}): ReactElement {
|
||||
const { balance } = useOcean()
|
||||
const [price, setPrice] = useState<string>()
|
||||
const [isBalanceSufficient, setIsBalanceSufficient] = useState(false)
|
||||
const [isBalanceSufficient, setIsBalanceSufficient] = useState<boolean>()
|
||||
|
||||
const isCompute = Boolean(ddo.findServiceByType('compute'))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user