feat(gui): Dedicated react component for truncating swap ids, peer ids, ...

This commit is contained in:
binarybaron 2024-09-09 21:46:48 +02:00
parent c486ca5de9
commit 5e87be8a8b
No known key found for this signature in database
GPG key ID: 99B75D3E1476A26E
8 changed files with 32 additions and 10 deletions

View file

@ -11,6 +11,7 @@ import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
import { GetSwapInfoResponse } from "models/tauriModel";
import { useState } from "react";
import TruncatedText from "renderer/components/other/TruncatedText";
import { PiconeroAmount, SatsAmount } from "../../../other/Units";
import HistoryRowActions from "./HistoryRowActions";
import HistoryRowExpanded from "./HistoryRowExpanded";
@ -52,7 +53,9 @@ export default function HistoryRow(swap: GetSwapInfoResponse) {
{expanded ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
</IconButton>
</TableCell>
<TableCell>{swap.swap_id}</TableCell>
<TableCell>
<TruncatedText>{swap.swap_id}</TruncatedText>
</TableCell>
<TableCell>
<AmountTransfer
xmrAmount={swap.xmr_amount}

View file

@ -9,6 +9,7 @@ import {
} from "@material-ui/core";
import { ButtonProps } from "@material-ui/core/Button/Button";
import { BobStateName, GetSwapInfoResponseExt } from "models/tauriModelExt";
import TruncatedText from "renderer/components/other/TruncatedText";
import PromiseInvokeButton from "renderer/components/PromiseInvokeButton";
import { getMoneroRecoveryKeys } from "renderer/rpc";
import { store } from "renderer/store/storeRenderer";
@ -38,7 +39,9 @@ function MoneroRecoveryKeysDialog({
return (
<Dialog open onClose={onClose} maxWidth="sm" fullWidth>
<DialogHeader
title={`Recovery Keys for swap ${swap_id.substring(0, 5)}...`}
title=<>
Recovery Keys for swap <TruncatedText>{swap_id}</TruncatedText>
</>
/>
<DialogContent>
<DialogContentText>