summary refs log tree commit diff stats
path: root/src/pages/home.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-03-19 07:45:14 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-03-19 07:45:14 +0100
commitf6a3fb9c4d8dd86f78c9f75a23c1ac35bf35d4eb (patch)
tree5f28fbca03d83921b568f7cb1708374456d9ec42 /src/pages/home.rs
parentfeat(treewide): Add further buttons (diff)
downloadweb-client-f6a3fb9c4d8dd86f78c9f75a23c1ac35bf35d4eb.zip
feat(treewide): Commit MVP
Diffstat (limited to 'src/pages/home.rs')
-rw-r--r--src/pages/home.rs46
1 files changed, 17 insertions, 29 deletions
diff --git a/src/pages/home.rs b/src/pages/home.rs
index b9dba64..e3767fd 100644
--- a/src/pages/home.rs
+++ b/src/pages/home.rs
@@ -1,7 +1,6 @@
 use leptos::{
     IntoView, component,
-    error::ErrorBoundary,
-    prelude::{ClassAttribute, CollectView, ElementChild, Get, GetUntracked},
+    prelude::{ClassAttribute, ElementChild, GetUntracked},
     view,
 };
 use leptos_router::{
@@ -10,8 +9,9 @@ use leptos_router::{
 };
 
 use crate::components::{
-    inventory::Inventory, product_overview::ProductOverview, recipies::Recipies,
-    site_header::SiteHeader, unit_overview::UnitOverview,
+    catch_errors::CatchErrors, inventory::Inventory, login_wall::LoginWall,
+    product_overview::ProductOverview, product_parent_overview::ProductParentOverview,
+    recipies::Recipies, site_header::SiteHeader, unit_overview::UnitOverview,
 };
 
 #[component]
@@ -24,31 +24,19 @@ pub fn Home() -> impl IntoView {
     }
 
     view! {
-        <ErrorBoundary fallback=|errors| {
-            view! {
-                <h1>"Uh oh! Something went wrong!"</h1>
-
-                <p>"Errors: "</p>
-                // Render a list of errors as strings - good for development purposes
-                <ul>
-                    {move || {
-                        errors
-                            .get()
-                            .into_iter()
-                            .map(|(_, e)| view! { <li>{e.to_string()}</li> })
-                            .collect_view()
-                    }}
-                </ul>
-            }
-        }>
-
-            <div class="flex flex-col content-start">
+        <CatchErrors>
+            <LoginWall back=move || "/".to_owned()>
                 <SiteHeader logo=icondata_io::IoRoseSharp back_location="/" name="Rocie" />
-                <Inventory />
-                <Recipies />
-                <ProductOverview />
-                <UnitOverview />
-            </div>
-        </ErrorBoundary>
+
+                <div class="flex flex-col content-start">
+                    <Inventory />
+                    <Recipies />
+                    <hr class="w-8 h-0.5 rounded-lg mt-4 self-center bg-gray-500" />
+                    <ProductOverview />
+                    <UnitOverview />
+                    <ProductParentOverview />
+                </div>
+            </LoginWall>
+        </CatchErrors>
     }
 }