Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance and bundle size #537

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bun.lockb
Binary file not shown.
32 changes: 0 additions & 32 deletions components/Icons/KeplrWalletIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions components/Icons/LeapSnapIcon.tsx

This file was deleted.

66 changes: 0 additions & 66 deletions components/Icons/LeapWalletIcon.tsx

This file was deleted.

35 changes: 0 additions & 35 deletions components/Icons/TerraExtensionIcon.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/Icons/TerraStationWalletIcon.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions components/Layout/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, ReactNode, useMemo } from 'react'
import { type PropsWithChildren, useMemo } from 'react'
import { isMobile } from 'react-device-detect'

import { useMediaQuery, Flex } from '@chakra-ui/react'
Expand All @@ -10,12 +10,13 @@ import Status from '../Status'
import MobileNotSupportedModal from '../Wallet/Modal/MobileNotSupportedModal'
import RadialGradient, { backgrounds } from './RadialGradient'

const AppLayout: FC<ReactNode> = ({ children }) => {
const AppLayout = ({ children }: PropsWithChildren) => {
const { chainId } = useRecoilValue(chainState)
const [isMobileView] = useMediaQuery('(max-width: 480px)')
const mobileBrowserLeap = window.leap && window.leap.mode === 'mobile-web'
const mobileBrowserKeplr = window.keplr && window.keplr.mode === 'mobile-web'
const background = useMemo(() => backgrounds[chainId], [chainId])

return (
<>
{isMobile && <div
Expand Down
13 changes: 7 additions & 6 deletions components/Pages/Bonding/Bonding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ModalCloseButton,
Stack,
} from '@chakra-ui/react'
import { useChain } from '@cosmos-kit/react-lite'
import { useChain, useConnect } from '@quirks/react'
import Loader from 'components/Loader'
import { TokenBalance } from 'components/Pages/Bonding/BondingActions/Bond'
import { BondedData } from 'components/Pages/Bonding/hooks/getBonded'
Expand All @@ -30,7 +30,8 @@ import { BondingData } from './types/BondingData'

const Bonding: FC = () => {
const { chainId, chainName, network, walletChainName } = useRecoilValue(chainState)
const { isWalletConnected, address } = useChain(walletChainName)
const { address } = useChain(walletChainName)
const { connected } = useConnect()

const data: BondingData[] = [
{
Expand Down Expand Up @@ -162,7 +163,7 @@ const Bonding: FC = () => {
setWithdrawableTokens(withdrawableInfos)
setData(data)
}, [
isWalletConnected,
connected,
isLoading,
unbondingRequests,
myBondedAssets,
Expand All @@ -171,7 +172,7 @@ const Bonding: FC = () => {
symbols,
])
const { isOpen, onOpen, onClose } = useDisclosure()
return <>{isLoading && isWalletConnected ?
return <>{isLoading && connected ?
<HStack
width="full"
alignContent="center"
Expand Down Expand Up @@ -236,7 +237,7 @@ const Bonding: FC = () => {
</ModalContent>
</Modal>
<BondingOverview
isWalletConnected={isWalletConnected}
isWalletConnected={connected}
data={updatedData}
whalePrice={whalePrice}
currentChainName={chainName}
Expand All @@ -248,7 +249,7 @@ const Bonding: FC = () => {
xl: 'end',
}}>
<RewardsComponent
isWalletConnected={isWalletConnected}
isWalletConnected={connected}
whalePrice={whalePrice}
currentEpoch={currentEpoch}
myTotalBonding={myTotalBonding}
Expand Down
8 changes: 4 additions & 4 deletions components/Pages/Bonding/BondingActions/Bond.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react'
import { Controller, useForm } from 'react-hook-form'

import { useMediaQuery, VStack } from '@chakra-ui/react'
import { useChain } from '@cosmos-kit/react-lite'
import { useConnect } from '@quirks/react'
import AssetInput from 'components/AssetInput/index'
import { useConfig } from 'components/Pages/Bonding/hooks/useDashboardData';
import { useRecoilState, useRecoilValue } from 'recoil'
Expand All @@ -24,8 +24,8 @@ export const Bond = ({ balances, tokenSymbols }) => {
const [isMobile] = useMediaQuery('(max-width: 720px)')
const [currentBondState, setCurrentBondState] =
useRecoilState<BondingTokenState>(bondingState)
const { network, chainId, walletChainName } = useRecoilValue(chainState)
const { isWalletConnected } = useChain(walletChainName)
const { network, chainId } = useRecoilValue(chainState)
const { connected } = useConnect()

const [tokenBalances, setTokenBalances] = useState<TokenBalance[]>(null)

Expand Down Expand Up @@ -60,7 +60,7 @@ export const Bond = ({ balances, tokenSymbols }) => {
denom: config.bonding_tokens[0].denom,
})
}
}, [isWalletConnected, config])
}, [connected, config])

const { control } = useForm({
mode: 'onChange',
Expand Down
Loading