Files
bee-dashboard/src/pages/info/WalletInfoCard.tsx
T
Ferenc Sárai cb5adfe031 feat: sync and update with all changes from solar-punk-ltd fork (#730)
* fix: swap error caused by invalid id and batchcount
* fix: enhance creation messages for admin drive and user drives
* fix: identity and wallet creation
* fix: asset preview types
* fix: fm search unicode text
* fix: feed identity and stamp usage
* fix: ui display changes
* fix: stamp buy and dilute
* fix: vite polyfill warning for stream
* fix: standard mode postage stamp purchase reserves incorrect size and duration
* fix: add syncing message for Bee node and update page state handling
* refactor: stamp depth and amount validation

---------

Co-authored-by: Balint Ujvari <balint.ujvari@solarpunk.buzz>
Co-authored-by: Bálint Ujvári <58116288+bosi95@users.noreply.github.com>
Co-authored-by: rolandlor <33499567+rolandlor@users.noreply.github.com>
2026-04-02 14:53:20 +02:00

53 lines
1.5 KiB
TypeScript

import { BeeModes } from '@ethersphere/bee-js'
import { useContext } from 'react'
import { useNavigate } from 'react-router'
import Upload from 'remixicon-react/UploadLineIcon'
import Wallet from 'remixicon-react/Wallet3LineIcon'
import Card from '../../components/Card'
import { CheckState, Context as BeeContext } from '../../providers/Bee'
import { ROUTES } from '../../routes'
export function WalletInfoCard() {
const { nodeInfo, walletBalance } = useContext(BeeContext)
const navigate = useNavigate()
let balanceText = 'Loading...'
if (walletBalance) {
balanceText = `${walletBalance.bzzBalance.toSignificantDigits(
4,
)} xBZZ | ${walletBalance.nativeTokenBalance.toSignificantDigits(4)} xDAI`
}
if (nodeInfo?.beeMode && [BeeModes.LIGHT, BeeModes.FULL, BeeModes.DEV].includes(nodeInfo.beeMode)) {
return (
<Card
buttonProps={{
iconType: Wallet,
children: 'Manage your wallet',
onClick: () => navigate(ROUTES.ACCOUNT_WALLET),
}}
icon={<Wallet />}
title={balanceText}
subtitle="Current wallet balance."
status={CheckState.OK}
/>
)
}
return (
<Card
buttonProps={{
iconType: Wallet,
children: 'Setup wallet',
onClick: () => navigate(ROUTES.TOP_UP),
}}
icon={<Upload />}
title="Your wallet is not setup."
subtitle="To share content on Swarm, please setup your wallet."
status={CheckState.ERROR}
/>
)
}