diff --git a/renderer/components/AccountRow/AccountRow.tsx b/renderer/components/AccountRow/AccountRow.tsx index bb2a956e..3d2343d8 100644 --- a/renderer/components/AccountRow/AccountRow.tsx +++ b/renderer/components/AccountRow/AccountRow.tsx @@ -22,7 +22,7 @@ import { LogoSm } from "@/ui/SVGs/LogoSm"; import { formatOre } from "@/utils/ironUtils"; import { AccountSyncingProgress } from "../AccountSyncingProgress/AccountSyncingProgress"; -import { CopyAddress } from "../CopyAddress/CopyAddress"; +import { CopyToClipboard } from "../CopyToClipboard/CopyToClipboard"; import { ViewOnlyChip } from "../ViewOnlyChip/ViewOnlyChip"; const messages = defineMessages({ @@ -106,7 +106,7 @@ export function AccountRow({ {formatOre(balance)} $IRON - + {targetTxHash ? ( - ) : ( diff --git a/renderer/components/ContactRow/ContactRow.tsx b/renderer/components/ContactRow/ContactRow.tsx index c79c1b3c..e3b145fe 100644 --- a/renderer/components/ContactRow/ContactRow.tsx +++ b/renderer/components/ContactRow/ContactRow.tsx @@ -9,7 +9,7 @@ import { PillButton } from "@/ui/PillButton/PillButton"; import { ShadowCard } from "@/ui/ShadowCard/ShadowCard"; import { ArrowSend } from "@/ui/SVGs/ArrowSend"; -import { CopyAddress } from "../CopyAddress/CopyAddress"; +import { CopyToClipboard } from "../CopyToClipboard/CopyToClipboard"; import { FishIcon } from "../FishIcon/FishIcon"; const messages = defineMessages({ @@ -78,7 +78,7 @@ export function ContactRow({ name, address, order }: Props) { {name} - + { e.preventDefault(); - copyToClipboard(address); + copyToClipboard(text); toast({ - message: formatMessage(messages.addressCopied), + message: formatMessage(messages[messageType]), }); }} color={COLORS.GRAY_MEDIUM} @@ -48,7 +56,7 @@ export function CopyAddress({ }} {...rest} > - {truncate ? truncateString(address, parts) : address} + {truncate ? truncateString(text, parts) : text} ); } @@ -139,7 +139,7 @@ export function NoteRow({ from === to && type !== "miner", isBridge, ); - const headings = useHeadingsText(); + const headings = useHeadingsText(asTransaction); const cellContent = useMemo(() => { let key = 0; @@ -151,7 +151,7 @@ export function NoteRow({ ); const symbol = CurrencyUtils.shortSymbol(assetId, asset); - return [ + const row = [ {statusDisplay.icon} {formatMessage(statusDisplay.message)} @@ -173,6 +173,21 @@ export function NoteRow({ : memo} , ]; + + if (asTransaction) { + row.push( + + + , + ); + } + + return row; }, [ asset, assetId, @@ -186,6 +201,8 @@ export function NoteRow({ to, type, value, + asTransaction, + transactionHash, ]); return ( diff --git a/renderer/components/NoteRow/shared.ts b/renderer/components/NoteRow/shared.ts index ddab20ae..89d0a4cf 100644 --- a/renderer/components/NoteRow/shared.ts +++ b/renderer/components/NoteRow/shared.ts @@ -18,6 +18,9 @@ export const messages = defineMessages({ memo: { defaultMessage: "Memo", }, + transactionHash: { + defaultMessage: "Hash", + }, sent: { defaultMessage: "Sent", }, @@ -49,13 +52,17 @@ export const messages = defineMessages({ }, }); -export function useHeadingsText() { +export function useHeadingsText(asTransaction: boolean = false) { const { formatMessage } = useIntl(); - return [ + const headings = [ formatMessage(messages.action), formatMessage(messages.amount), formatMessage(messages.fromTo), formatMessage(messages.date), formatMessage(messages.memo), ]; + if (asTransaction) { + headings.push(formatMessage(messages.transactionHash)); + } + return headings; } diff --git a/renderer/components/TransactionInformation/TransactionInformation.tsx b/renderer/components/TransactionInformation/TransactionInformation.tsx index af702ed5..d44d4de1 100644 --- a/renderer/components/TransactionInformation/TransactionInformation.tsx +++ b/renderer/components/TransactionInformation/TransactionInformation.tsx @@ -4,8 +4,8 @@ import { Grid, GridItem, Heading, - Text, HStack, + Text, VStack, } from "@chakra-ui/react"; import { upperFirst } from "lodash-es"; @@ -24,7 +24,7 @@ import { ShadowCard } from "@/ui/ShadowCard/ShadowCard"; import { formatDate } from "@/utils/formatDate"; import { formatOre } from "@/utils/ironUtils"; -import { CopyAddress } from "../CopyAddress/CopyAddress"; +import { CopyToClipboard } from "../CopyToClipboard/CopyToClipboard"; type Transaction = TRPCRouterOutputs["getTransaction"]["transaction"]; @@ -69,11 +69,12 @@ function TransactionHashBody({ transaction }: { transaction: Transaction }) { return ( - {data && ( diff --git a/renderer/intl/locales/en-US.json b/renderer/intl/locales/en-US.json index c8283a64..d9cf8ce8 100644 --- a/renderer/intl/locales/en-US.json +++ b/renderer/intl/locales/en-US.json @@ -159,6 +159,9 @@ "9+Ddtu": { "message": "Next" }, + "93oVTh": { + "message": "Copied to clipboard" + }, "9DI6zl": { "message": "You can change the fee amount you'd like to pay. However, that will directly correlate with the speed with which your transaction is picked up by the blockchain." }, @@ -273,6 +276,9 @@ "IwW0RC": { "message": "If none of these steps help, please report the issue on Discord." }, + "Ix4/6C": { + "message": "Hash copied to clipboard" + }, "JJNc3c": { "message": "Previous" }, @@ -469,12 +475,12 @@ "ThbkST": { "message": "Unable to load your transactions" }, + "TvwmZr": { + "message": "Hash" + }, "TzwzhT": { "message": "You can remove and reimport your accounts whenever you like, provided that you possess the account keys. It is highly recommended to maintain a backup of your account keys in a secure location." }, - "U78NhE": { - "message": "Complete" - }, "ULXFfP": { "message": "Receive" }, @@ -601,9 +607,6 @@ "eVlu1R": { "message": "Select language" }, - "eaEGGc": { - "message": "Preparing target txn" - }, "ecJcrS": { "message": "Syncing blocks" }, @@ -619,9 +622,6 @@ "fKN5VY": { "message": "Create Contact" }, - "fYjxPn": { - "message": "Submitted target txn" - }, "flxGnZ": { "message": "Telemetry enabled" }, @@ -658,9 +658,6 @@ "hR0flV": { "message": "All your transactions, whether in $IRON or other custom assets, will be displayed in this section. To start a transaction, simply click on the 'Send' or 'Receive' tabs." }, - "iFsDVR": { - "message": "Loading" - }, "iWiHY7": { "message": "The blockchain is syncing. Your balance may be inaccurate and sending transactions will be disabled until the sync is complete." }, @@ -766,9 +763,6 @@ "rGIQdX": { "message": "Back to Account Overview" }, - "raexxM": { - "message": "Submitted" - }, "rbrahO": { "message": "Close" }, @@ -817,9 +811,6 @@ "vV69eP": { "message": "Downloading a snapshot is the fastest way to sync with the network." }, - "vXCeIi": { - "message": "Failed" - }, "vaP4MI": { "message": "It currently holds:" }, diff --git a/renderer/pages/accounts/[account-name]/index.tsx b/renderer/pages/accounts/[account-name]/index.tsx index d3c559a9..969c6e5d 100644 --- a/renderer/pages/accounts/[account-name]/index.tsx +++ b/renderer/pages/accounts/[account-name]/index.tsx @@ -1,14 +1,14 @@ import { Box, + HStack, Heading, - Tabs, - TabList, + Spinner, Tab, - TabPanels, + TabList, TabPanel, - HStack, + TabPanels, + Tabs, VStack, - Spinner, } from "@chakra-ui/react"; import { useRouter } from "next/router"; import { useMemo } from "react"; @@ -18,7 +18,7 @@ import { AccountAssets } from "@/components/AccountAssets/AccountAssets"; import { AccountKeyExport } from "@/components/AccountKeyExport/AccountKeyExport"; import { AccountMnemonicView } from "@/components/AccountMnemonicView/AccountMnenomicView"; import { AccountSettings } from "@/components/AccountSettings/AccountSettings"; -import { CopyAddress } from "@/components/CopyAddress/CopyAddress"; +import { CopyToClipboard } from "@/components/CopyToClipboard/CopyAddress"; import { NotesList } from "@/components/NotesList/NotesList"; import { ViewOnlyChip } from "@/components/ViewOnlyChip/ViewOnlyChip"; import keysGhost from "@/images/keys-ghost.svg"; @@ -120,8 +120,8 @@ function AccountOverviewContent({ accountName }: { accountName: string }) { )} - diff --git a/renderer/pages/accounts/[account-name]/transaction/[transaction-hash].tsx b/renderer/pages/accounts/[account-name]/transaction/[transaction-hash].tsx index fd9cac98..5ee948cc 100644 --- a/renderer/pages/accounts/[account-name]/transaction/[transaction-hash].tsx +++ b/renderer/pages/accounts/[account-name]/transaction/[transaction-hash].tsx @@ -4,7 +4,7 @@ import { defineMessages, useIntl } from "react-intl"; import { BridgeTransactionInformation } from "@/components/BridgeTransactionInformation/BridgeTransactionInformation"; import { BridgeTransactionProgressIndicator } from "@/components/BridgeTransactionProgressIndicator/BridgeTransactionProgressIndicator"; -import { CopyAddress } from "@/components/CopyAddress/CopyAddress"; +import { CopyToClipboard } from "@/components/CopyToClipboard/CopyAddress"; import { NotesList } from "@/components/NotesList/NotesList"; import { TransactionInformation } from "@/components/TransactionInformation/TransactionInformation"; import MainLayout from "@/layouts/MainLayout"; @@ -61,8 +61,8 @@ function SingleTransactionContent({ > {accountName} - @@ -100,8 +100,8 @@ function SingleTransactionContent({ > {accountName} - diff --git a/renderer/pages/address-book/[address]/index.tsx b/renderer/pages/address-book/[address]/index.tsx index 654e069d..9d1eead6 100644 --- a/renderer/pages/address-book/[address]/index.tsx +++ b/renderer/pages/address-book/[address]/index.tsx @@ -1,22 +1,22 @@ import { Box, + Flex, Heading, - Tabs, - TabList, + HStack, + Skeleton, Tab, - TabPanels, + TabList, TabPanel, - HStack, - Flex, + TabPanels, + Tabs, Text, - Skeleton, VStack, } from "@chakra-ui/react"; import Image from "next/image"; import { useRouter } from "next/router"; import { defineMessages, useIntl } from "react-intl"; -import { CopyAddress } from "@/components/CopyAddress/CopyAddress"; +import { CopyToClipboard } from "@/components/CopyToClipboard/CopyAddress"; import { EditContactForm } from "@/components/EditContactForm/EditContactForm"; import { FishIcon } from "@/components/FishIcon/FishIcon"; import { NotesList } from "@/components/NotesList/NotesList"; @@ -92,7 +92,7 @@ function SingleContactContent({ address }: { address: string }) { {formatMessage(messages.send)} - + {formatMessage(messages.transactions)}