fix
This commit is contained in:
@@ -6,19 +6,18 @@ import { BalanceCard } from '@widgets/balance-card'
|
||||
import { TokenTable, AllTokenTable } from '@widgets/token-table'
|
||||
import { WalletHeader } from '@widgets/wallet-header'
|
||||
import { WalletChainTabs } from '@widgets/wallet-chain-tabs'
|
||||
import { Button } from '@shared/ui'
|
||||
import { Button, Spinner } from '@shared/ui'
|
||||
import styles from './WalletPage.module.css'
|
||||
|
||||
export function WalletPage() {
|
||||
const { data, isLoading, isError } = useMe()
|
||||
const { error: portfolioError } = usePortfolio()
|
||||
const { error: portfolioError, isLoading: isPortfolioLoading } = usePortfolio()
|
||||
const { mutate: createWallet, isPending } = useCreateWallet()
|
||||
const navigate = useNavigate()
|
||||
const { chain: chainParam } = useParams<{ chain?: string }>()
|
||||
|
||||
const noWallet = (portfolioError as { error?: string } | null)?.error?.includes('No wallets')
|
||||
|
||||
if (isLoading) return null
|
||||
if (isError) return <div className={styles.error}>Произошла ошибка. Попробуйте обновить страницу.</div>
|
||||
if (data && !data.kyc_verified) return <Navigate to={ROUTES.KYC} replace />
|
||||
|
||||
@@ -30,7 +29,9 @@ export function WalletPage() {
|
||||
<WalletHeader />
|
||||
<main className={styles.main}>
|
||||
<div className={styles.glow} />
|
||||
{noWallet ? (
|
||||
{isLoading || isPortfolioLoading ? (
|
||||
<Spinner fullscreen label="Загрузка" />
|
||||
) : noWallet ? (
|
||||
<div className={styles.noWallet}>
|
||||
<p>У вас пока нет кошелька. Создайте его, чтобы начать.</p>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user