use log::info;
use wasm_bindgen_test::wasm_bindgen_test;
use yew::{function_component, html, use_callback, Callback, Html, Renderer};
use textiler_core::prelude::*;
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
#[function_component]
fn App() -> Html {
let theme = yew::functional::use_mut_ref(|| Theme::default());
html! {
}
}
#[function_component]
fn Main() -> Html {
let theme = Theme::default();
let (mode, set_mode): (ThemeMode, Callback) = use_mode();
let onclick = {
use_callback(
mode.clone(),
move |_: yew::events::MouseEvent, mode| match mode {
ThemeMode::Light => set_mode.emit(ThemeMode::Dark),
ThemeMode::Dark | ThemeMode::System => set_mode.emit(ThemeMode::Light),
},
)
};
html! {
{"Hello, world"}
{r"Welcome to the happy style system, a better way of writing text in yew.
You can do many things with it, like "}{"outlining text"}{". \
Or maybe giving it a bit of "}{"color"}{"."}
{r###"{"Hello, world"}
{r"Welcome to the happy style system, a better way of writing text in yew.
You can do many things with it, like "}{"outlining text"}{"."}
"###}
}
}
#[wasm_bindgen_test]
async fn create_css() {
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
info!("starting test");
let handle = Renderer::::new().render();
}