Skip to content

Commit

Permalink
fix: put back jumbotron to a method
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanceras committed Apr 12, 2024
1 parent faab521 commit 01913c7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
3 changes: 0 additions & 3 deletions examples/js-performance-benchmark-sauron/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ crate-type = ["cdylib"]
[dependencies]
rand = { version = "0.8.5", features = ["small_rng"] }
getrandom = { version = "0.2.7", features = ["js"] }
#sauron = { path = "../../../sauron", features = ["with-debug", "with-measure", "log-patches"] }
sauron = { path = "../../../sauron", features = ["with-debug", "with-measure", "use-template", "use-skipdiff"] }
#sauron = { path = "../../../sauron", features = ["with-debug", "with-measure", "use-skipdiff"] }
#sauron = { path = "../../../sauron"}
log = "0.4"
console_log = "0.2"
console_error_panic_hook = "0.1"
Expand Down
31 changes: 20 additions & 11 deletions examples/js-performance-benchmark-sauron/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(warnings)]
use rand::prelude::*;
use sauron::dom::component;
use sauron::*;
use std::cmp::min;
use sauron::dom::component;

static ADJECTIVES: &[&str] = &[
"pretty",
Expand Down Expand Up @@ -174,8 +174,25 @@ impl Application for App {
Cmd::none()
}

view! {
view!{
<div class="container">
{self.view_jumbotron()}
<table class="table table-hover table-striped test-data">
<tbody id="tbody">
{for row in self.rows.iter() {
component(row)
}}
</tbody>
</table>
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
</div>
}
}


impl App{
fn view_jumbotron(&self) -> Node<Msg>{
node!{
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
Expand Down Expand Up @@ -242,15 +259,7 @@ impl Application for App {
</div>
</div>
</div>
<table class="table table-hover table-striped test-data">
<tbody id="tbody">
{for row in self.rows.iter() {
component(row)
}}
</tbody>
</table>
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
</div>
}
}
}

Expand Down

0 comments on commit 01913c7

Please sign in to comment.