Feat: use rsx! inline!
This commit is contained in:
1 parent
0aab659a06
commit
44aad2746c
3 files changed
+159
-171
No files matched your search
@@ -20,35 +20,28 @@ impl<'a, G> Blah for LazyNodes<'a, G> where G: for<'b> FnOnce(&'b NodeCtx<'a>) -
|
||||
|
||||
static App: FC<AppProps> = |ctx, props| {
|
||||
//
|
||||
let body = match props.route {
|
||||
Routes::Homepage => ctx.render(rsx!(
|
||||
div {
|
||||
Homepage {}
|
||||
}
|
||||
)),
|
||||
Routes::ExampleList => ctx.render(rsx!(
|
||||
div {
|
||||
ExampleList {}
|
||||
}
|
||||
)),
|
||||
let body = rsx! {
|
||||
div {}
|
||||
};
|
||||
|
||||
let top = rsx! {
|
||||
div {}
|
||||
};
|
||||
|
||||
ctx.render(rsx!(
|
||||
div {
|
||||
Header {}
|
||||
{body}
|
||||
{
|
||||
}
|
||||
Footer {}
|
||||
{top}
|
||||
{rsx!{
|
||||
div {
|
||||
"you ugl"
|
||||
}
|
||||
}}
|
||||
}
|
||||
))
|
||||
};
|
||||
|
||||
#[derive(Debug, PartialEq, Props)]
|
||||
struct HeaderProp {
|
||||
selected: Routes,
|
||||
}
|
||||
|
||||
static Header: FC<()> = |ctx, _| {
|
||||
ctx.render(rsx! {
|
||||
div {
|
||||
@@ -56,27 +49,3 @@ static Header: FC<()> = |ctx, _| {
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
static Footer: FC<()> = |ctx, _| {
|
||||
ctx.render(rsx! {
|
||||
div {
|
||||
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
static Homepage: FC<()> = |ctx, _| {
|
||||
ctx.render(rsx! {
|
||||
div {
|
||||
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
static ExampleList: FC<()> = |ctx, _| {
|
||||
ctx.render(rsx! {
|
||||
div {
|
||||
|
||||
}
|
||||
})
|
||||
};
|
||||
Reference in new issue
Block a user