diff --git a/public/locales/en.json b/public/locales/en.json index 1128999..d6be8b5 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -313,6 +313,10 @@ "address": { "title": "Address", + + "walletLabel": "Label:", + "walletCategory": "Category:", + "balance": "Current balance", "names": "Names", "nameCount": "{{count, number}} name", diff --git a/src/pages/addresses/AddressButtonRow.tsx b/src/pages/addresses/AddressButtonRow.tsx index 3737635..e7b7c93 100644 --- a/src/pages/addresses/AddressButtonRow.tsx +++ b/src/pages/addresses/AddressButtonRow.tsx @@ -8,15 +8,16 @@ import { useTranslation } from "react-i18next"; import { KristAddressWithNames } from "../../krist/api/lookup"; -import { useWallets } from "../../krist/wallets/Wallet"; +import { Wallet } from "../../krist/wallets/Wallet"; import { WalletEditButton } from "../wallets/WalletEditButton"; -export function AddressButtonRow({ address }: { address: KristAddressWithNames }): JSX.Element { - const { t } = useTranslation(); - const { wallets } = useWallets(); +interface Props { + address: KristAddressWithNames; + myWallet?: Wallet; +} - const myWallet = Object.values(wallets) - .find(w => w.address === address.address); +export function AddressButtonRow({ address, myWallet }: Props): JSX.Element { + const { t } = useTranslation(); return <> {/* Send/transfer Krist button */} diff --git a/src/pages/addresses/AddressPage.less b/src/pages/addresses/AddressPage.less index 6a2e373..38cd8e3 100644 --- a/src/pages/addresses/AddressPage.less +++ b/src/pages/addresses/AddressPage.less @@ -22,6 +22,19 @@ } } + .address-wallet-row { + margin-top: @padding-xs; + font-size: 90%; + + .prefix { + margin-right: @padding-xs; + } + + .address-wallet-label:not(:last-child) { + margin-right: @padding-xs; + } + } + .address-info-row { max-width: 768px; margin-bottom: @margin-lg; diff --git a/src/pages/addresses/AddressPage.tsx b/src/pages/addresses/AddressPage.tsx index 46406b0..4c3a206 100644 --- a/src/pages/addresses/AddressPage.tsx +++ b/src/pages/addresses/AddressPage.tsx @@ -2,7 +2,7 @@ // This file is part of KristWeb 2 under GPL-3.0. // Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt import React, { useState, useEffect } from "react"; -import { Row, Col, Skeleton } from "antd"; +import { Row, Col, Skeleton, Tag } from "antd"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; @@ -16,6 +16,7 @@ import * as api from "../../krist/api"; import { lookupAddress, KristAddressWithNames } from "../../krist/api/lookup"; +import { useWallets } from "../../krist/wallets/Wallet"; import { AddressButtonRow } from "./AddressButtonRow"; import { AddressTransactionsCard } from "./AddressTransactionsCard"; @@ -29,6 +30,10 @@ function PageContents({ address }: { address: KristAddressWithNames }): JSX.Element { const { t } = useTranslation(); + const { wallets } = useWallets(); + + const myWallet = Object.values(wallets) + .find(w => w.address === address.address); return <> {/* Address and buttons */} @@ -37,9 +42,24 @@