mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 10:43:39 +02:00
Add tabs for newest and starred tracks
This commit is contained in:
parent
7653af5dd1
commit
2545ff3579
5 changed files with 40 additions and 20 deletions
21
src/cljs/airsonic_ui/components/library/views.cljs
Normal file
21
src/cljs/airsonic_ui/components/library/views.cljs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
(ns airsonic-ui.components.library.views
|
||||
(:require [airsonic-ui.routes :as routes :refer [url-for]]
|
||||
[airsonic-ui.views.album :as album]))
|
||||
|
||||
(defn tabs [items active-item]
|
||||
[:div.tabs
|
||||
[:ul (for [[idx [route label]] (map-indexed vector items)]
|
||||
(do
|
||||
(println route label active-item)
|
||||
^{:key idx} [:li (when (= route active-item)
|
||||
{:class-name "is-active"})
|
||||
[:a {:href (apply url-for route)} label]]))]])
|
||||
|
||||
(defn main [route {:keys [album-list]}]
|
||||
[:div
|
||||
[:h2.title "Your library"]
|
||||
(let [items [[[::routes/library {:criteria "recent"} nil] "Recently played"]
|
||||
[[::routes/library {:criteria "newest"} nil] "Newest additions"]
|
||||
[[::routes/library {:criteria "starred"} nil] "Starred"]]]
|
||||
[tabs items route])
|
||||
[album/listing (:album album-list)]])
|
||||
Loading…
Add table
Add a link
Reference in a new issue