Small changes to examples

This commit is contained in:
Greg Johnston 2022-12-21 07:56:33 -05:00
parent 7ca131c5b8
commit 2f218e7428
3 changed files with 18 additions and 20 deletions

View file

@ -151,10 +151,8 @@ fn Story(cx: Scope, story: api::Story) -> impl IntoView {
}}
</span>
{(story.story_type != "link").then(|| view! { cx,
<span>
//{" "}
<span class="label">{story.story_type}</span>
</span>
" "
<span class="label">{story.story_type}</span>
})}
</li>
}

View file

@ -20,7 +20,7 @@ pub fn Story(cx: Scope) -> impl IntoView {
let meta_description = move || story.read().and_then(|story| story.map(|story| story.title.clone())).unwrap_or_else(|| "Loading story...".to_string());
view! { cx,
<div>
<>
<Meta name="description" content=meta_description/>
{move || story.read().map(|story| match story {
None => view! { cx, <div class="item-view">"Error loading this story."</div> },
@ -58,7 +58,7 @@ pub fn Story(cx: Scope) -> impl IntoView {
</div>
</div>
}})}
</div>
</>
}
}

View file

@ -92,20 +92,20 @@ pub fn TodoApp(cx: Scope) -> impl IntoView {
view! {
cx,
<div>
<Stylesheet href="/style.css"/>
<Router>
<header>
<h1>"My Tasks"</h1>
</header>
<main>
<Routes>
<Route path="" element=|cx| view! {
cx,
<Todos/>
}/>
</Routes>
</main>
</Router>
<Stylesheet href="/style.css"/>
<Router>
<header>
<h1>"My Tasks"</h1>
</header>
<main>
<Routes>
<Route path="" element=|cx| view! {
cx,
<Todos/>
}/>
</Routes>
</main>
</Router>
</div>
}
}