stoptime-rs/ui/src/components.rs

52 lines
1.7 KiB
Rust
Raw Normal View History

use yew::prelude::*;
pub struct Root;
impl Component for Root {
type Message = ();
type Properties = ();
fn create(_props: Self::Properties, _complink: ComponentLink<Self>) -> Self {
Root
}
fn update(&mut self, _msg: Self::Message) -> ShouldRender {
false
}
}
impl Renderable<Root> for Root {
fn view(&self) -> Html<Self> {
html! {
<>
<nav class=("navbar", "navbar-expand-md", "fixed-top", "navbar-dark", "bg-dark",
"text-light"),
role="navigation">
<div class="container">
<a class=("navbar-brand") href="#">{ "StopTime" }</a>
<button class="navbar-toggler",
type="button",
data-toggle="collapse",
data-target="#navbarNav",
aria-controls="navbarNav",
aria-expanded="false",
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"/>
</button>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<h1>{ "Hello world!" }</h1>
</div>
</div>
<footer class=("footer", "bg-dark", "text-light")>
<div class=("container", "text-center")>
<small>{ "StopTime © 2019 Paul van Tilburg" }</small>
</div>
</footer>
</>
}
}
}