Skip to content

Commit

Permalink
Simple now playing display
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Apr 27, 2024
1 parent 2a1e841 commit 0ef96a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ let app _idb =
El.txt' ("click" ^ string_of_int pl)));
])
in
let player = P.make () in
let status =
Elwd.div
~at:[ `P (At.style (Jstr.v "grid-column:1/-1")) ]
[ `P (El.h1 [ El.txt' "Welcome to OCAMIX" ]); `R (Servers.ui ()) ]
in
let player_ui =
let player = P.make () in
Elwd.div ~at:[ `P (At.style (Jstr.v "grid-column:1/-1")) ] [ `R player ]
in
let f_search =
Expand Down
7 changes: 6 additions & 1 deletion bin/player.ml
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,10 @@ struct
Brr_lwd_ui.Button.v ~ev:[ `P (Elwd.handler Ev.click next) ] (`P "NEXT")
in
let at = [ `P (At.class' (Jstr.v "player-wrapper")) ] in
Elwd.div ~at [ `P audio_elt; `R btn_next ]
let now_playing =
Lwd.map (Lwd.get now_playing) ~f:(function
| None -> El.txt' "Nothing playing"
| Some { item = { name; _ }; _ } -> El.txt' name)
in
Elwd.div ~at [ `R now_playing; `P audio_elt; `R btn_next ]
end

0 comments on commit 0ef96a3

Please sign in to comment.