Skip to content

Commit

Permalink
use latest client; error msg when depositing all sol; pointer cursor …
Browse files Browse the repository at this point in the history
…on orderbook
  • Loading branch information
tlrjs committed Nov 18, 2021
1 parent ec63399 commit 45c4f20
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
12 changes: 11 additions & 1 deletion components/DepositModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ const DepositModal: FunctionComponent<DepositModalProps> = ({
percentage: percentage.toFixed(2),
})

const inputDisabled =
selectedAccount.config.symbol === 'SOL' &&
selectedAccount.uiBalance.toString() === inputAmount

return (
<Modal isOpen={isOpen} onClose={onClose}>
<Modal.Header>
Expand Down Expand Up @@ -204,6 +208,12 @@ const DepositModal: FunctionComponent<DepositModalProps> = ({
values={['25', '50', '75', '100']}
/>
</div>
{selectedAccount.config.symbol === 'SOL' &&
parseFloat(inputAmount) > selectedAccount.uiBalance - 0.01 ? (
<div className="tiny-text text-center text-th-red -mb-4">
You must leave enough SOL in your wallet to pay for the transaction
</div>
) : null}
{repayAmount ? (
<div className="pt-3">
<InlineNotification desc={repayMessage} type="info" />
Expand All @@ -213,7 +223,7 @@ const DepositModal: FunctionComponent<DepositModalProps> = ({
<Button
onClick={handleDeposit}
className="w-full"
disabled={submitting}
disabled={submitting || inputDisabled}
>
<div className={`flex items-center justify-center`}>
{submitting && <Loading className="-ml-1 mr-3" />}
Expand Down
5 changes: 4 additions & 1 deletion components/Orderbook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,10 @@ const OrderbookRow = React.memo<any>(
if (!market) return null

return (
<div className={`flex text-sm leading-7 justify-between`} ref={element}>
<div
className={`flex text-sm leading-7 justify-between cursor-pointer`}
ref={element}
>
{invert ? (
<>
<div className={`text-left relative flex-1`}>
Expand Down
15 changes: 5 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@

"@blockworks-foundation/mango-client@git+https://github.com/blockworks-foundation/mango-client-v3.git":
version "3.2.5"
resolved "git+https://github.com/blockworks-foundation/mango-client-v3.git#cbd7294148325b0f787a7e8b186b99da05f170fd"
resolved "git+https://github.com/blockworks-foundation/mango-client-v3.git#834505a8a7ffb68c56035d6602f3d12b1c953cf0"
dependencies:
"@project-serum/anchor" "^0.16.2"
"@project-serum/serum" "0.13.55"
Expand Down Expand Up @@ -1848,9 +1848,9 @@
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==

"@types/lodash@^4.14.159":
version "4.14.176"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.176.tgz#641150fc1cda36fbfa329de603bbb175d7ee20c0"
integrity sha512-xZmuPTa3rlZoIbtDUyJKZQimJV3bxCmzMIO2c9Pz9afyDro6kr7R79GwcB6mRhuoPmV2p1Vb66WOJH7F886WKQ==
version "4.14.177"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.177.tgz#f70c0d19c30fab101cad46b52be60363c43c4578"
integrity sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==

"@types/node@*":
version "16.11.7"
Expand Down Expand Up @@ -2481,16 +2481,11 @@ bindings@^1.3.0:
dependencies:
file-uri-to-path "1.0.0"

[email protected], bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9, bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.1, bn.js@^5.1.2:
[email protected], bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9, bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0:
version "5.1.3"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b"
integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==

bn.js@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002"
integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==

boolbase@^1.0.0, boolbase@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
Expand Down

0 comments on commit 45c4f20

Please sign in to comment.