From 65fd7372bc117e5707d944e6db560eafa627147f Mon Sep 17 00:00:00 2001 From: Barnaby Date: Sun, 23 Jun 2024 14:57:49 +0100 Subject: [PATCH] remove links from datagraph root --- .../directory/DirectoryEmptyState.tsx | 19 ++++++++ .../datagraph/DatagraphIndexScreen.tsx | 45 +++++-------------- 2 files changed, 31 insertions(+), 33 deletions(-) create mode 100644 web/src/components/directory/DirectoryEmptyState.tsx diff --git a/web/src/components/directory/DirectoryEmptyState.tsx b/web/src/components/directory/DirectoryEmptyState.tsx new file mode 100644 index 000000000..566a8d236 --- /dev/null +++ b/web/src/components/directory/DirectoryEmptyState.tsx @@ -0,0 +1,19 @@ +import { Empty } from "src/components/site/Empty"; + +import { Center } from "@/styled-system/jsx"; + +export function DirectoryEmptyState() { + return ( +
+ + This community knowledgebase is empty. +
+ {session ? ( + <>Be the first to contribute! + ) : ( + <>Please log in to contribute. + )} +
+
+ ); +} diff --git a/web/src/screens/directory/datagraph/DatagraphIndexScreen.tsx b/web/src/screens/directory/datagraph/DatagraphIndexScreen.tsx index 11d2baab4..bf532ead9 100644 --- a/web/src/screens/directory/datagraph/DatagraphIndexScreen.tsx +++ b/web/src/screens/directory/datagraph/DatagraphIndexScreen.tsx @@ -2,12 +2,11 @@ import { Breadcrumbs } from "src/components/directory/datagraph/Breadcrumbs"; import { NodeCardRows } from "src/components/directory/datagraph/NodeCardList"; -import { LinkResultList } from "src/components/directory/links/LinkIndexView/LinkResultList"; -import { Empty } from "src/components/site/Empty"; import { Unready } from "src/components/site/Unready"; +import { DirectoryEmptyState } from "@/components/directory/DirectoryEmptyState"; import { Heading } from "@/components/ui/heading"; -import { Center, VStack } from "@/styled-system/jsx"; +import { LStack, VStack } from "@/styled-system/jsx"; import { Props, useDatagraphIndexScreen } from "./useDatagraphIndexScreen"; @@ -16,46 +15,26 @@ export function Client(props: Props) { if (!ready) return ; - const { nodes, links } = data; + const { nodes } = data; return ( - + {empty ? ( -
- - This community knowledgebase is empty. -
- {session ? ( - <>Be the first to contribute! - ) : ( - <>Please log in to contribute. - )} -
-
+ ) : (

You can browse the community's knowledgebase here.

)} - {links.data.results > 0 && ( - - New links - - - )} - {nodes.data.nodes.length > 0 && ( - - Knowledgebase - - + )} -
+ ); }