small details

This commit is contained in:
counterweight 2025-12-26 23:27:33 +01:00
parent 61ae2807de
commit 86c92a7c65
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
11 changed files with 328 additions and 184 deletions

View file

@ -345,36 +345,43 @@ export function ExchangeDetailsStep({
</div>
{/* Trade Summary */}
<div style={styles.tradeSummary}>
<div style={styles.tradeSummary} data-testid="trade-summary">
{direction === "buy" ? (
<p style={styles.summaryText}>
{t("detailsStep.summaryBuy", { sats: "", eur: "" }).split("{sats}")[0].trim()}{" "}
<strong style={styles.satsValue}>
<SatsDisplay sats={satsAmount} />
</strong>
{", "}
{t("detailsStep.summaryBuy", { sats: "", eur: "" })
.split("{sats}")[1]
?.split("{eur}")[0]
?.trim()}{" "}
<strong>{formatEur(eurAmount)}</strong>
{t("detailsStep.summaryBuy", {
eur: formatEur(eurAmount),
sats: "",
})
.replace("{eur}", formatEur(eurAmount))
.split("{sats}")
.map((part, i) => (
<span key={i}>
{part}
{i === 0 && (
<strong style={styles.satsValue}>
<SatsDisplay sats={satsAmount} />
</strong>
)}
</span>
))}
</p>
) : (
<p style={styles.summaryText}>
{t("detailsStep.summarySell", { sats: "", eur: "" })
.split("{sats}")[0]
?.split("{eur}")[0]
?.trim()}{" "}
<strong>{formatEur(eurAmount)}</strong>
{", "}
{t("detailsStep.summarySell", { sats: "", eur: "" })
.split("{sats}")[0]
?.split("{eur}")[1]
?.trim()}{" "}
<strong style={styles.satsValue}>
<SatsDisplay sats={satsAmount} />
</strong>
{t("detailsStep.summarySell", { sats: "", eur: "" }).split("{sats}")[1]?.trim()}
{t("detailsStep.summarySell", {
sats: "",
eur: formatEur(eurAmount),
})
.split("{sats}")
.map((part, i) => (
<span key={i}>
{i === 0 && (
<strong style={styles.satsValue}>
<SatsDisplay sats={satsAmount} />
</strong>
)}
{part.replace("{eur}", formatEur(eurAmount))}
</span>
))}
</p>
)}
</div>