* hoist example projects, remove oidc * move over example projects from the separate repo * Update ecommerce site to the latest version of dioxus * update wifi scanner to 0.5 * drop the chatbot example; might be restored in a separate PR --------- Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
25 lines
601 B
Rust
25 lines
601 B
Rust
// The homepage is statically rendered, so we don't need to a persistent websocket connection.
|
|
|
|
use crate::{
|
|
api::{fetch_products, Sort},
|
|
components::nav,
|
|
components::product_item::product_item,
|
|
};
|
|
use dioxus::prelude::*;
|
|
|
|
pub(crate) fn Home() -> Element {
|
|
let products = use_server_future(|| fetch_products(10, Sort::Ascending))?;
|
|
let products = products().unwrap()?;
|
|
|
|
rsx! {
|
|
nav::nav {}
|
|
section { class: "p-10",
|
|
for product in products {
|
|
product_item {
|
|
product
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|