Use new DashboardRow / DashboardTile in artist and profile pages
Some checks failed
Push Workflows / docs (push) Successful in 42s
Push Workflows / test (push) Successful in 43s
Push Workflows / leptos-test (push) Successful in 1m13s
Push Workflows / build (push) Successful in 1m15s
Push Workflows / docker-build (push) Successful in 5m54s
Push Workflows / nix-build (push) Has been cancelled
Some checks failed
Push Workflows / docs (push) Successful in 42s
Push Workflows / test (push) Successful in 43s
Push Workflows / leptos-test (push) Successful in 1m13s
Push Workflows / build (push) Successful in 1m15s
Push Workflows / docker-build (push) Successful in 5m54s
Push Workflows / nix-build (push) Has been cancelled
This commit is contained in:
parent
a50ac59cfe
commit
e01e302fa5
@ -146,7 +146,6 @@ fn TopSongsByArtist(#[prop(into)] artist_id: MaybeSignal<i32>) -> impl IntoView
|
||||
#[component]
|
||||
fn AlbumsByArtist(#[prop(into)] artist_id: MaybeSignal<i32>) -> impl IntoView {
|
||||
use crate::components::dashboard_row::*;
|
||||
use crate::components::dashboard_tile::*;
|
||||
|
||||
let albums = create_resource(move || artist_id.get(), |artist_id| async move {
|
||||
let albums = albums_by_artist(artist_id, None).await;
|
||||
@ -173,9 +172,13 @@ fn AlbumsByArtist(#[prop(into)] artist_id: MaybeSignal<i32>) -> impl IntoView {
|
||||
>
|
||||
{move || albums.get().map(|albums| {
|
||||
albums.map(|albums| {
|
||||
DashboardRow::new("Albums".to_string(), albums.into_iter().map(|album| {
|
||||
Box::new(album) as Box<dyn DashboardTile>
|
||||
}).collect())
|
||||
let tiles = albums.into_iter().map(|album| {
|
||||
album.into()
|
||||
}).collect::<Vec<_>>();
|
||||
|
||||
view! {
|
||||
<DashboardRow title="Albums" tiles />
|
||||
}
|
||||
})
|
||||
})}
|
||||
</ErrorBoundary>
|
||||
|
@ -4,7 +4,6 @@ use leptos_icons::*;
|
||||
use server_fn::error::NoCustomError;
|
||||
|
||||
use crate::components::dashboard_row::DashboardRow;
|
||||
use crate::components::dashboard_tile::DashboardTile;
|
||||
use crate::components::song_list::*;
|
||||
use crate::components::loading::*;
|
||||
use crate::components::error::*;
|
||||
@ -303,10 +302,12 @@ fn TopArtists(#[prop(into)] user_id: MaybeSignal<i32>) -> impl IntoView {
|
||||
top_artists.get().map(|top_artists| {
|
||||
top_artists.map(|top_artists| {
|
||||
let tiles = top_artists.into_iter().map(|artist| {
|
||||
Box::new(artist) as Box<dyn DashboardTile>
|
||||
artist.into()
|
||||
}).collect::<Vec<_>>();
|
||||
|
||||
DashboardRow::new(format!("Top Artists {}", HISTORY_MESSAGE), tiles)
|
||||
view! {
|
||||
<DashboardRow title=format!("Top Artists {}", HISTORY_MESSAGE) tiles />
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user