diff --git a/public/locales/en.json b/public/locales/en.json index 132cc36..01a7ac7 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -372,6 +372,12 @@ "nameHistoryTitle": "Name History", "nameTransactionsTitle": "Name Transactions", + "siteTitleWallets": "My Transactions", + "siteTitleNetworkAll": "Network Transactions", + "siteTitleNetworkAddress": "{{address}}'s Transactions", + "siteTitleNameHistory": "Name History", + "siteTitleNameSent": "Name Transactions", + "columnID": "ID", "columnType": "Type", "columnFrom": "From", diff --git a/src/pages/transactions/TransactionsPage.tsx b/src/pages/transactions/TransactionsPage.tsx index ca23866..aa73e59 100644 --- a/src/pages/transactions/TransactionsPage.tsx +++ b/src/pages/transactions/TransactionsPage.tsx @@ -4,7 +4,7 @@ import React, { useState, useMemo, Dispatch, SetStateAction } from "react"; import { Switch } from "antd"; -import { useTranslation } from "react-i18next"; +import { useTranslation, TFunction } from "react-i18next"; import { useParams } from "react-router-dom"; import { PageLayout } from "../../layout/PageLayout"; @@ -49,6 +49,21 @@ listingType: ListingType; } +function getSiteTitle(t: TFunction, listingType: ListingType, address?: string): string { + switch (listingType) { + case ListingType.WALLETS: + return t("transactions.siteTitleWallets"); + case ListingType.NETWORK_ALL: + return t("transactions.siteTitleNetworkAll"); + case ListingType.NETWORK_ADDRESS: + return t("transactions.siteTitleNetworkAddress", { address }); + case ListingType.NAME_HISTORY: + return t("transactions.siteTitleNameHistory"); + case ListingType.NAME_SENT: + return t("transactions.siteTitleNameSent"); + } +} + export function TransactionsPage({ listingType }: Props): JSX.Element { const { t } = useTranslation(); const { address, name } = useParams(); @@ -58,6 +73,7 @@ // invalid address), the table will bubble it up to here const [error, setError] = useState(); + const siteTitle = getSiteTitle(t, listingType, address); const subTitle = name ? : (listingType === ListingType.NETWORK_ADDRESS @@ -70,6 +86,7 @@ // Alter the page title depending on the listing type titleKey={LISTING_TYPE_TITLES[listingType]} + siteTitle={siteTitle} // For an address's transaction listing, show that address in the subtitle. // For a name listing, show the name in the subtitle.