diff --git a/public/locales/en.json b/public/locales/en.json index 2c7967e..41fdeba 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -408,8 +408,8 @@ "buttonSendKrist": "Send Krist to {{address}}", "buttonTransferKrist": "Transfer Krist to {{address}}", - "buttonAddFriend": "Add to address book", - "buttonEditFriend": "Edit in address book", + "buttonAddContact": "Add to address book", + "buttonEditContact": "Edit in address book", "buttonEditWallet": "Edit wallet", "cardRecentTransactionsTitle": "Recent transactions", @@ -687,6 +687,7 @@ "invalidSalt": "The backup could not be decoded as the 'salt' key is the wrong type!", "invalidWallets": "The backup could not be decoded as the 'wallets' key is the wrong type!", "invalidFriends": "The backup could not be decoded as the 'friends' key is the wrong type!", + "invalidContacts": "The backup could not be decoded as the 'contacts' key is the wrong type!", "unknown": "The backup could not be decoded due to an unknown error. See console for details." }, @@ -720,7 +721,7 @@ "errorUnknown": "An unknown error occurred. See console for details." }, - "friendMessages": { + "contactMessages": { "errorNYI": "The Address Book has not yet been implemented, so it was skipped." }, @@ -732,10 +733,10 @@ "walletsSkipped": "{{count, number}} wallet was skipped.", "walletsSkipped_plural": "{{count, number}} wallets were skipped.", - "friendsImported": "<0>{{count, number}} new friend was imported.", - "friendsImported_plural": "<0>{{count, number}} new friends were imported.", - "friendsSkipped": "{{count, number}} friend was skipped.", - "friendsSkipped_plural": "{{count, number}} friends were skipped.", + "contactsImported": "<0>{{count, number}} new contact was imported.", + "contactsImported_plural": "<0>{{count, number}} new contacts were imported.", + "contactsSkipped": "{{count, number}} contact was skipped.", + "contactsSkipped_plural": "{{count, number}} contacts were skipped.", "warnings": "There was <1>{{count, number}} warning while importing your backup.", "warnings_plural": "There were <1>{{count, number}} warning while importing your backup.", @@ -744,10 +745,10 @@ "errorsAndWarnings": "There were <1>{{errors, number}} error(s) and <3>{{warnings, number}} warning(s) while importing your backup.", "treeHeaderWallets": "Wallets", - "treeHeaderFriends": "Friends (Address Book)", + "treeHeaderContacts": "Contacts", "treeWallet": "Wallet {{id}}", - "treeFriend": "Friend {{id}}" + "treeContact": "Contact {{id}}" } }, diff --git a/src/layout/sidebar/Sidebar.tsx b/src/layout/sidebar/Sidebar.tsx index ca9f094..9369732 100644 --- a/src/layout/sidebar/Sidebar.tsx +++ b/src/layout/sidebar/Sidebar.tsx @@ -30,15 +30,15 @@ const sidebarItems: SidebarItemProps[] = [ { icon: , name: "dashboard", to: "/" }, { icon: , name: "myWallets", to: "/wallets" }, - { icon: , name: "addressBook", to: "/friends", nyi: true }, + { icon: , name: "addressBook", to: "/contacts", nyi: true }, { icon: , name: "transactions", to: "/me/transactions" }, { icon: , name: "names", to: "/me/names" }, - { icon: , name: "mining", to: "/mining", nyi: true }, + { icon: , name: "mining", to: "/mining", nyi: true }, { group: "network", icon: , name: "blocks", to: "/network/blocks" }, { group: "network", icon: , name: "transactions", to: "/network/transactions" }, { group: "network", icon: , name: "names", to: "/network/names" }, - { group: "network", icon: , name: "statistics", to: "/network/statistics", nyi: true }, + { group: "network", icon: , name: "statistics", to: "/network/statistics", nyi: true }, ]; function getSidebarItems(t: TFunction, group?: string) { diff --git a/src/pages/addresses/AddressButtonRow.tsx b/src/pages/addresses/AddressButtonRow.tsx index 247159d..736acb0 100644 --- a/src/pages/addresses/AddressButtonRow.tsx +++ b/src/pages/addresses/AddressButtonRow.tsx @@ -37,8 +37,8 @@ - {/* Add friend/edit wallet button */} - {/* TODO: Change this to edit if they're already a friend */} + {/* Add contact/edit wallet button */} + {/* TODO: Change this to edit if they're already a contact */} {myWallet ? ( @@ -47,7 +47,7 @@ ) : ( )} ; diff --git a/src/pages/addresses/AddressPage.tsx b/src/pages/addresses/AddressPage.tsx index 3ae3936..5bb1cbd 100644 --- a/src/pages/addresses/AddressPage.tsx +++ b/src/pages/addresses/AddressPage.tsx @@ -52,7 +52,7 @@ {address.address} - {/* Buttons (e.g. Send Krist, Add friend) */} + {/* Buttons (e.g. Send Krist, Add contact) */} diff --git a/src/pages/backup/BackupResultsSummary.tsx b/src/pages/backup/BackupResultsSummary.tsx index 17813fb..dff7150 100644 --- a/src/pages/backup/BackupResultsSummary.tsx +++ b/src/pages/backup/BackupResultsSummary.tsx @@ -16,7 +16,7 @@ export function BackupResultsSummary({ results }: { results: BackupResults }): JSX.Element { const { t } = useTranslation(); - // TODO: do this for friends too + // TODO: do this for contacts too const { newWallets, skippedWallets } = results; const warningCount = Object.values(results.messages.wallets) .reduce((acc, msgs) => acc + msgs.filter(m => m.type === "warning").length, 0); @@ -45,7 +45,7 @@ } - {/* TODO: Show friend counts too (only if >0) */} + {/* TODO: Show contact counts too (only if >0) */} {/* Errors/warnings */}
diff --git a/src/pages/backup/BackupResultsTree.tsx b/src/pages/backup/BackupResultsTree.tsx index 68aa0af..435d9c3 100644 --- a/src/pages/backup/BackupResultsTree.tsx +++ b/src/pages/backup/BackupResultsTree.tsx @@ -66,7 +66,7 @@ } /** Converts the backup results into a tree of messages, grouped by wallet - * and friend UUID. */ + * and contact UUID. */ function getTreeData( t: TFunction, i18n: i18n, results: BackupResults @@ -102,7 +102,7 @@ }); } - // TODO: Add the friends data + // TODO: Add the address book contacts data return out; } diff --git a/src/pages/backup/backupExport.ts b/src/pages/backup/backupExport.ts index 16454fd..676ca01 100644 --- a/src/pages/backup/backupExport.ts +++ b/src/pages/backup/backupExport.ts @@ -18,7 +18,7 @@ salt, tester, wallets: finalWallets, - friends: {} // TODO + contacts: {} // TODO }; // Convert to base64'd JSON diff --git a/src/pages/backup/backupFormats.ts b/src/pages/backup/backupFormats.ts index 950d4e4..763573c 100644 --- a/src/pages/backup/backupFormats.ts +++ b/src/pages/backup/backupFormats.ts @@ -57,7 +57,7 @@ version: 2; wallets: Record; - // friends: Record; + // contacts: Record; } export const isBackupKristWebV2 = (backup: Backup): backup is BackupKristWebV2 => backup.type === BackupFormatType.KRISTWEB_V2; diff --git a/src/pages/backup/backupParser.ts b/src/pages/backup/backupParser.ts index 43bfc64..538be7c 100644 --- a/src/pages/backup/backupParser.ts +++ b/src/pages/backup/backupParser.ts @@ -32,6 +32,8 @@ throw new TranslatedError("import.decodeErrors.invalidWallets"); if (data.friends !== undefined && !isPlainObject(data.friends)) throw new TranslatedError("import.decodeErrors.invalidFriends"); + if (data.contacts !== undefined && !isPlainObject(data.contacts)) + throw new TranslatedError("import.decodeErrors.invalidContacts"); // Determine the format if (data.version === 2) { diff --git a/src/pages/backup/backupResults.ts b/src/pages/backup/backupResults.ts index 35229fd..08c90e5 100644 --- a/src/pages/backup/backupResults.ts +++ b/src/pages/backup/backupResults.ts @@ -14,7 +14,7 @@ args?: Record; } -export type MessageSource = "wallets" | "friends"; +export type MessageSource = "wallets" | "contacts"; export type MessageType = React.ReactNode | TranslatedMessage | string; export type ResultType = "success" | "warning" | "error"; @@ -30,14 +30,14 @@ * date). */ public importedWallets: Wallet[] = []; - /** For both wallets and friends, a map of wallet/friend UUIDs containing + /** For both wallets and contacts, a map of wallet/contact UUIDs containing * all the messages (success, warning, error). */ public messages: { wallets: Record; - friends: Record; + contacts: Record; } = { wallets: {}, - friends: {} + contacts: {} }; /** Adds a message to the appropriate message map. */ @@ -49,19 +49,19 @@ else msgMap[uuid].push(message); } - /** Logs a success message for the given wallet/friend UUID to the appropriate - * message map. */ + /** Logs a success message for the given wallet/contact UUID to the + * appropriate message map. */ public addSuccessMessage(src: MessageSource, uuid: string, message: MessageType): void { this.addMessage(src, uuid, { type: "success", message }); } - /** Logs a warning message for the given wallet/friend UUID to the appropriate - * message map. */ + /** Logs a warning message for the given wallet/contact UUID to the + * appropriate message map. */ public addWarningMessage(src: MessageSource, uuid: string, message: MessageType): void { this.addMessage(src, uuid, { type: "warning", message }); } - /** Logs an error message for the given wallet/friend UUID to the appropriate + /** Logs an error message for the given wallet/contact UUID to the appropriate * message map. */ public addErrorMessage(src: MessageSource, uuid: string, message?: MessageType, error?: Error): void { this.addMessage(src, uuid, { type: "error", message, error });