diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-04-29 01:09:02 +0200 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-05-29 11:16:14 +0200 |
commit | 2ec8991325d52ddefbda0c6e480f368340c642ca (patch) | |
tree | cbba591690d00bfdb69df8e313fa628682f24a14 | |
parent | 9552633c811c4aeb6841f8ab83b960b4835cb86e (diff) |
feat: allow adding item to playlist from bookmark page
-rw-r--r-- | src/frontend/tubo/components/items.cljs | 16 |
1 files changed, 8 insertions, 8 deletions
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] |