chore: fixes to autoformat to prevent double rendering of expr line

This commit is contained in:
Jonathan Kelley committed 2022-09-28 16:47:10 -07:00
1 parent 28fba42e7e
commit a37458b9fa
16 files changed
+203 -47

No files matched your search

+3 -3
View File
@@ -27,9 +27,7 @@ rsx! {
}
})
}
div { class: "px-4",
is_current.then(|| rsx!{ children })
}
div { class: "px-4", is_current.then(|| rsx!{ children }) }
}
// No nesting
@@ -47,4 +45,6 @@ rsx! {
let blah = 120;
}
}
div { asdbascasdbasd, asbdasbdabsd, asbdabsdbasdbas }
}
+38
View File
@@ -0,0 +1,38 @@
use dioxus::prelude::*;
#[inline_props]
pub fn Explainer<'a>(
cx: Scope<'a>,
invert: bool,
title: &'static str,
content: Element<'a>,
flasher: Element<'a>,
) -> Element {
// pt-5 sm:pt-24 lg:pt-24
let mut right = rsx! {
div { class: "relative w-1/2", flasher }
};
let align = match invert {
true => "mr-auto ml-16",
false => "ml-auto mr-16",
};
let mut left = rsx! {
div { class: "relative w-1/2 {align} max-w-md leading-8",
h2 { class: "mb-6 text-3xl leading-tight md:text-4xl md:leading-tight lg:text-3xl lg:leading-tight font-heading font-mono font-bold",
"{title}"
}
content
}
};
if *invert {
std::mem::swap(&mut left, &mut right);
}
cx.render(rsx! {
div { class: "flex flex-wrap items-center dark:text-white py-16 border-t font-light", left, right }
})
}
+14 -6
View File
@@ -1,9 +1,6 @@
rsx! {
div { "hello world!" }
div {
"hello world!"
"goodbye world!"
}
div { "hello world!", "goodbye world!" }
// Simple div
div { "hello world!" }
@@ -15,7 +12,16 @@ rsx! {
div { div { "nested" } }
// Nested two level
div { div { h1 { "highly nested" } } }
div {
div { h1 { "highly nested" } }
}
// Anti-Nested two level
div {
div {
div { h1 { "highly nested" } }
}
}
// Compression
h3 { class: "mb-2 text-xl font-bold", "Invite Member" }
@@ -30,7 +36,9 @@ rsx! {
img { class: "mb-6 mx-auto h-24", src: "artemis-assets/images/friends.png", alt: "" }
// One level compression
div { a { class: "py-2 px-3 bg-indigo-500 hover:bg-indigo-600 rounded text-xs text-white", href: "#", "Send invitation" } }
div {
a { class: "py-2 px-3 bg-indigo-500 hover:bg-indigo-600 rounded text-xs text-white", href: "#", "Send invitation" }
}
// Components
Component { ..Props {} }