14.05.2026 rip
This commit is contained in:
@@ -177,6 +177,11 @@ export interface RelayQuoteResponse {
|
||||
amountUsd: string
|
||||
}
|
||||
}
|
||||
fees: {
|
||||
gas: {
|
||||
amountUsd: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function getTokensList(): Promise<TokenInfo[]> {
|
||||
|
||||
@@ -7,7 +7,7 @@ interface Props {
|
||||
token: Token
|
||||
tokenOptions: Token[]
|
||||
amount: string
|
||||
usd: string
|
||||
usd?: string
|
||||
slippage?: string
|
||||
onTokenChange: (token: Token) => void
|
||||
onAmountChange?: (v: string) => void
|
||||
@@ -84,7 +84,7 @@ export function SwapCard({
|
||||
) : (
|
||||
<div className={styles.display}>
|
||||
<span className={styles.int}>{intPart}</span>
|
||||
<span className={styles.dec}>.{decPart}</span>
|
||||
{decPart && <span className={styles.dec}>.{decPart}</span>}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -95,10 +95,11 @@ export function SwapCard({
|
||||
</div>
|
||||
|
||||
<div className={styles.bottom}>
|
||||
{usd && (
|
||||
<span className={styles.usd}>
|
||||
≈ ${usd}
|
||||
{slippage && <span className={styles.neg}> ({slippage})</span>}
|
||||
</span>
|
||||
)}
|
||||
<span className={styles.balance}>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--text-secondary)" strokeWidth="2">
|
||||
<rect x="2" y="6" width="20" height="14" rx="3" />
|
||||
|
||||
@@ -65,8 +65,9 @@ export function SwapForm() {
|
||||
|
||||
const { data: quoteData } = useRelayQuote(quotePayload)
|
||||
|
||||
const displayToAmount = quoteData?.details.currencyOut.amountFormatted ?? toAmount
|
||||
const displayToUsd = quoteData?.details.currencyOut.amountUsd ?? toUsd
|
||||
const displayToAmount = quoteData?.details.currencyOut.amountFormatted ?? '0'
|
||||
const displayToUsd = quoteData?.details.currencyOut.amountUsd
|
||||
const gasFee = quoteData?.fees.gas.amountUsd
|
||||
|
||||
return (
|
||||
<div className={styles.form}>
|
||||
@@ -91,7 +92,6 @@ export function SwapForm() {
|
||||
tokenOptions={tokenOptions}
|
||||
amount={displayToAmount}
|
||||
usd={displayToUsd}
|
||||
slippage="−0.16%"
|
||||
onTokenChange={setToToken}
|
||||
/>
|
||||
|
||||
@@ -103,7 +103,7 @@ export function SwapForm() {
|
||||
onRefresh={refreshRate}
|
||||
/>
|
||||
|
||||
<SwapInfoPanel />
|
||||
<SwapInfoPanel gasFee={gasFee} />
|
||||
|
||||
<PrimaryButton />
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import styles from './SwapInfoPanel.module.css'
|
||||
|
||||
const ROWS = [
|
||||
interface Props {
|
||||
gasFee?: string
|
||||
}
|
||||
|
||||
export function SwapInfoPanel({ gasFee }: Props) {
|
||||
const rows = [
|
||||
{ label: 'ПРОВАЙДЕР', value: 'ЛУЧШИЙ', link: false },
|
||||
{ label: 'СКОЛЬЖЕНИЕ', value: 'АВТО (0.5%)', link: true },
|
||||
{ label: 'СЕТЕВОЙ СБОР', value: '$0.10', link: false },
|
||||
{ label: 'СЕТЕВОЙ СБОР', value: gasFee ? `$${gasFee}` : '—', link: false },
|
||||
]
|
||||
|
||||
export function SwapInfoPanel() {
|
||||
return (
|
||||
<div className={styles.panel}>
|
||||
{ROWS.map(({ label, value, link }) => (
|
||||
{rows.map(({ label, value, link }) => (
|
||||
<div key={label} className={styles.row}>
|
||||
<span className={styles.label}>{label}</span>
|
||||
<span className={`${styles.value} ${link ? styles.link : ''}`}>{value}</span>
|
||||
|
||||
Reference in New Issue
Block a user