diff --git a/components/AccountStats.tsx b/components/AccountStats.tsx index 80c577b..69637c1 100644 --- a/components/AccountStats.tsx +++ b/components/AccountStats.tsx @@ -1,48 +1,47 @@ -import useMangoGroup from 'hooks/useMangoGroup' -import { useMemo } from 'react' -import FormatNumericValue from './shared/FormatNumericValue' -import useMangoAccount from 'hooks/useMangoAccount' +// import useMangoGroup from 'hooks/useMangoGroup' +// import { useMemo } from 'react' +// import FormatNumericValue from './shared/FormatNumericValue' +// import useMangoAccount from 'hooks/useMangoAccount' const AccountStats = ({ token }: { token: string }) => { - const { mangoAccount } = useMangoAccount() - const { group } = useMangoGroup() + // const { mangoAccount } = useMangoAccount() + // const { group } = useMangoGroup() - const bank = useMemo(() => { - if (!group) return undefined - return group.banksMapByName.get(token)?.[0] - }, [group, token]) + // const bank = useMemo(() => { + // if (!group) return undefined + // return group.banksMapByName.get(token)?.[0] + // }, [group, token]) - const position = bank ? mangoAccount?.getTokenBalanceUi(bank) || 0.0 : 0.0 + // const position = bank ? mangoAccount?.getTokenBalanceUi(bank) || 0.0 : 0.0 return ( -
-
+ <> +

{`Boosted ${token}`}

+
-
Est. {token} APR
-
14.89%
+

Est. APR

+ 14.89%
-
Max Leverage
-
3x
+

Max Leverage

+ 3x
-
Available to borrow
-
100,000
+

Capacity Remaining

+ 100,000 SOL
+

Total Staked

+ {`100,000 ${token}`} +
+ {/*
Your position
{bank ? : 0.0}
-
-
-
Title Here
-
-
-
Title Here
-
+
*/}
-
+ ) } diff --git a/components/StakeForm.tsx b/components/StakeForm.tsx index d660f7e..a4cc1a3 100644 --- a/components/StakeForm.tsx +++ b/components/StakeForm.tsx @@ -23,7 +23,7 @@ import { floorToDecimal, withValueLimit } from 'utils/numbers' import BankAmountWithValue from './shared/BankAmountWithValue' // import useBanksWithBalances from 'hooks/useBanksWithBalances' import { isMangoError } from 'types' -import TokenListButton from './shared/TokenListButton' +// import TokenListButton from './shared/TokenListButton' import TokenLogo from './shared/TokenLogo' import SecondaryConnectButton from './shared/SecondaryConnectButton' import useMangoAccountAccounts from 'hooks/useMangoAccountAccounts' @@ -94,7 +94,8 @@ function DepositForm({ onSuccess, token: selectedToken }: DepositFormProps) { const { group } = useMangoGroup() const stakeBank = useMemo(() => { - return group?.banksMapByName.get(selectedToken)?.[0] + const bankName = selectedToken === 'mSOL' ? 'MSOL' : selectedToken + return group?.banksMapByName.get(bankName)?.[0] }, [selectedToken, group]) const solBank = useMemo(() => { @@ -236,8 +237,8 @@ function DepositForm({ onSuccess, token: selectedToken }: DepositFormProps) { /> */} -
-
+
+
-
-
+ {/*
} setShowList={setShowTokenList} /> -
-
- { - setInputAmount( - !Number.isNaN(Number(e.value)) ? e.value : '', - ) - }} - isAllowed={withValueLimit} - /> +
*/} +
+
+ { + setInputAmount( + !Number.isNaN(Number(e.value)) ? e.value : '', + ) + }} + isAllowed={withValueLimit} + /> +
+ +
+
+ + {selectedToken} + +
+
-
-
Leverage: {leverage}x
+
+
+
{stakeBank && solBank ? ( <> -
+

{t('deposit-amount')}

-

SOL borrowed

+

SOL Borrowed

{solBank ? ( - + + + ) : null}
-
+

{selectedToken} Leveraged APR

- +

{selectedToken} Deposit Rate

- +

SOL Borrow Rate

- + void }) => { return ( - ) diff --git a/components/UnstakeForm.tsx b/components/UnstakeForm.tsx index 921f4a8..85eeb15 100644 --- a/components/UnstakeForm.tsx +++ b/components/UnstakeForm.tsx @@ -23,7 +23,7 @@ import { floorToDecimal, withValueLimit } from 'utils/numbers' import BankAmountWithValue from './shared/BankAmountWithValue' // import useBanksWithBalances from 'hooks/useBanksWithBalances' import { isMangoError } from 'types' -import TokenListButton from './shared/TokenListButton' +// import TokenListButton from './shared/TokenListButton' import TokenLogo from './shared/TokenLogo' import SecondaryConnectButton from './shared/SecondaryConnectButton' import useMangoAccountAccounts from 'hooks/useMangoAccountAccounts' @@ -79,7 +79,8 @@ function UnstakeForm({ onSuccess, token: selectedToken }: UnstakeFormProps) { const { mangoAccount } = useMangoAccount() const stakeBank = useMemo(() => { - return group?.banksMapByName.get(selectedToken)?.[0] + const bankName = selectedToken === 'mSOL' ? 'MSOL' : selectedToken + return group?.banksMapByName.get(bankName)?.[0] }, [selectedToken, group]) const solBank = useMemo(() => { @@ -203,8 +204,8 @@ function UnstakeForm({ onSuccess, token: selectedToken }: UnstakeFormProps) { /> */} -
-
+
+
-
-
+ {/*
} setShowList={setShowTokenList} /> -
-
- { - setInputAmount( - !Number.isNaN(Number(e.value)) ? e.value : '', - ) - }} - isAllowed={withValueLimit} - /> +
*/} +
+
+ { + setInputAmount( + !Number.isNaN(Number(e.value)) ? e.value : '', + ) + }} + isAllowed={withValueLimit} + /> +
+ +
+
+ + {selectedToken} + +
+
{stakeBank && solBank ? ( <> -
+
-

Staked amount

+

Staked Amount

SOL borrowed

{solBank ? ( - + + + ) : null}
diff --git a/components/forms/Label.tsx b/components/forms/Label.tsx index 1e529fa..f76a6d6 100644 --- a/components/forms/Label.tsx +++ b/components/forms/Label.tsx @@ -7,7 +7,9 @@ const Label = ({ optional?: boolean className?: string }) => ( -

+

{text}{' '} {optional ? ( (Optional) diff --git a/components/shared/BankAmountWithValue.tsx b/components/shared/BankAmountWithValue.tsx index fe16567..f8babbf 100644 --- a/components/shared/BankAmountWithValue.tsx +++ b/components/shared/BankAmountWithValue.tsx @@ -16,13 +16,13 @@ const BankAmountWithValue = ({ value?: number }) => { return ( -

+

<> {' '} - + = ({ + +

+ {/*

Tokens

*/} +
+ {STAKEABLE_TOKENS.map((token) => ( -
mSOL
-
-
- -
JitoSOL
-
-
- -
stSOL
-
-
- -
LDO
-
+ ))}
-
+
-
-
+
+
setActiveTab(v)} + activeValue={activeFormTab} + values={['Add', 'Remove']} + onChange={(v) => setActiveFormTab(v)} />
- {activeTab === 'Stake' ? ( + {activeFormTab === 'Add' ? ( ) : null} - {activeTab === 'Unstake' ? ( + {activeFormTab === 'Remove' ? ( ) : null}
diff --git a/styles/globals.css b/styles/globals.css index dafcee8..d1fdf73 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -425,7 +425,7 @@ th { /* Base */ body { - @apply font-body text-sm font-medium tracking-wider; + @apply font-body text-base font-medium leading-tight tracking-wider; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @@ -470,11 +470,11 @@ h3 { } p { - @apply text-th-fgd-3; + @apply text-th-fgd-2; } li { - @apply text-sm text-th-fgd-3; + @apply text-base text-th-fgd-3; } a { @@ -518,7 +518,7 @@ input[type='text'] { /* Table */ table p { - @apply font-mono text-sm text-th-fgd-2; + @apply font-mono text-base text-th-fgd-2; } /* Scrollbars */ diff --git a/yarn.lock b/yarn.lock index ddad9cf..d65c64e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5975,14 +5975,7 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.11.0, is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== - dependencies: - has "^1.0.3" - -is-core-module@^2.13.0: +is-core-module@^2.11.0, is-core-module@^2.13.0, is-core-module@^2.9.0: version "2.13.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== @@ -7342,7 +7335,7 @@ postcss@8.4.14: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@^8.1.7: +postcss@^8.1.7, postcss@^8.4.23, postcss@^8.4.4: version "8.4.29" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.29.tgz#33bc121cf3b3688d4ddef50be869b2a54185a1dd" integrity sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw== @@ -7351,15 +7344,6 @@ postcss@^8.1.7: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@^8.4.23, postcss@^8.4.4: - version "8.4.28" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.28.tgz#c6cc681ed00109072816e1557f889ef51cf950a5" - integrity sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw== - dependencies: - nanoid "^3.3.6" - picocolors "^1.0.0" - source-map-js "^1.0.2" - preact@10.4.1: version "10.4.1" resolved "https://registry.yarnpkg.com/preact/-/preact-10.4.1.tgz#9b3ba020547673a231c6cf16f0fbaef0e8863431" @@ -7887,16 +7871,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.1.7, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.2: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== - dependencies: - is-core-module "^2.11.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -resolve@^1.21.0: +resolve@^1.1.7, resolve@^1.20.0, resolve@^1.21.0, resolve@^1.22.1, resolve@^1.22.2: version "1.22.4" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== @@ -8090,16 +8065,11 @@ secp256k1@^4.0.1, secp256k1@^4.0.2: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -semver@^6.0.0: +semver@^6.0.0, semver@^6.3.0: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - semver@^7.3.2, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" @@ -8733,7 +8703,7 @@ typescript-collections@^1.3.3: resolved "https://registry.yarnpkg.com/typescript-collections/-/typescript-collections-1.3.3.tgz#62d50d93c018c094d425eabee649f00ec5cc0fea" integrity sha512-7sI4e/bZijOzyURng88oOFZCISQPTHozfE2sUu5AviFYk5QV7fYGb6YiDl+vKjF/pICA354JImBImL9XJWUvdQ== -typescript@4.9.4, typescript@^4.6.2: +typescript@4.9.4: version "4.9.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== @@ -8743,7 +8713,7 @@ typescript@^3.9.10, typescript@^3.9.5, typescript@^3.9.7: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== -typescript@^4.2.3: +typescript@^4.2.3, typescript@^4.6.2: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==