From 2ec8991325d52ddefbda0c6e480f368340c642ca Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Mon, 29 Apr 2024 01:09:02 +0200 Subject: feat: allow adding item to playlist from bookmark page --- src/frontend/tubo/components/items.cljs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/tubo/components/items.cljs b/src/frontend/tubo/components/items.cljs index 224fdf3..6777ad7 100644 --- a/src/frontend/tubo/components/items.cljs +++ b/src/frontend/tubo/components/items.cljs @@ -26,16 +26,16 @@ :icon [:i.fa-solid.fa-tower-cell] :on-click #(rf/dispatch [::events/start-stream-radio item])} {:label (if liked? "Remove favorite" "Favorite") - :icon [:i.fa-solid.fa-heart (when liked? {:style {:color (utils/get-service-color service-id)}})] - :on-click #(rf/dispatch [(if liked? ::events/remove-from-likes ::events/add-to-likes) item])} - (if (some #(= (:url %) url) (:items (first (filter #(= (:id %) bookmark-id) bookmarks)))) + :icon [:i.fa-solid.fa-heart (when (and liked? service-id) {:style {:color (utils/get-service-color service-id)}})] + :on-click #(rf/dispatch [(if liked? ::events/remove-from-likes ::events/add-to-likes) item true])} + {:label "Add to playlist" + :icon [:i.fa-solid.fa-plus] + :on-click #(rf/dispatch [::events/add-bookmark-list-modal + [bookmarks/add-to-bookmark-list-modal item]])} + (when (some #(= (:url %) url) (:items (first (filter #(= (:id %) bookmark-id) bookmarks)))) {:label "Remove from playlist" :icon [:i.fa-solid.fa-trash] - :on-click #(rf/dispatch [::events/remove-from-bookmark-list item])} - {:label "Add to playlist" - :icon [:i.fa-solid.fa-plus] - :on-click #(rf/dispatch [::events/add-bookmark-list-modal - [bookmarks/add-to-bookmark-list-modal item]])})] + :on-click #(rf/dispatch [::events/remove-from-bookmark-list item])})] [(when (and bookmarks (some #(= (:id %) bookmark-id) (rest bookmarks))) {:label "Remove playlist" :icon [:i.fa-solid.fa-trash] -- cgit v1.2.3