feat: connected borrowModal to the new components (#190)

* feat: connected borrowModal to the new components

* fix: fixed the introduced issues

* Update src/components/Modals/BorrowModal.tsx

as suggested

Co-authored-by: Yusuf Seyrek <yusufseyrek@users.noreply.github.com>

* Update src/components/Modals/BorrowModal.tsx

Co-authored-by: Yusuf Seyrek <yusufseyrek@users.noreply.github.com>

* Update src/components/Modals/BorrowModal.tsx

Co-authored-by: Yusuf Seyrek <yusufseyrek@users.noreply.github.com>

---------

Co-authored-by: Yusuf Seyrek <yusufseyrek@users.noreply.github.com>
This commit is contained in:
Linkie Link 2023-05-11 12:23:08 +02:00 committed by GitHub
parent b410619bef
commit d5f3232b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 346 additions and 245 deletions

View File

@ -15,7 +15,7 @@
"@cosmjs/cosmwasm-stargate": "^0.30.1", "@cosmjs/cosmwasm-stargate": "^0.30.1",
"@cosmjs/stargate": "^0.30.1", "@cosmjs/stargate": "^0.30.1",
"@marsprotocol/wallet-connector": "^1.5.8", "@marsprotocol/wallet-connector": "^1.5.8",
"@sentry/nextjs": "^7.51.0", "@sentry/nextjs": "^7.51.2",
"@tanstack/react-table": "^8.9.1", "@tanstack/react-table": "^8.9.1",
"@tippyjs/react": "^4.2.6", "@tippyjs/react": "^4.2.6",
"bignumber.js": "^9.1.1", "bignumber.js": "^9.1.1",
@ -30,14 +30,14 @@
"react-spring": "^9.7.1", "react-spring": "^9.7.1",
"react-toastify": "^9.1.2", "react-toastify": "^9.1.2",
"react-use-clipboard": "^1.0.9", "react-use-clipboard": "^1.0.9",
"recharts": "^2.5.0", "recharts": "^2.6.0",
"swr": "^2.1.5", "swr": "^2.1.5",
"tailwind-scrollbar-hide": "^1.1.7", "tailwind-scrollbar-hide": "^1.1.7",
"zustand": "^4.3.8" "zustand": "^4.3.8"
}, },
"devDependencies": { "devDependencies": {
"@svgr/webpack": "^7.0.0", "@svgr/webpack": "^8.0.1",
"@types/node": "^20.1.0", "@types/node": "^20.1.1",
"@types/react": "18.2.6", "@types/react": "18.2.6",
"@types/react-dom": "18.2.4", "@types/react-dom": "18.2.4",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",

View File

@ -3,14 +3,15 @@ import BigNumber from 'bignumber.js'
import classNames from 'classnames' import classNames from 'classnames'
import DisplayCurrency from 'components/DisplayCurrency' import DisplayCurrency from 'components/DisplayCurrency'
import { FormattedNumber } from 'components/FormattedNumber'
import { ArrowRight } from 'components/Icons' import { ArrowRight } from 'components/Icons'
import Text from 'components/Text' import Text from 'components/Text'
import useStore from 'store' import useStore from 'store'
import { import {
calculateAccountApr, calculateAccountApr,
calculateAccountBalance,
calculateAccountBorrowRate, calculateAccountBorrowRate,
calculateAccountDebt, calculateAccountDebt,
calculateAccountDeposits,
calculateAccountPnL, calculateAccountPnL,
} from 'utils/accounts' } from 'utils/accounts'
import { BN } from 'utils/helpers' import { BN } from 'utils/helpers'
@ -25,12 +26,14 @@ interface ItemProps {
current: BigNumber current: BigNumber
change: BigNumber change: BigNumber
className?: string className?: string
isBadIncrease?: boolean
isPercentage?: boolean
} }
export default function AccountComposition(props: Props) { export default function AccountComposition(props: Props) {
const prices = useStore((s) => s.prices) const prices = useStore((s) => s.prices)
const balance = calculateAccountBalance(props.account, prices) const balance = calculateAccountDeposits(props.account, prices)
const balanceChange = props.change ? calculateAccountBalance(props.change, prices) : BN(0) const balanceChange = props.change ? calculateAccountDeposits(props.change, prices) : BN(0)
const debtBalance = calculateAccountDebt(props.account, prices) const debtBalance = calculateAccountDebt(props.account, prices)
const debtBalanceChange = props.change ? calculateAccountDebt(props.change, prices) : BN(0) const debtBalanceChange = props.change ? calculateAccountDebt(props.change, prices) : BN(0)
const pnL = calculateAccountPnL(props.account, prices) const pnL = calculateAccountPnL(props.account, prices)
@ -53,6 +56,7 @@ export default function AccountComposition(props: Props) {
current={debtBalance} current={debtBalance}
change={debtBalance.plus(debtBalanceChange)} change={debtBalance.plus(debtBalanceChange)}
className='pb-3' className='pb-3'
isBadIncrease
/> />
<Item <Item
title='Unrealized PnL' title='Unrealized PnL'
@ -60,15 +64,23 @@ export default function AccountComposition(props: Props) {
change={pnL.plus(pnLChange)} change={pnL.plus(pnLChange)}
className='border border-transparent border-y-white/20 py-3' className='border border-transparent border-y-white/20 py-3'
/> />
<Item title='APR' current={apr} change={apr.plus(aprChange)} className='py-3' /> <Item title='APR' current={apr} change={apr.plus(aprChange)} className='py-3' isPercentage />
<Item title='Borrow Rate' current={borrowRate} change={borrowRate.plus(borrowRateChange)} /> <Item
title='Borrow Rate'
current={borrowRate}
change={borrowRate.plus(borrowRateChange)}
isPercentage
isBadIncrease
/>
</div> </div>
) )
} }
function Item(props: ItemProps) { function Item(props: ItemProps) {
const baseCurrency = useStore((s) => s.baseCurrency) const baseCurrency = useStore((s) => s.baseCurrency)
const increase = props.current.isLessThan(props.change) const increase = props.isBadIncrease
? props.current.isGreaterThan(props.change)
: props.current.isLessThan(props.change)
return ( return (
<div className={classNames('flex w-full flex-nowrap', props.className)}> <div className={classNames('flex w-full flex-nowrap', props.className)}>
<div className='flex flex-shrink items-center'> <div className='flex flex-shrink items-center'>
@ -77,19 +89,35 @@ function Item(props: ItemProps) {
</Text> </Text>
</div> </div>
<div className='flex flex-grow items-center justify-end gap-2'> <div className='flex flex-grow items-center justify-end gap-2'>
<DisplayCurrency {props.isPercentage ? (
coin={{ amount: props.current.toString(), denom: baseCurrency.denom }} <FormattedNumber
className='text-sm' amount={props.current.toString()}
/> options={{ suffix: '%', minDecimals: 2, maxDecimals: 2 }}
className='text-sm'
/>
) : (
<DisplayCurrency
coin={{ amount: props.current.toString(), denom: baseCurrency.denom }}
className='text-sm'
/>
)}
{!props.current.isEqualTo(props.change) && ( {!props.current.isEqualTo(props.change) && (
<> <>
<span className={classNames('w-3', increase ? 'text-profit' : 'text-loss')}> <span className={classNames('w-3', increase ? 'text-profit' : 'text-loss')}>
<ArrowRight /> <ArrowRight />
</span> </span>
<DisplayCurrency {props.isPercentage ? (
coin={{ amount: props.change.toString(), denom: baseCurrency.denom }} <FormattedNumber
className={classNames('text-sm', increase ? 'text-profit' : 'text-loss')} amount={props.change.toString()}
/> options={{ suffix: '%', minDecimals: 2, maxDecimals: 2 }}
className={classNames('text-sm', increase ? 'text-profit' : 'text-loss')}
/>
) : (
<DisplayCurrency
coin={{ amount: props.change.toString(), denom: baseCurrency.denom }}
className={classNames('text-sm', increase ? 'text-profit' : 'text-loss')}
/>
)}
</> </>
)} )}
</div> </div>

View File

@ -13,7 +13,7 @@ import SwitchWithLabel from 'components/SwitchWithLabel'
import Text from 'components/Text' import Text from 'components/Text'
import useToggle from 'hooks/useToggle' import useToggle from 'hooks/useToggle'
import useStore from 'store' import useStore from 'store'
import { calculateAccountBalance } from 'utils/accounts' import { calculateAccountDeposits } from 'utils/accounts'
import { hardcodedFee } from 'utils/contants' import { hardcodedFee } from 'utils/contants'
import { BN } from 'utils/helpers' import { BN } from 'utils/helpers'
import useParams, { getRoute } from 'utils/route' import useParams, { getRoute } from 'utils/route'
@ -41,7 +41,7 @@ export default function AccountList(props: Props) {
const accountSelected = !!selectedAccount && !isNaN(Number(selectedAccount)) const accountSelected = !!selectedAccount && !isNaN(Number(selectedAccount))
const selectedAccountDetails = props.accounts.find((account) => account.id === selectedAccount) const selectedAccountDetails = props.accounts.find((account) => account.id === selectedAccount)
const selectedAccountBalance = selectedAccountDetails const selectedAccountBalance = selectedAccountDetails
? calculateAccountBalance(selectedAccountDetails, prices) ? calculateAccountDeposits(selectedAccountDetails, prices)
: BN(0) : BN(0)
async function deleteAccountHandler() { async function deleteAccountHandler() {
@ -69,7 +69,7 @@ export default function AccountList(props: Props) {
return ( return (
<div className='flex w-full flex-wrap p-4'> <div className='flex w-full flex-wrap p-4'>
{props.accounts.map((account) => { {props.accounts.map((account) => {
const positionBalance = calculateAccountBalance(account, prices) const positionBalance = calculateAccountDeposits(account, prices)
const isActive = selectedAccount === account.id const isActive = selectedAccount === account.id
return ( return (
<div key={account.id} id={`account-${account.id}`} className='w-full pt-4'> <div key={account.id} id={`account-${account.id}`} className='w-full pt-4'>

View File

@ -9,6 +9,7 @@ interface Props {
} }
async function Content(props: Props) { async function Content(props: Props) {
if (props.params.address === undefined) return null
const accounts = await getAccounts(props.params.address) const accounts = await getAccounts(props.params.address)
return <AccountMenuContent accounts={accounts} /> return <AccountMenuContent accounts={accounts} />
} }

View File

@ -8,7 +8,7 @@ import DisplayCurrency from 'components/DisplayCurrency'
import { ArrowChartLineUp } from 'components/Icons' import { ArrowChartLineUp } from 'components/Icons'
import Text from 'components/Text' import Text from 'components/Text'
import useStore from 'store' import useStore from 'store'
import { calculateAccountBalance } from 'utils/accounts' import { calculateAccountDeposits } from 'utils/accounts'
import { BN } from 'utils/helpers' import { BN } from 'utils/helpers'
interface Props { interface Props {
@ -19,7 +19,7 @@ interface Props {
export default function AccountSummary(props: Props) { export default function AccountSummary(props: Props) {
const prices = useStore((s) => s.prices) const prices = useStore((s) => s.prices)
const baseCurrency = useStore((s) => s.baseCurrency) const baseCurrency = useStore((s) => s.baseCurrency)
const accountBalance = props.account ? calculateAccountBalance(props.account, prices) : BN(0) const accountBalance = props.account ? calculateAccountDeposits(props.account, prices) : BN(0)
if (!props.account) return null if (!props.account) return null
return ( return (

View File

@ -1,10 +1,13 @@
import classNames from 'classnames'
interface Props { interface Props {
orientation?: 'horizontal' | 'vertical' orientation?: 'horizontal' | 'vertical'
className?: string
} }
export default function Divider(props: Props) { export default function Divider(props: Props) {
if (props.orientation === 'vertical') { if (props.orientation === 'vertical') {
return <div className='h-full w-[1px] bg-white/10'></div> return <div className={classNames('h-full w-[1px] bg-white/10', props.className)}></div>
} }
return <div className='h-[1px] w-full bg-white/10'></div> return <div className={classNames('h-[1px] w-full bg-white/10', props.className)}></div>
} }

View File

@ -1,5 +1,7 @@
'use client'
import Image from 'next/image' import Image from 'next/image'
import { useState } from 'react' import { useEffect, useState } from 'react'
import AccountSummary from 'components/Account/AccountSummary' import AccountSummary from 'components/Account/AccountSummary'
import { Button } from 'components/Button' import { Button } from 'components/Button'
@ -7,16 +9,17 @@ import Card from 'components/Card'
import Divider from 'components/Divider' import Divider from 'components/Divider'
import { ArrowRight } from 'components/Icons' import { ArrowRight } from 'components/Icons'
import Modal from 'components/Modal' import Modal from 'components/Modal'
import Select from 'components/Select/Select'
import Text from 'components/Text' import Text from 'components/Text'
import TitleAndSubCell from 'components/TitleAndSubCell' import TitleAndSubCell from 'components/TitleAndSubCell'
import TokenInputWithSlider from 'components/TokenInputWithSlider' import TokenInputWithSlider from 'components/TokenInputWithSlider'
import { ASSETS } from 'constants/assets' import { ASSETS } from 'constants/assets'
import useCurrentAccount from 'hooks/useCurrentAccount' import useCurrentAccount from 'hooks/useCurrentAccount'
import useToggle from 'hooks/useToggle'
import useStore from 'store' import useStore from 'store'
import { hardcodedFee } from 'utils/contants' import { hardcodedFee } from 'utils/contants'
import { formatPercent, formatValue } from 'utils/formatters' import { formatPercent, formatValue } from 'utils/formatters'
import { BN } from 'utils/helpers' import { BN } from 'utils/helpers'
import useParams from 'utils/route'
function getDebtAmount(modal: BorrowModal | null) { function getDebtAmount(modal: BorrowModal | null) {
if (!(modal?.marketData as BorrowAssetActive)?.debt) return '0' if (!(modal?.marketData as BorrowAssetActive)?.debt) return '0'
@ -29,46 +32,57 @@ function getAssetLogo(modal: BorrowModal | null) {
} }
export default function BorrowModal() { export default function BorrowModal() {
const params = useParams()
const currentAccount = useCurrentAccount() const currentAccount = useCurrentAccount()
const [percentage, setPercentage] = useState(0) const [percentage, setPercentage] = useState(0)
const [amount, setAmount] = useState(BN(0)) const [amount, setAmount] = useState(BN(0))
const [selectedAccount, setSelectedAccount] = useState(params.accountId) const [change, setChange] = useState<AccountChange | undefined>()
const [selectedAccount, setSelectedAccount] = useState(currentAccount)
const [isConfirming, setIsConfirming] = useToggle()
const modal = useStore((s) => s.borrowModal) const modal = useStore((s) => s.borrowModal)
const borrow = useStore((s) => s.borrow) const borrow = useStore((s) => s.borrow)
const repay = useStore((s) => s.repay) const repay = useStore((s) => s.repay)
const asset = modal?.asset ?? ASSETS[0] const asset = modal?.asset ?? ASSETS[0]
const accounts = useStore((s) => s.accounts)?.map((account) => { const accounts = useStore((s) => s.accounts)
return account.id const accountOptions = accounts?.map((account) => {
return { value: account.id, label: `Account ${account.id}` }
}) })
const isRepay = modal?.isRepay ?? false
function onAccountSelect(accountId: string) { function resetState() {
setSelectedAccount(accountId) setAmount(BN(0))
setPercentage(0)
setIsConfirming(false)
} }
function onConfirmClick() { async function onConfirmClick() {
if (!modal?.asset) return if (!modal?.asset) return
if (modal.isRepay) { setIsConfirming(true)
repay({ let result
if (isRepay) {
result = await repay({
fee: hardcodedFee, fee: hardcodedFee,
accountId: selectedAccount, accountId: selectedAccount?.id ?? '0',
coin: { denom: modal.asset.denom, amount: amount.toString() }, coin: { denom: modal.asset.denom, amount: amount.toString() },
accountBalance: percentage === 100, accountBalance: percentage === 100,
}) })
return } else {
result = await borrow({
fee: hardcodedFee,
accountId: selectedAccount?.id ?? '0',
coin: { denom: modal.asset.denom, amount: amount.toString() },
})
} }
borrow({ setIsConfirming(false)
fee: hardcodedFee, if (result) {
accountId: selectedAccount, resetState()
coin: { denom: modal.asset.denom, amount: amount.toString() }, useStore.setState({ borrowModal: null })
}) }
} }
function onClose() { function onClose() {
resetState()
useStore.setState({ borrowModal: null }) useStore.setState({ borrowModal: null })
setAmount(BN(0))
setPercentage(0)
} }
const liquidityAmountString = formatValue(modal?.marketData?.liquidity?.amount || 0, { const liquidityAmountString = formatValue(modal?.marketData?.liquidity?.amount || 0, {
@ -81,7 +95,31 @@ export default function BorrowModal() {
decimals: 6, decimals: 6,
}) })
const max = BN(modal?.isRepay ? getDebtAmount(modal) : liquidityAmountString) const max = BN(isRepay ? getDebtAmount(modal) : modal?.marketData?.liquidity?.amount ?? '0')
useEffect(() => {
if (!selectedAccount)
setSelectedAccount(currentAccount)
}, [selectedAccount, currentAccount])
useEffect(() => {
if (!modal?.asset) return
setChange({
deposits: [
{
amount: isRepay ? BN(0).minus(amount).toString() : BN(0).plus(amount).toString(),
denom: modal.asset.denom,
},
],
debts: [
{
amount: isRepay ? BN(0).minus(amount).toString() : BN(0).plus(amount).toString(),
denom: modal.asset.denom,
},
],
})
}, [amount, modal?.asset, currentAccount, isRepay])
return ( return (
<Modal <Modal
@ -91,7 +129,7 @@ export default function BorrowModal() {
<span className='flex items-center gap-4 px-4'> <span className='flex items-center gap-4 px-4'>
{getAssetLogo(modal)} {getAssetLogo(modal)}
<Text> <Text>
{modal?.isRepay ? 'Repay' : 'Borrow'} {asset.symbol} {isRepay ? 'Repay' : 'Borrow'} {asset.symbol}
</Text> </Text>
</span> </span>
} }
@ -119,39 +157,43 @@ export default function BorrowModal() {
</div> </div>
<div className='flex flex-grow items-start gap-6 p-6'> <div className='flex flex-grow items-start gap-6 p-6'>
<Card <Card
className='w-full bg-white/5 p-4' className='flex flex-grow bg-white/5 p-4'
contentClassName='gap-6 flex flex-col justify-between h-full' contentClassName='gap-6 flex flex-col justify-between h-full min-h-[380px]'
> >
<TokenInputWithSlider <div className='flex w-full flex-wrap'>
asset={asset} <TokenInputWithSlider
onChange={(val) => { asset={asset}
setAmount(val) onChange={setAmount}
}} amount={amount}
amount={amount} max={max}
max={max} className='w-full'
/> />
<Divider /> <Divider className='my-6' />
<Text size='lg'>{modal?.isRepay ? 'Repay for' : 'Borrow to'}</Text> <Text size='lg' className='pb-2'>
<select {isRepay ? 'Repay for' : 'Borrow to'}
name='account' </Text>
value={selectedAccount} <div className='relative flex w-full'>
onChange={(e) => onAccountSelect(e.target.value)} <Select
className='rounded-base border border-white/10 bg-white/5 p-4' options={accountOptions ?? []}
> title='Accounts'
{accounts?.map((account) => ( defaultValue={selectedAccount?.id}
<option key={account} value={account}> onChange={(account) => {
{account} accounts && setSelectedAccount(accounts?.find((a) => a.id === account))
</option> }}
))} className='w-full rounded-base border border-white/10 bg-white/5'
</select> />
</div>
</div>
<Button <Button
onClick={onConfirmClick} onClick={onConfirmClick}
className='w-full' className='w-full'
text={modal?.isRepay ? 'Repay' : 'Borrow'} showProgressIndicator={isConfirming}
disabled={amount.isZero()}
text={isRepay ? 'Repay' : 'Borrow'}
rightIcon={<ArrowRight />} rightIcon={<ArrowRight />}
/> />
</Card> </Card>
<AccountSummary account={currentAccount} /> <AccountSummary account={selectedAccount} change={change} />
</div> </div>
</Modal> </Modal>
) )

View File

@ -19,7 +19,7 @@ import { BN } from 'utils/helpers'
export default function FundAndWithdrawModal() { export default function FundAndWithdrawModal() {
const currentAccount = useCurrentAccount() const currentAccount = useCurrentAccount()
const modal = useStore((s) => s.fundAndWithdrawModal) const modal = useStore<string | null>((s) => s.fundAndWithdrawModal)
const baseCurrency = useStore((s) => s.baseCurrency) const baseCurrency = useStore((s) => s.baseCurrency)
const withdraw = useStore((s) => s.withdraw) const withdraw = useStore((s) => s.withdraw)
const deposit = useStore((s) => s.deposit) const deposit = useStore((s) => s.deposit)

View File

@ -1,6 +1,7 @@
import classNames from 'classnames' import classNames from 'classnames'
import { Suspense } from 'react' import { Suspense } from 'react'
import AccountComposition from 'components/Account/AccountComposition'
import Card from 'components/Card' import Card from 'components/Card'
import Loading from 'components/Loading' import Loading from 'components/Loading'
import Text from 'components/Text' import Text from 'components/Text'
@ -8,8 +9,6 @@ import { getAccounts } from 'utils/api'
async function Content(props: PageProps) { async function Content(props: PageProps) {
const address = props.params.address const address = props.params.address
const currentAccount = props.params.accountId
const hasAccount = !isNaN(Number(currentAccount))
const account = await getAccounts(address) const account = await getAccounts(address)
if (!address) { if (!address) {
@ -27,7 +26,9 @@ async function Content(props: PageProps) {
} }
return ( return (
<div className={classNames('grid grid-cols-1 gap-4', 'md:grid-cols-2', 'lg:grid-cols-3')}> <div
className={classNames('grid w-full grid-cols-1 gap-4', 'md:grid-cols-2', 'lg:grid-cols-3')}
>
{account.map((account: Account, index: number) => ( {account.map((account: Account, index: number) => (
<Card <Card
className='h-fit w-full bg-white/5' className='h-fit w-full bg-white/5'
@ -35,11 +36,7 @@ async function Content(props: PageProps) {
key={index} key={index}
contentClassName='px-4 py-6' contentClassName='px-4 py-6'
> >
{hasAccount && currentAccount === account.id ? ( <AccountComposition account={account} />
<Text size='sm'>Current Account</Text>
) : (
<Text size='sm'>Account details</Text>
)}
</Card> </Card>
))} ))}
</div> </div>
@ -49,16 +46,14 @@ async function Content(props: PageProps) {
function Fallback() { function Fallback() {
const cardCount = 3 const cardCount = 3
return ( return (
<div className={classNames('grid grid-cols-1 gap-4', 'md:grid-cols-2', 'lg:grid-cols-3')}> <div
className={classNames('grid w-full grid-cols-1 gap-4', 'md:grid-cols-2', 'lg:grid-cols-3')}
>
{Array.from({ length: cardCount }, (_, i) => ( {Array.from({ length: cardCount }, (_, i) => (
<Card <Card
key={i} key={i}
className='h-fit w-full bg-white/5' className='h-fit w-full bg-white/5'
title={ title='Account'
<>
Account <Loading className='ml-2 h-4 w-8' />
</>
}
contentClassName='px-4 py-6' contentClassName='px-4 py-6'
> >
<Loading className='h-4 w-50' /> <Loading className='h-4 w-50' />

View File

@ -73,13 +73,29 @@ export default function Option(props: Props) {
const label = props.label const label = props.label
if (props.isDisplay) { if (props.isDisplay) {
return <div className={classNames('block bg-white/10 p-3 hover:cursor-pointer')}>{label}</div> return (
<div
className={classNames(
'flex w-full items-center justify-between bg-white/10 p-3 hover:cursor-pointer',
)}
>
<span>{label}</span>
<span
className={classNames(
'inline-block w-2.5 transition-transform',
props.isClicked ? 'rotate-0' : '-rotate-90',
)}
>
<ChevronDown />
</span>
</div>
)
} }
return ( return (
<div <div
className={classNames( className={classNames(
'block p-3 hover:cursor-pointer hover:bg-white/20', 'block p-3 hover:cursor-pointer hover:bg-white/20',
props.isSelected && 'bg-white/10', props.isSelected && 'bg-white/10',
)} )}
onClick={() => props?.onClick && props.onClick(props.value)} onClick={() => props?.onClick && props.onClick(props.value)}

View File

@ -1,7 +1,7 @@
'use client' 'use client'
import classNames from 'classnames' import classNames from 'classnames'
import { useState } from 'react' import { useEffect, useState } from 'react'
import { ChevronDown } from 'components/Icons' import { ChevronDown } from 'components/Icons'
import Overlay from 'components/Overlay' import Overlay from 'components/Overlay'
@ -20,9 +20,8 @@ interface Props {
export default function Select(props: Props) { export default function Select(props: Props) {
const [value, setValue] = useState(props.defaultValue) const [value, setValue] = useState(props.defaultValue)
const selectedOption = value const selectedOption = value
? props.options.find((option) => option?.value || option?.denom === value) ? props.options.find((option) => option?.value === value || option?.denom === value)
: null : null
const [selected, setSelected] = useState<Option>(selectedOption) const [selected, setSelected] = useState<Option>(selectedOption)
@ -30,11 +29,25 @@ export default function Select(props: Props) {
const [showDropdown, setShowDropdown] = useToggle() const [showDropdown, setShowDropdown] = useToggle()
function handleChange(optionValue: string) { function handleChange(optionValue: string) {
setValue(optionValue) setValue(optionValue)
setSelected(props.options.find((option) => option?.value || option?.denom === optionValue)) setSelected(
props.options.find(
(option) => option?.value === optionValue || option?.denom === optionValue,
),
)
setShowDropdown(false) setShowDropdown(false)
props.onChange(optionValue) props.onChange(optionValue)
} }
useEffect(() => {
if (props.defaultValue && value === props.defaultValue && selected) return
setValue(props.defaultValue)
setSelected(
props.options.find(
(option) => option?.value === props.defaultValue || option?.denom === props.defaultValue,
),
)
}, [value, props.defaultValue, props.options])
return ( return (
<div <div
className={classNames( className={classNames(
@ -45,8 +58,8 @@ export default function Select(props: Props) {
role='select' role='select'
onClick={() => setShowDropdown(!showDropdown)} onClick={() => setShowDropdown(!showDropdown)}
> >
{selectedOption ? ( {selected ? (
<Option {...selectedOption} isClicked={showDropdown} isDisplay /> <Option {...selected} isClicked={showDropdown} isDisplay />
) : ( ) : (
<div <div
className={classNames('flex items-center gap-2 bg-white/10 p-3', 'hover:cursor-pointer')} className={classNames('flex items-center gap-2 bg-white/10 p-3', 'hover:cursor-pointer')}

View File

@ -1,5 +1,5 @@
import { Coin, StdFee } from '@cosmjs/stargate' import { Coin, StdFee } from '@cosmjs/stargate'
import { MsgExecuteContract, TxBroadcastResult } from '@marsprotocol/wallet-connector' import { MsgExecuteContract } from '@marsprotocol/wallet-connector'
import { isMobile } from 'react-device-detect' import { isMobile } from 'react-device-detect'
import { GetState, SetState } from 'zustand' import { GetState, SetState } from 'zustand'
@ -43,6 +43,8 @@ export default function createBroadcastSlice(
}, },
}) })
} }
return !!response.result
}, },
createAccount: async (options: { fee: StdFee }) => { createAccount: async (options: { fee: StdFee }) => {
const msg = { const msg = {

View File

@ -10,7 +10,7 @@ interface BroadcastSlice {
fee: StdFee fee: StdFee
funds?: Coin[] funds?: Coin[]
}) => Promise<BroadcastResult> }) => Promise<BroadcastResult>
borrow: (options: { fee: StdFee; accountId: string; coin: Coin }) => Promise<void> borrow: (options: { fee: StdFee; accountId: string; coin: Coin }) => Promise<boolean>
createAccount: (options: { fee: StdFee }) => Promise<string | null> createAccount: (options: { fee: StdFee }) => Promise<string | null>
deleteAccount: (options: { fee: StdFee; accountId: string }) => Promise<boolean> deleteAccount: (options: { fee: StdFee; accountId: string }) => Promise<boolean>
deposit: (options: { fee: StdFee; accountId: string; coin: Coin }) => Promise<boolean> deposit: (options: { fee: StdFee; accountId: string; coin: Coin }) => Promise<boolean>

295
yarn.lock
View File

@ -2981,26 +2981,26 @@
"@noble/hashes" "~1.2.0" "@noble/hashes" "~1.2.0"
"@scure/base" "~1.1.0" "@scure/base" "~1.1.0"
"@sentry-internal/tracing@7.51.0": "@sentry-internal/tracing@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.51.0.tgz#574bd62128aa98656a847332c627663975413fda" resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.51.2.tgz#17833047646426ca71445327018ffcb33506a699"
integrity sha512-mhXl4B02OQq6/vevjX04OchmQbxPRaLci9vTTPcPcIz/n+wkum29ze35gHcJsPJUesScjd0m19Xou3C8fNnZRA== integrity sha512-OBNZn7C4CyocmlSMUPfkY9ORgab346vTHu5kX35PgW5XR51VD2nO5iJCFbyFcsmmRWyCJcZzwMNARouc2V4V8A==
dependencies: dependencies:
"@sentry/core" "7.51.0" "@sentry/core" "7.51.2"
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/browser@7.51.0": "@sentry/browser@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.51.0.tgz#c132470ffa658ec5b4c0bdc44c9a72a479e6edb1" resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.51.2.tgz#c01758a54c613be45df58ab503805737256f51a4"
integrity sha512-SqaXM9qhGnSqEcdWEnzHKKkCLcMzE0cAc/Y6VQOttGjkP3KRW8INdWrN7F0ySBdy6BMar6ViDJKhB6cMKsuCIg== integrity sha512-FQFEaTFbvYHPQE2emFjNoGSy+jXplwzoM/XEUBRjrGo62lf8BhMvWnPeG3H3UWPgrWA1mq0amvHRwXUkwofk0g==
dependencies: dependencies:
"@sentry-internal/tracing" "7.51.0" "@sentry-internal/tracing" "7.51.2"
"@sentry/core" "7.51.0" "@sentry/core" "7.51.2"
"@sentry/replay" "7.51.0" "@sentry/replay" "7.51.2"
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/cli@^1.74.6": "@sentry/cli@^1.74.6":
@ -3015,88 +3015,88 @@
proxy-from-env "^1.1.0" proxy-from-env "^1.1.0"
which "^2.0.2" which "^2.0.2"
"@sentry/core@7.51.0": "@sentry/core@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.51.0.tgz#f9949d129ea2683bf70edccacdfeafb7f492260c" resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.51.2.tgz#f2c938de334f9bf26f4416079168275832423964"
integrity sha512-GgYwlXU8Y1kDEHsJO1Bmr2CNan5BzoNRR0TDBmxRgI/DgTNNSYrXeFDELgPi9/p/0XENeuttzDZ3iYd1nF7meA== integrity sha512-p8ZiSBxpKe+rkXDMEcgmdoyIHM/1bhpINLZUFPiFH8vzomEr7sgnwRhyrU8y/ADnkPeNg/2YF3QpDpk0OgZJUA==
dependencies: dependencies:
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/integrations@7.51.0": "@sentry/integrations@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.51.0.tgz#b1f3f84e5c1dc853722057dab42af5be37107984" resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.51.2.tgz#fce58b9ced601c7f93344b508c67c69a9c883f3d"
integrity sha512-xmWUKZyRDfl8tRsZWDRwxeXGwsvlJytQSYnJMPwohUq+VKs1KAarsuIxWQQMosNOvCYaio8VLfMxureqk2Wb/w== integrity sha512-ZnSptbuDQOoQ13mFX9vvLDfXlbMGjenW2fMIssi9+08B7fD6qxmetkYnWmBK+oEipjoGA//0240Fj8FUvZr0Qg==
dependencies: dependencies:
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
localforage "^1.8.1" localforage "^1.8.1"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/nextjs@^7.51.0": "@sentry/nextjs@^7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.51.0.tgz#8efbfd47e1a7540cabfbf5e8093f541eea3acadf" resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.51.2.tgz#721718a4748b8ef242c07674097176be2299f273"
integrity sha512-ZeZvXjfI/7Ik/w2joGWFBll6klEciKiFDNrwq5hqA3e1/xDV9rJNAF9DkKAVzA6wy0DP7o2npaKKAhC6iejzCw== integrity sha512-qZb7meUwZFD69VK71QafTvnlF1LZn0vobqJ95hK8EyyQP6JiSZoOwGo4PEf6mlrr3vNQPuNHKkixDyno3DlP1g==
dependencies: dependencies:
"@rollup/plugin-commonjs" "24.0.0" "@rollup/plugin-commonjs" "24.0.0"
"@sentry/core" "7.51.0" "@sentry/core" "7.51.2"
"@sentry/integrations" "7.51.0" "@sentry/integrations" "7.51.2"
"@sentry/node" "7.51.0" "@sentry/node" "7.51.2"
"@sentry/react" "7.51.0" "@sentry/react" "7.51.2"
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
"@sentry/webpack-plugin" "1.20.0" "@sentry/webpack-plugin" "1.20.0"
chalk "3.0.0" chalk "3.0.0"
rollup "2.78.0" rollup "2.78.0"
stacktrace-parser "^0.1.10" stacktrace-parser "^0.1.10"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/node@7.51.0": "@sentry/node@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.51.0.tgz#3e9caf14d88a575844f423f682646bfd4974cd22" resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.51.2.tgz#3aa8177699a66265081f711f73652b5e37d0dc53"
integrity sha512-UHJ0yN3I8hSrythr3/KPewh+xLIdjF6AU+BW3bgsP0ZtztrftrQk9+XnWRIX0p6ZstzoP4F3arkJIXkWfOk5Pg== integrity sha512-qtZ2xNVR0ZW+OZWb0Xw0Cdh2QJXOJkXjK84CGC2P4Y6jWrt+GVvwMANPItLT6mAh+ITszTJ5Gk5HHFRpYme5EA==
dependencies: dependencies:
"@sentry-internal/tracing" "7.51.0" "@sentry-internal/tracing" "7.51.2"
"@sentry/core" "7.51.0" "@sentry/core" "7.51.2"
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
cookie "^0.4.1" cookie "^0.4.1"
https-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0"
lru_map "^0.3.3" lru_map "^0.3.3"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/react@7.51.0": "@sentry/react@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.51.0.tgz#a6949cfcfc96b856fa21c19cf458e9d60200b81e" resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.51.2.tgz#8d09c8358a920d06225f879b0291867175d4f045"
integrity sha512-w9fHVBbv4l3tGFa9YCV1m2ngUTnYxM/r6pO2Q8N9sjeWAk74sREm7fUjBJI24sdJFQJj0KhHNg0I1ZOA+uITyQ== integrity sha512-NiTbpiRaF7/2YnRONLqn8/bxT5UG+JN5MrR606ipxsl3ejF376VMLCHVvju6gJNw8mkrErEMkfxK+gGYqOdLEA==
dependencies: dependencies:
"@sentry/browser" "7.51.0" "@sentry/browser" "7.51.2"
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
hoist-non-react-statics "^3.3.2" hoist-non-react-statics "^3.3.2"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/replay@7.51.0": "@sentry/replay@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.51.0.tgz#d37f19d9201f63094f665ed7813c1c82b3be8c30" resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.51.2.tgz#1f54e92b472ab87dfdb4e8cd6b8c8252600fe7b0"
integrity sha512-3jv+chhhlOVFjPKYJOEJy+J+9yTUEHxybZ0tTwGZYOJp9T8HdO21L6NjYk5b9wEqJonhZHp1BiQnzG82NLDkSQ== integrity sha512-W8YnSxkK9LTUXDaYciM7Hn87u57AX9qvH8jGcxZZnvpKqHlDXOpSV8LRtBkARsTwgLgswROImSifY0ic0lyCWg==
dependencies: dependencies:
"@sentry/core" "7.51.0" "@sentry/core" "7.51.2"
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
"@sentry/utils" "7.51.0" "@sentry/utils" "7.51.2"
"@sentry/types@7.51.0": "@sentry/types@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.51.0.tgz#78ea083c329b29deda0a4f19cda39d89ac8c1e38" resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.51.2.tgz#cb742f374d9549195f62c462c915adeafed31d65"
integrity sha512-8REzzY0DslDryp6Yxj+tJ4NkXFHulLW9k8dgZV2Qo/0rBDMKir8g0IHYeN8ZBcnWrx2F+6rQb6uN6BjyLZY7Dg== integrity sha512-/hLnZVrcK7G5BQoD/60u9Qak8c9AvwV8za8TtYPJDUeW59GrqnqOkFji7RVhI7oH1OX4iBxV+9pAKzfYE6A6SA==
"@sentry/utils@7.51.0": "@sentry/utils@7.51.2":
version "7.51.0" version "7.51.2"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.51.0.tgz#5720437fd319a676bd634a90189a636719894cdb" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.51.2.tgz#2a52ac2cfb00ffd128248981279c0a561b39eccb"
integrity sha512-y5zq4IfZDCm6cg0EQJMghUM4YjZToFni7J5OKopLXKVtc9YtRtkYoFuFqEWm4HBuBwplreiS/KkDQgWn3FVn7A== integrity sha512-EcjBU7qG4IG+DpIPvdgIBcdIofROMawKoRUNKraeKzH/waEYH9DzCaqp/mzc5/rPBhpDB4BShX9xDDSeH+8c0A==
dependencies: dependencies:
"@sentry/types" "7.51.0" "@sentry/types" "7.51.2"
tslib "^1.9.3" tslib "^1.9.3"
"@sentry/webpack-plugin@1.20.0": "@sentry/webpack-plugin@1.20.0":
@ -3126,110 +3126,111 @@
dependencies: dependencies:
"@sinonjs/commons" "^2.0.0" "@sinonjs/commons" "^2.0.0"
"@svgr/babel-plugin-add-jsx-attribute@^7.0.0": "@svgr/babel-plugin-add-jsx-attribute@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-7.0.0.tgz#80856c1b7a3b7422d232f6e079f0beb90c4a13e9" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz#4001f5d5dd87fa13303e36ee106e3ff3a7eb8b22"
integrity sha512-khWbXesWIP9v8HuKCl2NU2HNAyqpSQ/vkIl36Nbn4HIwEYSRWL0H7Gs6idJdha2DkpFDWlsqMELvoCE8lfFY6Q== integrity sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==
"@svgr/babel-plugin-remove-jsx-attribute@^7.0.0": "@svgr/babel-plugin-remove-jsx-attribute@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-7.0.0.tgz#91da77a009dc38e8d30da45d9b62ef8736f2d90a" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz#69177f7937233caca3a1afb051906698f2f59186"
integrity sha512-iiZaIvb3H/c7d3TH2HBeK91uI2rMhZNwnsIrvd7ZwGLkFw6mmunOCoVnjdYua662MqGFxlN9xTq4fv9hgR4VXQ== integrity sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==
"@svgr/babel-plugin-remove-jsx-empty-expression@^7.0.0": "@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-7.0.0.tgz#5154ff1213509e36ab315974c8c2fd48dafb827b" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz#c2c48104cfd7dcd557f373b70a56e9e3bdae1d44"
integrity sha512-sQQmyo+qegBx8DfFc04PFmIO1FP1MHI1/QEpzcIcclo5OAISsOJPW76ZIs0bDyO/DBSJEa/tDa1W26pVtt0FRw== integrity sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==
"@svgr/babel-plugin-replace-jsx-attribute-value@^7.0.0": "@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-7.0.0.tgz#7e72f44ee57fdbcb02fb0d4a7629466c5242725e" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz#8fbb6b2e91fa26ac5d4aa25c6b6e4f20f9c0ae27"
integrity sha512-i6MaAqIZXDOJeikJuzocByBf8zO+meLwfQ/qMHIjCcvpnfvWf82PFvredEZElErB5glQFJa2KVKk8N2xV6tRRA== integrity sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==
"@svgr/babel-plugin-svg-dynamic-title@^7.0.0": "@svgr/babel-plugin-svg-dynamic-title@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-7.0.0.tgz#8caf0449c678ea29be756b89960b2b16c9f33f00" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz#1d5ba1d281363fc0f2f29a60d6d936f9bbc657b0"
integrity sha512-BoVSh6ge3SLLpKC0pmmN9DFlqgFy4NxNgdZNLPNJWBUU7TQpDWeBuyVuDW88iXydb5Cv0ReC+ffa5h3VrKfk1w== integrity sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==
"@svgr/babel-plugin-svg-em-dimensions@^7.0.0": "@svgr/babel-plugin-svg-em-dimensions@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-7.0.0.tgz#4db6b5af6d29e93db236b1a013fa953754071d41" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz#35e08df300ea8b1d41cb8f62309c241b0369e501"
integrity sha512-tNDcBa+hYn0gO+GkP/AuNKdVtMufVhU9fdzu+vUQsR18RIJ9RWe7h/pSBY338RO08wArntwbDk5WhQBmhf2PaA== integrity sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==
"@svgr/babel-plugin-transform-react-native-svg@^7.0.0": "@svgr/babel-plugin-transform-react-native-svg@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-7.0.0.tgz#236995e58b5e36ff06365d5310509ce5391aeec9" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.0.0.tgz#023cd0895b98521f566060d6bb92100b9fee3775"
integrity sha512-qw54u8ljCJYL2KtBOjI5z7Nzg8LnSvQOP5hPKj77H4VQL4+HdKbAT5pnkkZLmHKYwzsIHSYKXxHouD8zZamCFQ== integrity sha512-UKrY3860AQICgH7g+6h2zkoxeVEPLYwX/uAjmqo4PIq2FIHppwhIqZstIyTz0ZtlwreKR41O3W3BzsBBiJV2Aw==
"@svgr/babel-plugin-transform-svg-component@^7.0.0": "@svgr/babel-plugin-transform-svg-component@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-7.0.0.tgz#a9b62730acf10d22a2aa57e0f701c0ecbc270430" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz#013b4bfca88779711f0ed2739f3f7efcefcf4f7e"
integrity sha512-CcFECkDj98daOg9jE3Bh3uyD9kzevCAnZ+UtzG6+BQG/jOQ2OA3jHnX6iG4G1MCJkUQFnUvEv33NvQfqrb/F3A== integrity sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==
"@svgr/babel-preset@^7.0.0": "@svgr/babel-preset@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-7.0.0.tgz#55aaca4cec2ff6515a571715b6b6fa98675b66d9" resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-8.0.0.tgz#6d78100b3b6daf11c940b82d5bd8c3164b9c6ad9"
integrity sha512-EX/NHeFa30j5UjldQGVQikuuQNHUdGmbh9kEpBKofGUtF0GUPJ4T4rhoYiqDAOmBOxojyot36JIFiDUHUK1ilQ== integrity sha512-KLcjiZychInVrhs86OvcYPLTFu9L5XV2vj0XAaE1HwE3J3jLmIzRY8ttdeAg/iFyp8nhavJpafpDZTt+1LIpkQ==
dependencies: dependencies:
"@svgr/babel-plugin-add-jsx-attribute" "^7.0.0" "@svgr/babel-plugin-add-jsx-attribute" "8.0.0"
"@svgr/babel-plugin-remove-jsx-attribute" "^7.0.0" "@svgr/babel-plugin-remove-jsx-attribute" "8.0.0"
"@svgr/babel-plugin-remove-jsx-empty-expression" "^7.0.0" "@svgr/babel-plugin-remove-jsx-empty-expression" "8.0.0"
"@svgr/babel-plugin-replace-jsx-attribute-value" "^7.0.0" "@svgr/babel-plugin-replace-jsx-attribute-value" "8.0.0"
"@svgr/babel-plugin-svg-dynamic-title" "^7.0.0" "@svgr/babel-plugin-svg-dynamic-title" "8.0.0"
"@svgr/babel-plugin-svg-em-dimensions" "^7.0.0" "@svgr/babel-plugin-svg-em-dimensions" "8.0.0"
"@svgr/babel-plugin-transform-react-native-svg" "^7.0.0" "@svgr/babel-plugin-transform-react-native-svg" "8.0.0"
"@svgr/babel-plugin-transform-svg-component" "^7.0.0" "@svgr/babel-plugin-transform-svg-component" "8.0.0"
"@svgr/core@^7.0.0": "@svgr/core@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/core/-/core-7.0.0.tgz#def863d2670c682615583c80b408e83c095c2233" resolved "https://registry.yarnpkg.com/@svgr/core/-/core-8.0.0.tgz#e96829cdb0473345d5671568282ee0736e86ef12"
integrity sha512-ztAoxkaKhRVloa3XydohgQQCb0/8x9T63yXovpmHzKMkHO6pkjdsIAWKOS4bE95P/2quVh1NtjSKlMRNzSBffw== integrity sha512-aJKtc+Pie/rFYsVH/unSkDaZGvEeylNv/s2cP+ta9/rYWxRVvoV/S4Qw65Kmrtah4CBK5PM6ISH9qUH7IJQCng==
dependencies: dependencies:
"@babel/core" "^7.21.3" "@babel/core" "^7.21.3"
"@svgr/babel-preset" "^7.0.0" "@svgr/babel-preset" "8.0.0"
camelcase "^6.2.0" camelcase "^6.2.0"
cosmiconfig "^8.1.3" cosmiconfig "^8.1.3"
snake-case "^3.0.4"
"@svgr/hast-util-to-babel-ast@^7.0.0": "@svgr/hast-util-to-babel-ast@8.0.0":
version "7.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-7.0.0.tgz#d457dfbe74ebc1e5a6daf97ded49e9576a3a00cf" resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz#6952fd9ce0f470e1aded293b792a2705faf4ffd4"
integrity sha512-42Ej9sDDEmsJKjrfQ1PHmiDiHagh/u9AHO9QWbeNx4KmD9yS5d1XHmXUNINfUcykAU+4431Cn+k6Vn5mWBYimQ== integrity sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==
dependencies: dependencies:
"@babel/types" "^7.21.3" "@babel/types" "^7.21.3"
entities "^4.4.0" entities "^4.4.0"
"@svgr/plugin-jsx@^7.0.0": "@svgr/plugin-jsx@8.0.1":
version "7.0.0" version "8.0.1"
resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-7.0.0.tgz#b9e0c7d05bc890d70163ac0490ba8c41f1afab90" resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-8.0.1.tgz#b9495e06062cc0cac0e035751b69471ee328236b"
integrity sha512-SWlTpPQmBUtLKxXWgpv8syzqIU8XgFRvyhfkam2So8b3BE0OS0HPe5UfmlJ2KIC+a7dpuuYovPR2WAQuSyMoPw== integrity sha512-bfCFb+4ZsM3UuKP2t7KmDwn6YV8qVn9HIQJmau6xeQb/iV65Rpi7NBNBWA2hcCd4GKoCqG8hpaaDk5FDR0eH+g==
dependencies: dependencies:
"@babel/core" "^7.21.3" "@babel/core" "^7.21.3"
"@svgr/babel-preset" "^7.0.0" "@svgr/babel-preset" "8.0.0"
"@svgr/hast-util-to-babel-ast" "^7.0.0" "@svgr/hast-util-to-babel-ast" "8.0.0"
svg-parser "^2.0.4" svg-parser "^2.0.4"
"@svgr/plugin-svgo@^7.0.0": "@svgr/plugin-svgo@8.0.1":
version "7.0.0" version "8.0.1"
resolved "https://registry.yarnpkg.com/@svgr/plugin-svgo/-/plugin-svgo-7.0.0.tgz#325e87cede7bf7106a8099ceaeaa5906176c4bca" resolved "https://registry.yarnpkg.com/@svgr/plugin-svgo/-/plugin-svgo-8.0.1.tgz#df0199313fdc88c3d7cd8e0dff16695e9718548c"
integrity sha512-263znzlu3qTKj71/ot5G9l2vpL4CW+pr2IexBFIwwB+fRAXE9Xnw2rUFgE6P4+37N9siOuC4lKkgBfUCOLFRKQ== integrity sha512-29OJ1QmJgnohQHDAgAuY2h21xWD6TZiXji+hnx+W635RiXTAlHTbjrZDktfqzkN0bOeQEtNe+xgq73/XeWFfSg==
dependencies: dependencies:
cosmiconfig "^8.1.3" cosmiconfig "^8.1.3"
deepmerge "^4.3.1" deepmerge "^4.3.1"
svgo "^3.0.2" svgo "^3.0.2"
"@svgr/webpack@^7.0.0": "@svgr/webpack@^8.0.1":
version "7.0.0" version "8.0.1"
resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-7.0.0.tgz#609ba724a380fd121bb0bc4667b7f213f4021ea9" resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-8.0.1.tgz#a0e4a711daae347b515335449d198a275b3ab1e4"
integrity sha512-XWzIhLTr5WYns/cNFXpXrmFy+LFf2xp60VnNUBZCpM1CGTx47FCDuUj2DQjxirMf2L6CP2jTRELK8ef01TecFQ== integrity sha512-zSoeKcbCmfMXjA11uDuCJb+1LWNb3vy6Qw/VHj0Nfcl3UuqwuoZWknHsBIhCWvi4wU9vPui3aq054qjVyZqY4A==
dependencies: dependencies:
"@babel/core" "^7.21.3" "@babel/core" "^7.21.3"
"@babel/plugin-transform-react-constant-elements" "^7.21.3" "@babel/plugin-transform-react-constant-elements" "^7.21.3"
"@babel/preset-env" "^7.20.2" "@babel/preset-env" "^7.20.2"
"@babel/preset-react" "^7.18.6" "@babel/preset-react" "^7.18.6"
"@babel/preset-typescript" "^7.21.0" "@babel/preset-typescript" "^7.21.0"
"@svgr/core" "^7.0.0" "@svgr/core" "8.0.0"
"@svgr/plugin-jsx" "^7.0.0" "@svgr/plugin-jsx" "8.0.1"
"@svgr/plugin-svgo" "^7.0.0" "@svgr/plugin-svgo" "8.0.1"
"@swc/helpers@0.5.1": "@swc/helpers@0.5.1":
version "0.5.1" version "0.5.1"
@ -3524,10 +3525,10 @@
resolved "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz" resolved "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz"
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==
"@types/node@^20.1.0": "@types/node@^20.1.1":
version "20.1.0" version "20.1.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.0.tgz#258805edc37c327cf706e64c6957f241ca4c4c20" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.1.tgz#afc492e8dbe7f672dd3a13674823522b467a45ad"
integrity sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A== integrity sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A==
"@types/pbkdf2@^3.0.0": "@types/pbkdf2@^3.0.0":
version "3.1.0" version "3.1.0"
@ -8315,10 +8316,10 @@ recharts-scale@^0.4.4:
dependencies: dependencies:
decimal.js-light "^2.4.1" decimal.js-light "^2.4.1"
recharts@^2.5.0: recharts@^2.6.0:
version "2.5.0" version "2.6.0"
resolved "https://registry.yarnpkg.com/recharts/-/recharts-2.5.0.tgz#34452852509099502690f9d2a72bde1d4cd65648" resolved "https://registry.yarnpkg.com/recharts/-/recharts-2.6.0.tgz#11f38f4aa37dbae69294e0845d407b853265987e"
integrity sha512-0EQYz3iA18r1Uq8VqGZ4dABW52AKBnio37kJgnztIqprELJXpOEsa0SzkqU1vjAhpCXCv52Dx1hiL9119xsqsQ== integrity sha512-Y6PgYMmqAxj2cw1FClB1ldcn1xqjJIFysDNGZoyn4faVqNFP4Vx94fDqUz+OgpdTU3APMwIpu/JTVPPGGRUOGQ==
dependencies: dependencies:
classnames "^2.2.5" classnames "^2.2.5"
eventemitter3 "^4.0.1" eventemitter3 "^4.0.1"