From d0263ce46160cd4152c67381fab2ee557f3aa483 Mon Sep 17 00:00:00 2001
From: Benedikt Peetz
Date: Tue, 30 Sep 2025 09:15:56 +0200
Subject: feat(treewide): Switch to tailwindcss and add more components
---
src/lib.rs | 41 +++++++++++++++++++++++++++++++----------
1 file changed, 31 insertions(+), 10 deletions(-)
(limited to 'src/lib.rs')
diff --git a/src/lib.rs b/src/lib.rs
index 357ce93..a488d95 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,24 +7,38 @@
reason = "Can't add it to leptos' components"
)]
#![expect(
- clippy::needless_pass_by_value,
- reason = "Can't add it to leptos' components"
+ unused_extern_crates,
+ reason = "Deependency needed to inject the `js` feature into uuid"
)]
+extern crate uuid;
+
+// All of them are only used in the `main.rs` and not in the `lib.rs` part of this crate.
+extern crate console_error_panic_hook;
+extern crate console_log;
+extern crate log;
+mod api;
mod components;
mod pages;
-use std::sync::Arc;
-
-use leptos::prelude::{AddAnyAttr, IntoView, component, view};
+use leptos::prelude::{AddAnyAttr, IntoView, component, provide_context, view};
use leptos_meta::{Html, Meta, Title, provide_meta_context};
use leptos_router::{
components::{Route, Router, Routes},
path,
};
+use reactive_stores::Store;
use rocie_client::apis::configuration::Configuration;
-use crate::pages::{home::Home, not_found::NotFound};
+use crate::{
+ components::inventory::Inventory,
+ pages::{home::Home, not_found::NotFound},
+};
+
+#[derive(Debug, Clone, Store)]
+pub struct ConfigState {
+ config: Configuration,
+}
#[component]
pub fn App() -> impl IntoView {
@@ -37,13 +51,15 @@ pub fn App() -> impl IntoView {
config.user_agent = Some("rocie-mobile".to_owned());
"http://127.0.0.1:8080".clone_into(&mut config.base_path);
- Arc::new(config)
+ config
};
+ provide_context(Store::new(ConfigState { config }));
+
view! {
-
+
@@ -53,8 +69,13 @@ pub fn App() -> impl IntoView {
}
+ view! { }
+ }
+ />
+ }
}
/>
--
cgit 1.4.1