feat(playlists): move the new-playlist input to the top of the rail
This commit is contained in:
parent
c010abd5a3
commit
c74ef1e632
1 changed files with 15 additions and 15 deletions
|
|
@ -580,6 +580,21 @@ export default function Playlists({ canWrite }: { canWrite: boolean }) {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<form
|
||||||
|
onSubmit={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
if (newName.trim()) createMut.mutate(newName.trim());
|
||||||
|
}}
|
||||||
|
className="flex items-center gap-1.5 mb-3 pb-3 border-b border-border"
|
||||||
|
>
|
||||||
|
<Plus className="w-4 h-4 text-muted shrink-0" />
|
||||||
|
<input
|
||||||
|
value={newName}
|
||||||
|
onChange={(e) => setNewName(e.target.value)}
|
||||||
|
placeholder={t("playlists.newPlaylist")}
|
||||||
|
className="flex-1 min-w-0 bg-card border border-border rounded-md px-2 py-1 text-xs outline-none focus:border-accent"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
{playlists.length === 0 && !listQuery.isLoading && (
|
{playlists.length === 0 && !listQuery.isLoading && (
|
||||||
<div className="text-xs text-muted px-1 py-2">{t("playlists.noneYet")}</div>
|
<div className="text-xs text-muted px-1 py-2">{t("playlists.noneYet")}</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -618,21 +633,6 @@ export default function Playlists({ canWrite }: { canWrite: boolean }) {
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<form
|
|
||||||
onSubmit={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
if (newName.trim()) createMut.mutate(newName.trim());
|
|
||||||
}}
|
|
||||||
className="flex items-center gap-1.5 mt-3 pt-3 border-t border-border"
|
|
||||||
>
|
|
||||||
<Plus className="w-4 h-4 text-muted shrink-0" />
|
|
||||||
<input
|
|
||||||
value={newName}
|
|
||||||
onChange={(e) => setNewName(e.target.value)}
|
|
||||||
placeholder={t("playlists.newPlaylist")}
|
|
||||||
className="flex-1 min-w-0 bg-card border border-border rounded-md px-2 py-1 text-xs outline-none focus:border-accent"
|
|
||||||
/>
|
|
||||||
</form>
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<main className="flex-1 min-w-0 overflow-y-auto p-4">
|
<main className="flex-1 min-w-0 overflow-y-auto p-4">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue