fix console error

This commit is contained in:
tjs 2023-09-26 16:09:44 -04:00
parent 3f5224c119
commit 789772ef6b
4 changed files with 14 additions and 9 deletions

View File

@ -52,9 +52,15 @@ const TopBar = () => {
export default TopBar
const NavLink = (
{ active, path, text }: { active: boolean; path: string; text: string },
) => {
const NavLink = ({
active,
path,
text,
}: {
active: boolean
path: string
text: string
}) => {
return (
<Link href={path} shallow={true}>
<span

View File

@ -1,4 +1,4 @@
import { useMemo } from 'react'
import { useEffect, useMemo } from 'react'
import useStakeRates from './useStakeRates'
import useMangoGroup from './useMangoGroup'
import mangoStore from '@store/mangoStore'
@ -8,6 +8,7 @@ const set = mangoStore.getState().set
export default function useBankRates(selectedToken: string, leverage: number) {
const { data: stakeRates } = useStakeRates()
const { group } = useMangoGroup()
const estimatedMaxAPY = mangoStore((s) => s.estimatedMaxAPY.current)
const stakeBank = useMemo(() => {
return group?.banksMapByName.get(selectedToken)?.[0]
@ -39,7 +40,7 @@ export default function useBankRates(selectedToken: string, leverage: number) {
)
}, [borrowBankStakeRate, leverage, borrowBankBorrowRate])
const estimatedMaxAPY = useMemo(() => {
useEffect(() => {
set((s) => {
s.estimatedMaxAPY.current =
borrowBankStakeRate * 3 - borrowBankBorrowRate * 2

View File

@ -38,8 +38,6 @@ const fetchRates = async () => {
return rateData
}
fetchRates()
export default function useStakeRates() {
const response = useQuery(['stake-rates'], () => fetchRates(), {
cacheTime: 1000 * 60 * 5,

View File

@ -295,7 +295,7 @@ table p {
}
#range-slider-gradient .range-slider__thumb[data-upper] {
@apply border-th-primary-3 bg-th-primary-1 h-7 w-4 rounded-full border shadow-[inset_0_-3px_0px_rgba(0,0,0,0.15)];
@apply h-7 w-4 rounded-full border border-th-primary-3 bg-th-primary-1 shadow-[inset_0_-3px_0px_rgba(0,0,0,0.15)];
}
#range-slider-gradient .range-slider__range {
@ -372,7 +372,7 @@ table p {
}
.raised-button-primary {
@apply bg-th-primary-1 relative transition-none;
@apply relative bg-th-primary-1 transition-none;
box-shadow: 0 4px var(--primary-3);
}