From 6d707dc71f8f1224594d8157e214dceeff52c1e7 Mon Sep 17 00:00:00 2001 From: Claas Date: Wed, 5 Jun 2024 14:04:30 +0200 Subject: [PATCH] Add journey page --- src/routes/index.tsx | 5 ++- src/routes/journey.tsx | 90 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 src/routes/journey.tsx diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 21a4599..7a73e94 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -189,7 +189,10 @@ export default function Home() { */} -
+ {/* As the naviation UI is bottom to top, we should make the search use the same to be not confusing. Also don't you first think of where you want to go and not where you are right now? */} {/* animation moving bottom sheet for search into view to get focus from user */} diff --git a/src/routes/journey.tsx b/src/routes/journey.tsx new file mode 100644 index 0000000..9c42ea4 --- /dev/null +++ b/src/routes/journey.tsx @@ -0,0 +1,90 @@ +import { For, type JSX } from "solid-js"; + +/** + * A recursive component building the tree of connections + * @param {Connection} connection + * @returns {JSX.Element} + */ +function Connection({ label, connections }: Connection): JSX.Element { + return ( +
+

{label}

+
+ {Connection} +
+
+ ); +} + +export default function Journey() { + return ( +
+ {Connection} +
+ ); +} + +type Connection = { + label: string; + connections: Connection[]; +}; + +const connections: Connection[] = [ + { + label: "Connection 1", + connections: [ + { + label: "Connection 1.1", + connections: [ + { + label: "Connection 1.1.1", + connections: [], + }, + { + label: "Connection 1.1.2", + connections: [ + { + label: "Connection 1.1.2.1", + connections: [], + }, + { + label: "Connection 1.1.2.2", + connections: [], + }, + ], + }, + ], + }, + { + label: "Connection 1.2", + connections: [], + }, + ], + }, + { + label: "Connection 2", + connections: [ + { + label: "Connection 2.1", + connections: [], + }, + { + label: "Connection 2.2", + connections: [], + }, + ], + }, + { + label: "Connection 3", + connections: [ + { + label: "Connection 3.1", + connections: [], + }, + { + label: "Connection 3.2", + connections: [], + }, + ], + }, +]; -- 2.51.2