#![expect( unreachable_pub, reason = "leptos' component macro generates this warning" )] #![expect( clippy::must_use_candidate, reason = "Can't add it to leptos' components" )] #![expect( clippy::needless_pass_by_value, reason = "Can't add it to leptos' components" )] mod components; mod pages; use std::sync::Arc; use leptos::prelude::{AddAnyAttr, IntoView, component, view}; use leptos_meta::{Html, Meta, Title, provide_meta_context}; use leptos_router::{ components::{Route, Router, Routes}, path, }; use rocie_client::apis::configuration::Configuration; use crate::pages::{home::Home, not_found::NotFound}; #[component] pub fn App() -> impl IntoView { // Provides context that manages stylesheets, titles, meta tags, etc. provide_meta_context(); let config = { let mut config = Configuration::new(); config.user_agent = Some("rocie-mobile".to_owned()); "http://127.0.0.1:8080".clone_into(&mut config.base_path); Arc::new(config) }; view! { <Meta charset="UTF-8" /> <Meta name="viewport" content="width=device-width, initial-scale=1.0" /> <Router> <Routes fallback=|| view! { <NotFound /> }> <Route path=path!("/") view=move || { let local_config = Arc::clone(&config); view! { <Home config=local_config /> } } /> </Routes> </Router> } }