WIP Working on player

This commit is contained in:
Mistral Vibe
2026-04-08 08:12:05 +00:00
parent ff4985a719
commit d654ad5987
16 changed files with 1714 additions and 94 deletions

View File

@@ -1,4 +1,5 @@
import { useNavigate, useLocation, matchPath } from "react-router-dom";
import { usePlayerStore } from "../stores/playerStore";
// ── Icons (inline SVG) ──────────────────────────────────────────────────────
function IconLibrary() {
@@ -9,6 +10,14 @@ function IconLibrary() {
);
}
function IconPlay() {
return (
<svg width="20" height="20" viewBox="0 0 14 14" fill="currentColor">
<path d="M3 2l9 5-9 5V2z" />
</svg>
);
}
function IconSettings() {
@@ -85,6 +94,10 @@ export function BottomNavBar() {
const isLibrary = !!matchPath("/bands/:bandId", location.pathname) ||
!!matchPath("/bands/:bandId/sessions/:sessionId", location.pathname);
const isSettings = location.pathname.startsWith("/settings");
// Player state
const { currentSongId, currentBandId: playerBandId, isPlaying } = usePlayerStore();
const hasActiveSong = !!currentSongId && !!playerBandId;
return (
<nav
@@ -115,6 +128,18 @@ export function BottomNavBar() {
}}
/>
<NavItem
icon={<IconPlay />}
label="Player"
active={hasActiveSong && isPlaying}
onClick={() => {
if (hasActiveSong) {
navigate(`/bands/${playerBandId}/songs/${currentSongId}`);
}
}}
disabled={!hasActiveSong}
/>
<NavItem
icon={<IconMembers />}
label="Members"