Skip to content

Commit

Permalink
fix: remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Dec 9, 2022
1 parent 52af944 commit 98cc90b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 38 deletions.
4 changes: 2 additions & 2 deletions views/accounts/AddressDetailTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const AddressDetailTab = ({ address, addressData }: Props) => {
<AddressTransactionTab address={address} />
),
'token-transfer': <AddressTokenTransferTab address={address} />,
'tokens': <AddressTokenTab address={address} />,
'tokens': <AddressTokenTab addressData={addressData} address={address} />,
'internal-transactions': <AddressInternalTransactionTab address={address} />,
'balance-history': <AddressCoinBalanceTab address={address} />,
'balance-history': <AddressCoinBalanceTab addressData={addressData} address={address} />,
'code': isContract ? <ContractCodeTab address={address} /> : <div />
}}
></Tabs>
Expand Down
1 change: 0 additions & 1 deletion views/accounts/AddressOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ interface Props {

const AddressOverview = ({ address, addressData }: Props) => {
const addressCounter = useAddressCounter(address)
// const addressBalance = useAddressBalance(address)
const astraSummary = useAppSelector(getAstraSummary)

const isContract = addressData.type === AddressTypeEnum.Contract
Expand Down
27 changes: 0 additions & 27 deletions views/accounts/hook/useAddressBalance.ts

This file was deleted.

7 changes: 3 additions & 4 deletions views/accounts/tabs/AddressCoinBalanceTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ import usePaginationLite from 'hooks/usePaginationLite'
import { useState } from 'react'
import { getAstraSummary } from 'slices/commonSlice'
import { useAppSelector } from 'store/hooks'
import useAddressBalance from 'views/accounts/hook/useAddressBalance'
import useAddressCoinBalanceHistory from 'views/accounts/hook/useAddressCoinBalanceHistory'
import AddressBalanceHistory from './AddressBalanceHistory'
import AddressBalanceHistoryChart from './AddressBalanceHistoryChart'
import styles from './style.module.scss'

interface Props {
address: string
addressData: Address
}

const AddressCoinBalanceTab = ({ address }: Props) => {
const AddressCoinBalanceTab = ({ address, addressData }: Props) => {
const [currentPage, setPage] = useState(1)
const { currentParam, makeNextPage, makePrevPage } = usePaginationLite()
const { hasNextPage, nextPagePath, result } = useAddressCoinBalanceHistory(address, currentParam)
const addressBalance = useAddressBalance(address)
const astraSummary = useAppSelector(getAstraSummary)

const onPagingChange = (value: number) => {
Expand Down Expand Up @@ -71,7 +70,7 @@ const AddressCoinBalanceTab = ({ address }: Props) => {
{result?.map((item: AddressCoinBalanceHistory, index) => {
return (
<AddressBalanceHistory
addressBalance={addressBalance}
addressBalance={addressData.balance}
astraSummary={astraSummary}
key={item.blockNumber}
data={item}
Expand Down
7 changes: 3 additions & 4 deletions views/accounts/tabs/AddressTokenTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import { useState } from 'react'
import { getAstraSummary } from 'slices/commonSlice'
import { useAppSelector } from 'store/hooks'
import AmountUnit from 'views/accounts/AmountUnit'
import useAddressBalance from 'views/accounts/hook/useAddressBalance'
import useAddressToken from 'views/accounts/hook/useAddressToken'
import AddressTokenRow from './AddressTokenRow'
import styles from './style.module.scss'

interface Props {
address: string
addressData: Address
}

const AddressTokenTab = ({ address }: Props) => {
const AddressTokenTab = ({ address, addressData }: Props) => {
const [currentPage, setPage] = useState(1)
const { currentParam, makeNextPage, makePrevPage } = usePaginationLite()
const { hasNextPage, nextPagePath, result } = useAddressToken(address, currentParam)
const astraSummary = useAppSelector(getAstraSummary)
const addressBalance = useAddressBalance(address)

const onPagingChange = (value: number) => {
if (value < currentPage) {
Expand All @@ -34,7 +33,7 @@ const AddressTokenTab = ({ address }: Props) => {
setPage(value)
}

const netWorth = numeral((astraSummary?.last * parseInt(addressBalance?.balance)) / 10 ** 18).format('0,0.00000')
const netWorth = numeral((astraSummary?.last * parseInt(addressData?.balance)) / 10 ** 18).format('0,0.00000')

return (
<div className="margin-left-xl margin-right-xl">
Expand Down

0 comments on commit 98cc90b

Please sign in to comment.