🎨 Review layout composition with Flex components

This commit is contained in:
Manuel Cillero 2024-03-18 00:00:50 +01:00
parent dfbe807a61
commit 4c026e696b
19 changed files with 658 additions and 674 deletions

View file

@ -0,0 +1,25 @@
use crate::prelude::*;
#[derive(AutoDefault)]
pub struct Html(Markup);
impl ComponentTrait for Html {
fn new() -> Self {
Html::default()
}
fn prepare_component(&self, _cx: &mut Context) -> PrepareMarkup {
PrepareMarkup::With(html! { (self.0) })
}
}
impl Html {
pub fn with(html: Markup) -> Self {
Html(html)
}
pub fn alter_html(&mut self, html: Markup) -> &mut Self {
self.0 = html;
self
}
}