I fixed it lol

This commit is contained in:
Ada Werefox 2024-11-11 15:50:03 -06:00
parent 1b830ecd59
commit aa9165b4df
2 changed files with 8 additions and 6 deletions

View File

@ -14,11 +14,11 @@ pub mod web_app_backend {
use rocket::response::Redirect; use rocket::response::Redirect;
use rocket::{Build, Rocket}; use rocket::{Build, Rocket};
use rocket_dyn_templates::{context, Template}; use rocket_dyn_templates::{context, Template};
use void_fe::utils::prop_structs::{PoemDatabase, VoidProps, ContentProps};
use void_fe::utils::user_prefs::*;
use void_fe::void_app::{self, VirtualDom};
pub use void_fe::components::void_content::RenderContent; pub use void_fe::components::void_content::RenderContent;
use void_fe::utils::helpers::get_homepage_paragraph; use void_fe::utils::helpers::get_homepage_paragraph;
use void_fe::utils::prop_structs::{ContentProps, PoemDatabase, VoidProps};
use void_fe::utils::user_prefs::*;
use void_fe::void_app::{self, VirtualDom};
static POEM_DATABASE: OnceCell<PoemDatabase> = OnceCell::new(); static POEM_DATABASE: OnceCell<PoemDatabase> = OnceCell::new();
@ -91,7 +91,7 @@ pub mod web_app_backend {
// user_prefs: user_prefs // user_prefs: user_prefs
// }; // };
// let mut vdom = VirtualDom::new_with_props(void_app::HomePage, void_props); // let mut vdom = VirtualDom::new_with_props(void_app::HomePage, void_props);
let mut vdom = VirtualDom::new_with_props(void_app::HomePage, void_fe::void_app::HomePageProps { props: void_props }); let mut vdom = VirtualDom::new_with_props(void_app::HomePage, void_props);
let _ = vdom.rebuild_in_place(); let _ = vdom.rebuild_in_place();
let output = dioxus_ssr::render(&vdom); let output = dioxus_ssr::render(&vdom);
Template::render( Template::render(
@ -188,7 +188,9 @@ pub mod web_app_backend {
pub async fn build_rocket() -> Rocket<Build> { pub async fn build_rocket() -> Rocket<Build> {
let mut poem_database = PoemDatabase::new(); let mut poem_database = PoemDatabase::new();
poem_database.build_poem_database().await; poem_database.build_poem_database().await;
POEM_DATABASE.set(poem_database).expect("Could not initialize poem database."); POEM_DATABASE
.set(poem_database)
.expect("Could not initialize poem database.");
rocket::build() rocket::build()
.mount("/images", FileServer::from("public/images")) .mount("/images", FileServer::from("public/images"))
.mount("/styles", FileServer::from("public/styles")) .mount("/styles", FileServer::from("public/styles"))

View File

@ -193,7 +193,7 @@ pub mod void_app {
PageBase { PageBase {
Title { title: "Settings".to_string(), is_html: false, user_prefs: user_prefs.clone() } Title { title: "Settings".to_string(), is_html: false, user_prefs: user_prefs.clone() }
BackToHomePage { theme: user_prefs.clone().get_theme(), font: user_prefs.clone().get_font() } BackToHomePage { theme: user_prefs.clone().get_theme(), font: user_prefs.clone().get_font() }
div { class: "p-4 flex flex-col space-y-4 mx-auto max-w-full justify-center", div { class: "flex flex-col justify-center max-w-full p-4 mx-auto space-y-4",
div { class: "p-4 flex flex-col space-y-4 text-xl text-center ring-4 {user_theme_card} {user_font_card}", div { class: "p-4 flex flex-col space-y-4 text-xl text-center ring-4 {user_theme_card} {user_font_card}",
p { p {
"Theme" "Theme"