Use head elements and new manganis syntax in examples (#2688)

* use head elements and new manganis syntax in examples
* only enable desktop workspace example scraping during a dioxus release

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Evan AlmloffandJonathan Kelley authored and GitHub committed 2024-07-25 21:58:00 +00:00
1 parent bd58a92441
commit c6a2e5b6c8
31 files changed
+379 -374

No files matched your search

+5 -8
View File
@@ -14,25 +14,22 @@ fn main() {
.launch(app)
}
#[cfg(not(feature = "collect-assets"))]
const _STYLE: &str = include_str!("../examples/assets/fileexplorer.css");
#[cfg(feature = "collect-assets")]
const _STYLE: &str = manganis::mg!(file("./examples/assets/fileexplorer.css"));
fn app() -> Element {
let mut files = use_signal(Files::new);
rsx! {
head::Link {
rel: "stylesheet",
href: asset!("./examples/assets/fileexplorer.css")
}
div {
link { href:"https://fonts.googleapis.com/icon?family=Material+Icons", rel:"stylesheet" }
head::Link { href: "https://fonts.googleapis.com/icon?family=Material+Icons", rel: "stylesheet" }
header {
i { class: "material-icons icon-menu", "menu" }
h1 { "Files: " {files.read().current()} }
span { }
i { class: "material-icons", onclick: move |_| files.write().go_up(), "logout" }
}
style { "{_STYLE}" }
main {
for (dir_id, path) in files.read().path_names.iter().enumerate() {
{