diff --git a/Cargo.lock b/Cargo.lock index 6aed8d8e..851f47f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4331,7 +4331,7 @@ dependencies = [ [[package]] name = "ore-app" -version = "0.0.8" +version = "0.0.9" dependencies = [ "async-std", "async-tungstenite", diff --git a/Cargo.toml b/Cargo.toml index 284cb5c2..77537e5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ore-app" -version = "0.0.8" +version = "0.0.9" description = "Ore is a digital currency you can mine from anywhere, at home or on your phone." edition = "2021" license = "Apache-2.0" @@ -11,7 +11,7 @@ readme = "./README.md" keywords = ["solana", "crypto", "mining"] [features] -default = ["web"] +default = [] bundle = [] desktop = [ "async-tungstenite", @@ -108,7 +108,7 @@ solana-extra-wasm = { version = "1.17.4", git = "https://github.com/HardhatChad/ [package.metadata.bundle] name = "Ore" identifier = "com.ore.app" -version = "0.0.8" +version = "0.0.9" resources = ["public"] copyright = "Copyright (c) Hardhat Chad 2024. All rights reserved." category = "Finance" diff --git a/src/components/download.rs b/src/components/download.rs index 6c218056..34060397 100644 --- a/src/components/download.rs +++ b/src/components/download.rs @@ -4,7 +4,7 @@ use dioxus::prelude::*; use crate::components::CodeBlock; const DESKTOP_DOWNLOAD_MAC: &str = - "https://github.com/HardhatChad/ore-app/releases/download/0.0.8/Ore-MacOS.zip"; + "https://github.com/HardhatChad/ore-app/releases/download/0.0.9/Ore-MacOS.zip"; #[component] pub fn Download(cx: Scope) -> Element { diff --git a/src/components/navbar.rs b/src/components/navbar.rs index e3987d0f..2d791083 100644 --- a/src/components/navbar.rs +++ b/src/components/navbar.rs @@ -4,16 +4,23 @@ use dioxus_router::prelude::*; use crate::{ components::{Banner, BannerType, Footer, OreLogoIcon, OreWordmarkIcon, PieIcon, UserBubble}, gateway::AsyncResult, - hooks::use_ping, + hooks::{use_appearance, use_ping}, route::Route, }; +use super::Appearance; + #[component] pub fn Navbar(cx: Scope) -> Element { let ping = use_ping(cx); + let appearance = use_appearance(cx); + let dark = match *appearance.read() { + Appearance::Dark => "dark", + Appearance::Light => "", + }; render! { div { - class: "relative min-h-screen flex flex-col text-black dark:bg-black dark:text-white", + class: "relative min-h-screen flex flex-col text-black dark:bg-black dark:text-white {dark}", if let AsyncResult::Error(_) = ping { render! { Banner { diff --git a/src/hooks/use_sol_balance.rs b/src/hooks/use_sol_balance.rs index 0a4d4d10..58faf83c 100644 --- a/src/hooks/use_sol_balance.rs +++ b/src/hooks/use_sol_balance.rs @@ -1,6 +1,6 @@ use dioxus::prelude::*; use dioxus_std::utils::rw::use_rw; -#[cfg(feature = "deskstop")] +#[cfg(feature = "desktop")] use std::time::Duration; #[cfg(feature = "web")] use web_time::Duration; diff --git a/src/main.rs b/src/main.rs index f4bb0a17..843c46c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,26 +66,6 @@ fn App(cx: Scope) -> Element { use_ore_balance_provider(cx); use_sol_balance_provider(cx); - // Dark mode appearance - #[cfg(feature = "web")] - { - let appearance = use_appearance(cx); - use_effect(cx, appearance, |_| { - if let Some(window) = window() { - if let Some(document) = window.document() { - if let Some(body) = document.body() { - let classname = match *appearance.read() { - Appearance::Dark => "dark", - Appearance::Light => "", - }; - body.set_class_name(classname); - } - } - } - async move {} - }); - } - // Render render! { Router:: {}