Skip to content

Commit

Permalink
feat: show swap ID after uploading file (#677)
Browse files Browse the repository at this point in the history
* feat: show swap ID after uploading file

* chore: add missing strings

---------

Co-authored-by: Kilian <[email protected]>
  • Loading branch information
michael1011 and kilrau authored Oct 3, 2024
1 parent 6980615 commit e203f9c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const dict = {
backup_refund_skip:
"If any of the above applies to you, we strongly recommend downloading this refund file!",
refund_a_swap: "Refund a swap",
refund_swap: "Refund Swap {{ id }}",
refund_a_swap_subline:
"Upload your refund file and reclaim your locked funds",
refund_past_swaps: "Past swaps",
Expand Down Expand Up @@ -312,6 +313,7 @@ const dict = {
backup_refund_skip:
"Falls einer dieser Punkte zutrifft, empfehlen wir ausdrücklich die Rückerstattungsdatei herunterzuladen!",
refund_a_swap: "Einen Swap erstatten",
refund_swap: "Erstatte Swap {{ id }}",
refund_a_swap_subline:
"Lade deine Rückerstattungsdatei hoch und hole dir deine Bitcoin aus einem fehlgeschlagenen Swap zurück",
refund_past_swaps: "Historische Swaps",
Expand Down Expand Up @@ -532,6 +534,7 @@ const dict = {
backup_refund_skip:
"Si alguno de los puntos anteriores le afecta, le recomendamos que descargue el archivo de reembolso.",
refund_a_swap: "Reembolsar un intercambio",
refund_swap: "Reembolsar intercambio {{ id }}",
refund_a_swap_subline:
"Cargue su archivo de reembolso y recupere sus fondos bloqueados",
refund_past_swaps: "Intercambios anteriores",
Expand Down Expand Up @@ -749,6 +752,7 @@ const dict = {
backup_refund_list_clear_history: "清除您的浏览历史记录",
backup_refund_skip: "如果您符合以上任何条件,强烈建议下载此退款文件!",
refund_a_swap: "退还交换",
refund_swap: "退交换{{ id }}",
refund_a_swap_subline: "上传您的退款文件,取回被锁定的资金",
refund_past_swaps: "过去的交换",
refund_past_swaps_subline: "保存在浏览器存储中的交换",
Expand Down
21 changes: 18 additions & 3 deletions src/pages/Refund.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SwapList from "../components/SwapList";
import SwapListLogs from "../components/SwapListLogs";
import SettingsCog from "../components/settings/SettingsCog";
import SettingsMenu from "../components/settings/SettingsMenu";
import { RBTC } from "../consts/Assets";
import { SwapType } from "../consts/Enums";
import { swapStatusFailed, swapStatusSuccess } from "../consts/SwapStatus";
import { useGlobalContext } from "../context/Global";
Expand Down Expand Up @@ -198,8 +199,17 @@ const Refund = () => {
<div id="refund">
<div class="frame" data-testid="refundFrame">
<SettingsCog />
<h2>{t("refund_a_swap")}</h2>
<p>{t("refund_a_swap_subline")}</p>
<Show
when={refundJson() !== null}
fallback={
<>
<h2>{t("refund_a_swap")}</h2>
<p>{t("refund_a_swap_subline")}</p>
</>
}>
<h2>{t("refund_swap", { id: refundJson().id })}</h2>
</Show>

<Show when={logRefundableSwaps().length > 0}>
<SwapListLogs swaps={logRefundableSwaps} />
</Show>
Expand All @@ -214,7 +224,12 @@ const Refund = () => {
accept="application/json,image/png"
onChange={(e) => uploadChange(e)}
/>
<Show when={Object.keys(providers()).length > 0}>
<Show
when={
Object.keys(providers()).length > 0 &&
(refundJson() === null ||
refundJson().assetSend === RBTC)
}>
<hr />
<ConnectWallet addressOverride={refundScanProgress} />
</Show>
Expand Down

0 comments on commit e203f9c

Please sign in to comment.