diff --git a/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx b/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx
index 82b258a..676be7a 100644
--- a/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx
+++ b/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx
@@ -158,11 +158,7 @@ export function FamilyMemberTreeRoute(): React.ReactElement {
{currTab === CurrTab.BasicTree ? (
) : currTab === CurrTab.SimpleTree ? (
-
+
) : (
buildSimpleDownTreeNode(c, depth - 1)) ??
- [],
+ childrenToProcess?.map((c) => buildSimpleTreeNode(c, depth - 1)) ?? [],
member: tree.member,
spouse: lastCouple
? {
@@ -131,23 +132,6 @@ function buildSimpleDownTreeNode(
return node;
}
-// TODO : if useless, remove and merge up and down techniques
-function buildSimpleUpTreeNode(
- tree: FamilyTreeNode,
- depth: number
-): SimpleTreeNode {
- /*if (depth === 0) throw new Error("Too much recursion reached!");
-
- return {
- member: tree.member,
- children:
- depth === 1
- ? []
- : tree.down?.map((c) => buildSimpleUpTreeNode(c, depth - 1)) ?? [],
- };*/
- return buildSimpleDownTreeNode(tree, depth);
-}
-
/**
* Simple family tree
*
@@ -156,15 +140,13 @@ function buildSimpleUpTreeNode(
export function SimpleFamilyTree(p: {
tree: FamilyTreeNode;
- isUp: boolean;
depth: number;
}): React.ReactElement {
+ const darkTheme = useDarkTheme();
+
const tree = React.useMemo(
- () =>
- p.isUp
- ? buildSimpleUpTreeNode(p.tree, p.depth)
- : buildSimpleDownTreeNode(p.tree, p.depth),
- [p.tree, p.isUp, p.depth]
+ () => buildSimpleTreeNode(p.tree, p.depth),
+ [p.tree, p.depth]
);
const height = p.depth * (CARD_HEIGHT + LEVEL_SPACING) - LEVEL_SPACING;
@@ -175,6 +157,7 @@ export function SimpleFamilyTree(p: {