14.05.2026 rip

This commit is contained in:
2026-05-14 20:05:35 +03:00
parent 2de30fbde6
commit fcfdac87b4
6 changed files with 150 additions and 5 deletions

View File

@@ -12,13 +12,18 @@ interface Props {
onTokenChange: (token: Token) => void
onAmountChange?: (v: string) => void
onSetPercent?: (p: number) => void
selectedNetwork?: string
onNetworkChange?: (network: string) => void
}
const NETWORKS = ['BTC', 'ETH', 'BSC', 'TRX', 'SOL']
const PERCENTS = [25, 50, 100]
export function SwapCard({
mode, token, tokenOptions, amount, usd, slippage,
onTokenChange, onAmountChange, onSetPercent,
selectedNetwork, onNetworkChange,
}: Props) {
const [intPart, decPart] = amount.split('.')
@@ -42,7 +47,21 @@ export function SwapCard({
<div className={styles.card}>
<div className={styles.top}>
<div className={styles.label}>
<span className={styles.tag}>{mode === 'from' ? 'ОТ' : 'К'}</span>
{mode === 'from' ? (
<div className={styles.networkPills}>
{NETWORKS.map(n => (
<button
key={n}
className={`${styles.networkBtn} ${n === selectedNetwork ? styles.networkBtnActive : ''}`}
onClick={() => onNetworkChange?.(n)}
>
{n}
</button>
))}
</div>
) : (
<span className={styles.tag}>К</span>
)}
<span className={styles.network}>{token.network}</span>
</div>