17.05.2026 funny
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useMe } from '@features/auth'
|
||||
import { usePortfolio } from '@features/wallet'
|
||||
import { ROUTES } from '@shared/config/routes'
|
||||
import { Button, FormField } from '@shared/ui'
|
||||
import { WalletHeader } from '@widgets/wallet-header'
|
||||
import { ProfileAvatar, ProfileSection } from '@widgets/profile'
|
||||
@@ -6,11 +9,19 @@ import styles from './ProfilePage.module.css'
|
||||
|
||||
export function ProfilePage() {
|
||||
const { data } = useMe()
|
||||
const { data: portfolio, isLoading: isPortfolioLoading } = usePortfolio()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const capitalize = (s: string) => (s ? s[0].toUpperCase() + s.slice(1).toLowerCase() : '')
|
||||
const fullName = data
|
||||
? [data.last_name, data.first_name, data.middle_name].filter(Boolean).join(' ')
|
||||
? [data.last_name, data.first_name, data.middle_name].filter(Boolean).map(capitalize).join(' ')
|
||||
: ''
|
||||
|
||||
const userBalance =
|
||||
isPortfolioLoading || !portfolio || portfolio.totalUsd == null
|
||||
? '$—'
|
||||
: `$${portfolio.totalUsd.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<WalletHeader />
|
||||
@@ -24,8 +35,8 @@ export function ProfilePage() {
|
||||
<ProfileAvatar />
|
||||
<div className={styles.userInfo}>
|
||||
<span className={styles.userName}>{fullName}</span>
|
||||
<span className={styles.userBalance}>$245.00</span>
|
||||
<span className={styles.userBalanceRub}>≈ 22 340,50 ₽</span>
|
||||
<span className={styles.userBalance}>{userBalance}</span>
|
||||
{/* <span className={styles.userBalanceRub}>≈ 22 340,50 ₽</span> */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,7 +77,7 @@ export function ProfilePage() {
|
||||
<span className={styles.mnemonicIcon}>🔑</span>
|
||||
<span className={styles.mnemonicText}>Сид-фраза из 12 слов для восстановления кошелька</span>
|
||||
</div>
|
||||
<Button variant="danger">⚠ Показать мнемонику</Button>
|
||||
<Button variant="danger" onClick={() => navigate(ROUTES.SEED_PHRASE)}>⚠ Показать мнемонику</Button>
|
||||
</div>
|
||||
</ProfileSection>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user