Skip to content

Commit

Permalink
fix: Use use_applied_theme in devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Sep 30, 2024
1 parent 9b789d0 commit 3a66de3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/devtools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use freya_components::*;
use freya_core::prelude::EventMessage;
use freya_elements::elements as dioxus_elements;
use freya_hooks::{
use_applied_theme,
use_init_theme,
use_platform,
DARK_THEME,
Expand Down Expand Up @@ -116,15 +117,15 @@ impl PartialEq for DevToolsProps {

#[allow(non_snake_case)]
pub fn DevTools(props: DevToolsProps) -> Element {
let theme = use_init_theme(|| DARK_THEME);
use_init_theme(|| DARK_THEME);
use_init_radio_station::<DevtoolsState, DevtoolsChannel>(|| DevtoolsState {
hovered_node: props.hovered_node.clone(),
devtools_receiver: props.devtools_receiver.clone(),
devtools_tree: HashSet::default(),
});

let theme = theme.read();
let color = &theme.body.color;
let theme = use_applied_theme!(None, body);
let color = &theme.color;

rsx!(
rect {
Expand Down

0 comments on commit 3a66de3

Please sign in to comment.