feat: add loading state to wallet balance (#508)

* feat: add loading state to wallet balance

* refactor: extract the wallet balance into a provider
This commit is contained in:
Vojtech Simetka
2022-08-03 14:09:24 +02:00
committed by GitHub
parent a7bd94af82
commit b9c008f019
10 changed files with 150 additions and 59 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import ExpandableListItemKey from '../../components/ExpandableListItemKey'
import { HistoryHeader } from '../../components/HistoryHeader'
import { Loading } from '../../components/Loading'
import { SwarmButton } from '../../components/SwarmButton'
import { Context as BeeContext } from '../../providers/Bee'
import { Context as BalanceProvider } from '../../providers/WalletBalance'
import { Context as TopUpContext } from '../../providers/TopUp'
import { Context as SettingsContext } from '../../providers/Settings'
import { createGiftWallet } from '../../utils/desktop'
@@ -24,7 +24,7 @@ const GIFT_WALLET_FUND_BZZ_AMOUNT = Token.fromDecimal('0.5', 16)
export default function Index(): ReactElement {
const { giftWallets, addGiftWallet } = useContext(TopUpContext)
const { provider } = useContext(SettingsContext)
const { balance } = useContext(BeeContext)
const { balance } = useContext(BalanceProvider)
const [loading, setLoading] = useState(false)
const [balances, setBalances] = useState<ResolvedWallet[]>([])