Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
fix theme
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelleyrtp committed Feb 4, 2025
1 parent 0e77d14 commit 475783a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
16 changes: 1 addition & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@ dioxus-autofmt = "0.6.2"
dioxus-dx-wire-format = "0.6.2"
dioxus-logger = "0.6.2"

# Dioxus Main
# dioxus = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-document = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-sdk = { git = "https://github.com/dioxuslabs/sdk", branch = "nightly" }
# dioxus-core = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-core-types = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-devtools = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-rsx-hotreload = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-html = { git = "https://github.com/dioxuslabs/dioxus", default-features = false }
# dioxus-rsx-rosetta = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-dx-wire-format = { git = "https://github.com/dioxuslabs/dioxus" }
# dioxus-logger = { git = "https://github.com/dioxuslabs/dioxus" }

serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.133"
futures = "0.3.30"
Expand All @@ -48,6 +33,7 @@ axum = { version = "0.7.5" }

thiserror = "2.0.4"


[profile]

[profile.wasm-dev]
Expand Down
5 changes: 4 additions & 1 deletion playground/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dioxus-document = { workspace = true }
dioxus-sdk = { workspace = true, features = [
"window_size",
"timing",
"system_theme",
] }

# Hot reload / Paste as RSX
Expand All @@ -44,3 +43,7 @@ proc-macro2 = "1.0.89"


example-projects = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
dioxus-sdk = { version = "0.6", default-features = false, features = ["system_theme", "window_size",
"timing",] }
3 changes: 3 additions & 0 deletions playground/src/editor/monaco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ use model::{CargoDiagnostic, CargoLevel};
use serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;

#[cfg(target_arch = "wasm32")]
use dioxus_sdk::theme::{use_system_theme, SystemTheme};

/// Get the path prefix for the `/vs` folder inside the Monaco folder.
pub fn monaco_vs_prefix(folder: Asset) -> String {
let monaco_vs_prefix = format!("{}/vs", folder);
Expand Down
9 changes: 5 additions & 4 deletions playground/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ use components::icons::Warning;
use dioxus::logger::tracing::error;
use dioxus::prelude::*;
use dioxus_document::Link;
use dioxus_sdk::{
theme::{use_system_theme, SystemTheme},
utils::timing::use_debounce,
};
use dioxus_sdk::utils::timing::use_debounce;
use editor::monaco::{self, monaco_loader_src, set_monaco_markers};
use example_projects::ExampleProject;
use hotreload::{attempt_hot_reload, HotReload};
// use snippets::use_provide_selected_example;
use std::time::Duration;

#[cfg(target_arch = "wasm32")]
use dioxus_sdk::theme::{use_system_theme, SystemTheme};

mod build;
mod components;
mod editor;
Expand Down Expand Up @@ -69,6 +69,7 @@ pub fn Playground(
use_effect(move || set_monaco_markers(build.diagnostics()));

// Themes
#[cfg(target_arch = "wasm32")]
let system_theme = use_system_theme();
use_effect(move || {
#[cfg(target_arch = "wasm32")]
Expand Down

0 comments on commit 475783a

Please sign in to comment.