Skip to content

Commit 8781f9f

Browse files
committed
dark mode on desktop
1 parent 581934c commit 8781f9f

File tree

6 files changed

+15
-28
lines changed

6 files changed

+15
-28
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ore-app"
3-
version = "0.0.8"
3+
version = "0.0.9"
44
description = "Ore is a digital currency you can mine from anywhere, at home or on your phone."
55
edition = "2021"
66
license = "Apache-2.0"
@@ -11,7 +11,7 @@ readme = "./README.md"
1111
keywords = ["solana", "crypto", "mining"]
1212

1313
[features]
14-
default = ["web"]
14+
default = []
1515
bundle = []
1616
desktop = [
1717
"async-tungstenite",
@@ -108,7 +108,7 @@ solana-extra-wasm = { version = "1.17.4", git = "https://github.com/HardhatChad/
108108
[package.metadata.bundle]
109109
name = "Ore"
110110
identifier = "com.ore.app"
111-
version = "0.0.8"
111+
version = "0.0.9"
112112
resources = ["public"]
113113
copyright = "Copyright (c) Hardhat Chad 2024. All rights reserved."
114114
category = "Finance"

src/components/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use dioxus::prelude::*;
44
use crate::components::CodeBlock;
55

66
const DESKTOP_DOWNLOAD_MAC: &str =
7-
"https://github.com/HardhatChad/ore-app/releases/download/0.0.8/Ore-MacOS.zip";
7+
"https://github.com/HardhatChad/ore-app/releases/download/0.0.9/Ore-MacOS.zip";
88

99
#[component]
1010
pub fn Download(cx: Scope) -> Element {

src/components/navbar.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@ use dioxus_router::prelude::*;
44
use crate::{
55
components::{Banner, BannerType, Footer, OreLogoIcon, OreWordmarkIcon, PieIcon, UserBubble},
66
gateway::AsyncResult,
7-
hooks::use_ping,
7+
hooks::{use_appearance, use_ping},
88
route::Route,
99
};
1010

11+
use super::Appearance;
12+
1113
#[component]
1214
pub fn Navbar(cx: Scope) -> Element {
1315
let ping = use_ping(cx);
16+
let appearance = use_appearance(cx);
17+
let dark = match *appearance.read() {
18+
Appearance::Dark => "dark",
19+
Appearance::Light => "",
20+
};
1421
render! {
1522
div {
16-
class: "relative min-h-screen flex flex-col text-black dark:bg-black dark:text-white",
23+
class: "relative min-h-screen flex flex-col text-black dark:bg-black dark:text-white {dark}",
1724
if let AsyncResult::Error(_) = ping {
1825
render! {
1926
Banner {

src/hooks/use_sol_balance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use dioxus::prelude::*;
22
use dioxus_std::utils::rw::use_rw;
3-
#[cfg(feature = "deskstop")]
3+
#[cfg(feature = "desktop")]
44
use std::time::Duration;
55
#[cfg(feature = "web")]
66
use web_time::Duration;

src/main.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,6 @@ fn App(cx: Scope) -> Element {
6666
use_ore_balance_provider(cx);
6767
use_sol_balance_provider(cx);
6868

69-
// Dark mode appearance
70-
#[cfg(feature = "web")]
71-
{
72-
let appearance = use_appearance(cx);
73-
use_effect(cx, appearance, |_| {
74-
if let Some(window) = window() {
75-
if let Some(document) = window.document() {
76-
if let Some(body) = document.body() {
77-
let classname = match *appearance.read() {
78-
Appearance::Dark => "dark",
79-
Appearance::Light => "",
80-
};
81-
body.set_class_name(classname);
82-
}
83-
}
84-
}
85-
async move {}
86-
});
87-
}
88-
8969
// Render
9070
render! {
9171
Router::<Route> {}

0 commit comments

Comments
 (0)