From 223876d8ff4c0bf5273e0b6d2225305b47e661c0 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 18 Jan 2026 20:45:49 +0000 Subject: ux(mobile): align all lists in the all lists tab --- apps/mobile/app/dashboard/(tabs)/lists.tsx | 53 +++++++++++++++++++----------- 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'apps/mobile') diff --git a/apps/mobile/app/dashboard/(tabs)/lists.tsx b/apps/mobile/app/dashboard/(tabs)/lists.tsx index bfdacd28..6b18e2c7 100644 --- a/apps/mobile/app/dashboard/(tabs)/lists.tsx +++ b/apps/mobile/app/dashboard/(tabs)/lists.tsx @@ -81,6 +81,17 @@ export default function Lists() { return lists?.data.some((list) => list.userRole !== "owner") ?? false; }, [lists?.data]); + // Check if any list has children to determine if we need chevron spacing + const hasAnyListsWithChildren = useMemo(() => { + const checkForChildren = (node: ZBookmarkListTreeNode): boolean => { + if (node.children && node.children.length > 0) return true; + return false; + }; + return ( + Object.values(lists?.root ?? {}).some(checkForChildren) || hasSharedLists + ); + }, [lists?.root, hasSharedLists]); + useEffect(() => { setRefreshing(isPending); }, [isPending]); @@ -176,25 +187,29 @@ export default function Lists() { props: { marginLeft: l.item.level * 20 }, })} > - {l.item.numChildren > 0 && ( - { - setShowChildrenOf((prev) => ({ - ...prev, - [l.item.id]: !prev[l.item.id], - })); - }} - > - - + {hasAnyListsWithChildren && ( + + {l.item.numChildren > 0 && ( + { + setShowChildrenOf((prev) => ({ + ...prev, + [l.item.id]: !prev[l.item.id], + })); + }} + > + + + )} + )} {l.item.isSharedSection ? ( -- cgit v1.2.3-70-g09d2