From e3892143c59ed477aa4c57384dbcae329aeb65e6 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 11 Aug 2020 09:41:23 +0200 Subject: [PATCH] more feedback fixes --- src/components/molecules/Wallet/Feedback.tsx | 12 ++++++------ src/components/organisms/AssetActions/Compute.tsx | 2 +- src/components/organisms/AssetActions/Consume.tsx | 2 +- src/components/organisms/AssetActions/index.tsx | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/molecules/Wallet/Feedback.tsx b/src/components/molecules/Wallet/Feedback.tsx index b0f8f0e4a..77f0da55e 100644 --- a/src/components/molecules/Wallet/Feedback.tsx +++ b/src/components/molecules/Wallet/Feedback.tsx @@ -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.' diff --git a/src/components/organisms/AssetActions/Compute.tsx b/src/components/organisms/AssetActions/Compute.tsx index 7a4e23cf0..0d593c6e6 100644 --- a/src/components/organisms/AssetActions/Compute.tsx +++ b/src/components/organisms/AssetActions/Compute.tsx @@ -129,7 +129,7 @@ export default function Compute({ state="success" /> )} - + diff --git a/src/components/organisms/AssetActions/Consume.tsx b/src/components/organisms/AssetActions/Consume.tsx index a4af9e049..64018fe58 100644 --- a/src/components/organisms/AssetActions/Consume.tsx +++ b/src/components/organisms/AssetActions/Consume.tsx @@ -55,7 +55,7 @@ export default function Consume({
- +
) diff --git a/src/components/organisms/AssetActions/index.tsx b/src/components/organisms/AssetActions/index.tsx index 8f508d521..0c19746ca 100644 --- a/src/components/organisms/AssetActions/index.tsx +++ b/src/components/organisms/AssetActions/index.tsx @@ -17,7 +17,7 @@ export default function AssetActions({ }): ReactElement { const { balance } = useOcean() const [price, setPrice] = useState() - const [isBalanceSufficient, setIsBalanceSufficient] = useState(false) + const [isBalanceSufficient, setIsBalanceSufficient] = useState() const isCompute = Boolean(ddo.findServiceByType('compute'))