17.05.2026 funny

This commit is contained in:
2026-05-17 12:41:47 +03:00
parent 253407abc3
commit 73d1fd9135
4 changed files with 37 additions and 20 deletions

View File

@@ -61,7 +61,7 @@ export function ConverterSection() {
>
КУПИТЬ
</button>
<button
{/* <button
type="button"
disabled
className={styles.tab}
@@ -69,7 +69,7 @@ export function ConverterSection() {
onClick={() => c.setMode('sell')}
>
ПРОДАТЬ
</button>
</button> */}
</div>
<div className={styles.field}>
@@ -141,7 +141,7 @@ export function ConverterSection() {
type="button"
className={styles.payBtn}
onClick={handlePay}
disabled={!rubTotal || isPending}
disabled={!rubTotal || isPending || !c.agreed}
>
{isPending ? 'Обработка...' : 'Оплатить'}
</button>

View File

@@ -7,14 +7,21 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
import { useNavigate } from 'react-router-dom'
import { logout } from '@features/auth/api/registrationApi'
import { AUTH_QUERY_KEY, useMe } from '@features/auth'
import { usePrices } from '@features/wallet'
import { tokenStore } from '@shared/api/tokenStore'
import { Notification } from '@shared/ui'
const TICKERS = [
{ symbol: 'BTC', price: '$66,916.00', change: 0.12, },
{ symbol: 'ETH', price: '$2,053.97', change: -0.12 },
{ symbol: 'SOL', price: '$163.84', change: -1.57 },
]
const TICKER_SYMBOLS = ['BTC', 'ETH', 'SOL']
const capitalize = (s: string) => (s ? s[0].toUpperCase() + s.slice(1).toLowerCase() : '')
function formatPrice(value: number | null | undefined): string {
if (value == null) return '$—'
if (value >= 1) {
return `$${value.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
}
return `$${value.toLocaleString('en-US', { minimumFractionDigits: 4, maximumFractionDigits: 6 })}`
}
export function WalletHeader() {
const [open, setOpen] = useState(false)
@@ -23,7 +30,10 @@ export function WalletHeader() {
const navigate = useNavigate()
const queryClient = useQueryClient()
const { data: me } = useMe()
const fullName = me ? `${me.first_name} ${me.middle_name}`.trim() : ''
const { data: prices } = usePrices(TICKER_SYMBOLS)
const fullName = me
? [me.first_name, me.middle_name].filter(Boolean).map(capitalize).join(' ')
: ''
const { mutate: logoutMutate } = useMutation({
mutationFn: logout,
@@ -57,13 +67,10 @@ export function WalletHeader() {
<img src={logo} alt="ЭКСА" />
</a>
<div className={styles.ticker}>
{TICKERS.map(({ symbol, price, change }) => (
{TICKER_SYMBOLS.map((symbol) => (
<div key={symbol} className={styles.tick}>
<b>{symbol}</b>
<span>{price}</span>
<span className={change >= 0 ? styles.up : styles.dn}>
{change >= 0 ? '+' : ''}{change}%
</span>
<span>{formatPrice(prices?.[symbol]?.usd)}</span>
</div>
))}
</div>