Skip to content

Instantly share code, notes, and snippets.

@Enigo
Last active April 19, 2023 04:12
Show Gist options
  • Save Enigo/5be7e53059c7d424ddaa3481845ae5dc to your computer and use it in GitHub Desktop.
Save Enigo/5be7e53059c7d424ddaa3481845ae5dc to your computer and use it in GitHub Desktop.
...
#[function_component(Home)]
pub fn home_function_component() -> Html {
...
let collections = collections.iter().map(|collection| html! {
<div class="col text-center">
<Link<Route> to={Route::Collection {token_address: collection.address.clone()} } classes="img-fluid">
<img src={collection.collection_image_url.clone()} class="img-fluid" width="250" height="250" alt={collection.name.clone()}/>
</Link<Route>>
<p class="text-white">{collection.name.clone()}</p>
</div>
}).collect::<Html>();
return html! {
<div class="container mt-4">
<div class="row justify-content-md-center">
{ collections }
</div>
</div>
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment