17.05.2026 funny
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
||||||
<script type="module" crossorigin src="/assets/index-D2YX13P4.js"></script>
|
<script type="module" crossorigin src="/assets/index-BmeSmmZx.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-ChMX4U7G.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-ChMX4U7G.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
6
src/shared/lib/utils/truncateDecimals.ts
Normal file
6
src/shared/lib/utils/truncateDecimals.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export function truncateDecimals(value: string | number, maxDecimals = 8): string {
|
||||||
|
const s = typeof value === 'number' ? value.toString() : value
|
||||||
|
const dot = s.indexOf('.')
|
||||||
|
if (dot === -1) return s
|
||||||
|
return s.slice(0, dot + 1 + maxDecimals)
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { Token } from '../model/useSwapForm'
|
import type { Token } from '../model/useSwapForm'
|
||||||
|
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
|
||||||
import { TokenSelect } from './TokenSelect'
|
import { TokenSelect } from './TokenSelect'
|
||||||
import styles from './SwapCard.module.css'
|
import styles from './SwapCard.module.css'
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ export function SwapCard({
|
|||||||
<rect x="2" y="6" width="20" height="14" rx="3" />
|
<rect x="2" y="6" width="20" height="14" rx="3" />
|
||||||
<path d="M6 6V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2" />
|
<path d="M6 6V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2" />
|
||||||
</svg>
|
</svg>
|
||||||
{token.balance.toFixed(mode === 'from' ? 3 : 2)}
|
{truncateDecimals(token.balance, 8)}
|
||||||
{mode === 'from' && onSetPercent && (
|
{mode === 'from' && onSetPercent && (
|
||||||
<button className={styles.max} onClick={() => onSetPercent(100)}>МАКС</button>
|
<button className={styles.max} onClick={() => onSetPercent(100)}>МАКС</button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useWalletBalance } from '@features/wallet'
|
import { useWalletBalance } from '@features/wallet'
|
||||||
import type { Chain } from '@features/wallet'
|
import type { Chain } from '@features/wallet'
|
||||||
import { getCoinIcon } from '@shared/assets/coins'
|
import { getCoinIcon } from '@shared/assets/coins'
|
||||||
|
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
|
||||||
import { TOKENS, type Token } from './tokens'
|
import { TOKENS, type Token } from './tokens'
|
||||||
|
|
||||||
const NATIVE_TICKER: Record<Chain, string> = {
|
const NATIVE_TICKER: Record<Chain, string> = {
|
||||||
@@ -53,7 +54,7 @@ export function useChainTokenRows(chain: Chain) {
|
|||||||
color: nativeStatic?.color ?? DEFAULT_TOKEN_COLOR,
|
color: nativeStatic?.color ?? DEFAULT_TOKEN_COLOR,
|
||||||
price: formatPrice(data.native.usdPrice),
|
price: formatPrice(data.native.usdPrice),
|
||||||
change: 0,
|
change: 0,
|
||||||
bal: data.native.formatted,
|
bal: truncateDecimals(data.native.formatted),
|
||||||
usd: formatUsd(data.native.usdValue),
|
usd: formatUsd(data.native.usdValue),
|
||||||
fav: false,
|
fav: false,
|
||||||
}
|
}
|
||||||
@@ -67,7 +68,7 @@ export function useChainTokenRows(chain: Chain) {
|
|||||||
color: staticToken?.color ?? DEFAULT_TOKEN_COLOR,
|
color: staticToken?.color ?? DEFAULT_TOKEN_COLOR,
|
||||||
price: formatPrice(amount.usdPrice),
|
price: formatPrice(amount.usdPrice),
|
||||||
change: 0,
|
change: 0,
|
||||||
bal: amount.formatted,
|
bal: truncateDecimals(amount.formatted),
|
||||||
usd: formatUsd(amount.usdValue),
|
usd: formatUsd(amount.usdValue),
|
||||||
fav: false,
|
fav: false,
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user