14.05.2026 rip
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { WalletHeader } from '@widgets/wallet-header'
|
||||
import { SeedPhraseWidget } from '@widgets/seed-phrase'
|
||||
import { useRevealMnemonic } from '@features/wallet'
|
||||
import styles from './SeedPhrasePage.module.css'
|
||||
|
||||
const MOCK_WORDS = ['egg', 'phone', 'long', 'vibe', 'potato', 'soup', 'skirt', 'black', 'phase', 'word', 'num', 'cucumber']
|
||||
|
||||
export function SeedPhrasePage() {
|
||||
const { data: mnemonic, isLoading } = useRevealMnemonic()
|
||||
const words = mnemonic ? mnemonic.split(' ') : []
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<WalletHeader />
|
||||
<main className={styles.main}>
|
||||
<div className={styles.glow} />
|
||||
<SeedPhraseWidget words={MOCK_WORDS} />
|
||||
{!isLoading && <SeedPhraseWidget words={words} />}
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -35,6 +35,20 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.noWallet {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 24px;
|
||||
min-height: 300px;
|
||||
color: var(--text-primary);
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.glow {
|
||||
width: auto;
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
import { Navigate } from 'react-router-dom'
|
||||
import { Navigate, useNavigate } from 'react-router-dom'
|
||||
import { useMe } from '@features/auth'
|
||||
import { ROUTES } from '@shared/config/routes'
|
||||
import { usePortfolio, useCreateWallet } from '@features/wallet'
|
||||
import { BalanceCard } from '@widgets/balance-card'
|
||||
import { TokenTable } from '@widgets/token-table'
|
||||
import { WalletHeader } from '@widgets/wallet-header'
|
||||
import { Button } from '@shared/ui'
|
||||
import styles from './WalletPage.module.css'
|
||||
|
||||
export function WalletPage() {
|
||||
const { data, isLoading, isError } = useMe()
|
||||
const { error: portfolioError } = usePortfolio()
|
||||
const { mutate: createWallet, isPending } = useCreateWallet()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const noWallet = (portfolioError as any)?.error?.includes('No wallets')
|
||||
|
||||
if (isLoading) return null
|
||||
if (isError) return <div className={styles.error}>Произошла ошибка. Попробуйте обновить страницу.</div>
|
||||
@@ -18,8 +25,23 @@ export function WalletPage() {
|
||||
<WalletHeader />
|
||||
<main className={styles.main}>
|
||||
<div className={styles.glow} />
|
||||
<BalanceCard />
|
||||
<TokenTable />
|
||||
{noWallet ? (
|
||||
<div className={styles.noWallet}>
|
||||
<p>У вас пока нет кошелька. Создайте его, чтобы начать.</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => createWallet(undefined, { onSuccess: () => navigate(ROUTES.SEED_PHRASE) })}
|
||||
disabled={isPending}
|
||||
>
|
||||
{isPending ? 'Создание...' : 'Создать кошелёк'}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<BalanceCard />
|
||||
<TokenTable />
|
||||
</>
|
||||
)}
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user