+ {/* New wallets imported count */}
+
+
+ 0 ? "positive" : ""}>
+ {{ count: newWallets }} new wallet
+
+ was imported.
+
+
+
+ {/* Skipped wallets count */}
+ {skippedWallets > 0 &&
+
+ {{ count: skippedWallets }} wallet was skipped.
+
+
}
+
+ {/* TODO: Show friend counts too (only if >0) */}
+
+ {/* Errors/warnings */}
+
+ {warningCount > 0 && errorCount > 0
+ ? (
+ // Show errors and warnings
+
+ There were
+ {{ errors: errorCount }} error(s)
+ and
+ {{ warnings: warningCount }} warning(s)
+ while importing your backup.
+
+ )
+ : (warningCount > 0
+ ? (
+ // Show just warnings
+
+ There was
+ {{ count: warningCount }} warning
+ while importing your backup.
+
+ )
+ : (errorCount > 0
+ ? (
+ // Show just errors
+
+ There was
+ {{ count: errorCount }} error
+ while importing your backup.
+
+ )
+ : <>>))}
+
+ ;
+}
diff --git a/src/pages/backup/BackupResultsTree.less b/src/pages/backup/BackupResultsTree.less
index cbaa146..c9e8007 100644
--- a/src/pages/backup/BackupResultsTree.less
+++ b/src/pages/backup/BackupResultsTree.less
@@ -4,6 +4,9 @@
@import (reference) "../../App.less";
.backup-results-tree {
+ max-height: 480px;
+ overflow-y: auto;
+
.backup-result-icon {
margin-right: @padding-xs;
}
@@ -17,4 +20,9 @@
.ant-tree-treenode:not(.backup-results-tree-message) .ant-tree-title {
font-weight: 500;
}
+
+ // The leaf nodes have an invisible button which takes up space; remove that
+ .ant-tree-switcher-noop {
+ display: none;
+ }
}
diff --git a/src/pages/backup/BackupResultsTree.tsx b/src/pages/backup/BackupResultsTree.tsx
index 338ac00..ddc905b 100644
--- a/src/pages/backup/BackupResultsTree.tsx
+++ b/src/pages/backup/BackupResultsTree.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, { useMemo } from "react";
-import { Tree, Typography } from "antd";
+import { Tree } from "antd";
import { DataNode } from "antd/lib/tree";
import { CheckCircleOutlined, WarningOutlined, ExclamationCircleOutlined } from "@ant-design/icons";
@@ -16,8 +16,6 @@
import "./BackupResultsTree.less";
-const { Paragraph } = Typography;
-
interface Props {
results: BackupResults;
}
@@ -74,7 +72,7 @@
results: BackupResults
): DataNode[] {
// Add the wallet messages data
- const walletData: DataNode[] = [];
+ const out: DataNode[] = [];
for (const id in results.messages.wallets) {
// The IDs are the keys of the backup, which may begin with prefixes like
@@ -97,7 +95,7 @@
});
}
- walletData.push({
+ out.push({
key: `wallets-${cleanID}`,
title: t("import.results.treeWallet", { id: cleanID }),
children: messageNodes
@@ -106,11 +104,7 @@
// TODO: Add the friends data
- return [{
- key: "wallets",
- title: t("import.results.treeHeaderWallets"),
- children: walletData
- }];
+ return out;
}
export function BackupResultsTree({ results }: Props): JSX.Element {
@@ -119,19 +113,13 @@
const treeData = useMemo(() =>
getTreeData(t, i18n, results), [t, i18n, results]);
- return <>
- {/* Results summary */}
-