From 3869ae4844ced9aaac170705038ee1b657d2aabe Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Sat, 30 May 2026 23:26:57 -0400 Subject: [PATCH] feat: basic library UI and sidebar --- .gitignore | 2 + app/layout.tsx | 9 +- app/library/albums/page.tsx | 83 +++++++++++++++++ app/library/artists/page.tsx | 83 +++++++++++++++++ app/library/recently-added/page.tsx | 43 +++++++++ app/page.tsx | 46 +++++++--- components/album-card.tsx | 48 ++++++++++ components/app-sidebar.tsx | 135 ++++++++++++++++++++++++++++ components/player-bar.tsx | 60 +++++++++++++ public/logo.svg | 1 + public/placeholder-album.svg | 13 +++ 11 files changed, 511 insertions(+), 12 deletions(-) create mode 100644 app/library/albums/page.tsx create mode 100644 app/library/artists/page.tsx create mode 100644 app/library/recently-added/page.tsx create mode 100644 components/album-card.tsx create mode 100644 components/app-sidebar.tsx create mode 100644 components/player-bar.tsx create mode 100644 public/logo.svg create mode 100644 public/placeholder-album.svg diff --git a/.gitignore b/.gitignore index c59e98a..7355cae 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ pnpm-debug.log* # typescript *.tsbuildinfo next-env.d.ts + +/.idea \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index a4c7321..0bd436f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,8 @@ import { Geist, Geist_Mono, Inter } from "next/font/google" import "./globals.css" import { ThemeProvider } from "@/components/theme-provider" import { cn } from "@/lib/utils"; +import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar" +import { AppSidebar } from "@/components/app-sidebar" const inter = Inter({subsets:['latin'],variable:'--font-sans'}) @@ -23,7 +25,12 @@ export default function RootLayout({ className={cn("antialiased", fontMono.variable, "font-sans", inter.variable)} > - {children} + + + + {children} + + ) diff --git a/app/library/albums/page.tsx b/app/library/albums/page.tsx new file mode 100644 index 0000000..592d839 --- /dev/null +++ b/app/library/albums/page.tsx @@ -0,0 +1,83 @@ +import { AlbumCard, type Album } from "@/components/album-card" +import { PlayerBar } from "@/components/player-bar" + +const page: Album[] = [ + { title: "Live from the Hollywood Bowl", artist: "AJR", cover: null }, + { title: "Ends of the Earth", artist: "The Longest Johns", cover: null }, + { title: "The Parting Glass - Single", artist: "The Ramparts", cover: null }, + { + title: "Fairytale of New York - Single", + artist: "The Ramparts", + cover: null, + }, + { + title: "The Rocky Road to Dublin - Single", + artist: "The Ramparts", + cover: null, + }, + { title: "1778 - EP", artist: "The Wellermen", cover: null }, + { title: "The High Kings", artist: "The High Kings", cover: null }, + { title: "The Fall-Off", artist: "J. Cole", cover: null }, + { title: "Enchanted Isle", artist: "VOCES8", cover: null }, + { title: "Unknown Album", artist: "", cover: null }, + { + title: "Song of Durin (Complete Edition)", + artist: "Clamavi De Profundis", + cover: null, + }, + { + title: "Sid Meier's Civilization V (Soundtrack)", + artist: "Geoff Knorr & Michael Curran", + cover: null, + }, + { + title: "The Last Goodbye - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "Do You Hear the People Sing? - Single", + artist: "Seth Staton Watkins & Aaron Dolan", + cover: null, + }, + { + title: "Fiddler's Green - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "The Orange and the Green - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "Horse Soldier, Horse Soldier - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "My Mother Told Me (feat. 3lake) - Single", + artist: "Seth Staton Watkins", + cover: null, + }, +] + +export default function Page() { + return ( +
+
+

Albums

+
+ +
+
+ {page.map((album) => ( + + ))} +
+
+ + +
+ ) +} diff --git a/app/library/artists/page.tsx b/app/library/artists/page.tsx new file mode 100644 index 0000000..3a1a7aa --- /dev/null +++ b/app/library/artists/page.tsx @@ -0,0 +1,83 @@ +import { AlbumCard, type Album } from "@/components/album-card" +import { PlayerBar } from "@/components/player-bar" + +const page: Album[] = [ + { title: "Live from the Hollywood Bowl", artist: "AJR", cover: null }, + { title: "Ends of the Earth", artist: "The Longest Johns", cover: null }, + { title: "The Parting Glass - Single", artist: "The Ramparts", cover: null }, + { + title: "Fairytale of New York - Single", + artist: "The Ramparts", + cover: null, + }, + { + title: "The Rocky Road to Dublin - Single", + artist: "The Ramparts", + cover: null, + }, + { title: "1778 - EP", artist: "The Wellermen", cover: null }, + { title: "The High Kings", artist: "The High Kings", cover: null }, + { title: "The Fall-Off", artist: "J. Cole", cover: null }, + { title: "Enchanted Isle", artist: "VOCES8", cover: null }, + { title: "Unknown Album", artist: "", cover: null }, + { + title: "Song of Durin (Complete Edition)", + artist: "Clamavi De Profundis", + cover: null, + }, + { + title: "Sid Meier's Civilization V (Soundtrack)", + artist: "Geoff Knorr & Michael Curran", + cover: null, + }, + { + title: "The Last Goodbye - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "Do You Hear the People Sing? - Single", + artist: "Seth Staton Watkins & Aaron Dolan", + cover: null, + }, + { + title: "Fiddler's Green - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "The Orange and the Green - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "Horse Soldier, Horse Soldier - Single", + artist: "Seth Staton Watkins", + cover: null, + }, + { + title: "My Mother Told Me (feat. 3lake) - Single", + artist: "Seth Staton Watkins", + cover: null, + }, +] + +export default function Page() { + return ( +
+
+

Artists

+
+ +
+
+ {page.map((album) => ( + + ))} +
+
+ + +
+ ) +} diff --git a/app/library/recently-added/page.tsx b/app/library/recently-added/page.tsx new file mode 100644 index 0000000..8384cfd --- /dev/null +++ b/app/library/recently-added/page.tsx @@ -0,0 +1,43 @@ +import { AlbumCard, type Album } from "@/components/album-card" +import { PlayerBar } from "@/components/player-bar" + +const albums: Album[] = [ + { title: "Live from the Hollywood Bowl", artist: "AJR", cover: null }, + { title: "Ends of the Earth", artist: "The Longest Johns", cover: null }, + { title: "The Parting Glass - Single", artist: "The Ramparts", cover: null }, + { title: "Fairytale of New York - Single", artist: "The Ramparts", cover: null }, + { title: "The Rocky Road to Dublin - Single", artist: "The Ramparts", cover: null }, + { title: "1778 - EP", artist: "The Wellermen", cover: null }, + { title: "The High Kings", artist: "The High Kings", cover: null }, + { title: "The Fall-Off", artist: "J. Cole", cover: null }, + { title: "Enchanted Isle", artist: "VOCES8", cover: null }, + { title: "Unknown Album", artist: "", cover: null }, + { title: "Song of Durin (Complete Edition)", artist: "Clamavi De Profundis", cover: null }, + { title: "Sid Meier's Civilization V (Soundtrack)", artist: "Geoff Knorr & Michael Curran", cover: null }, + { title: "The Last Goodbye - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "Do You Hear the People Sing? - Single", artist: "Seth Staton Watkins & Aaron Dolan", cover: null }, + { title: "Fiddler's Green - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "The Orange and the Green - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "Horse Soldier, Horse Soldier - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "My Mother Told Me (feat. 3lake) - Single", artist: "Seth Staton Watkins", cover: null }, +] + +export default function Page() { + return ( +
+
+

Recently Added

+
+ +
+
+ {albums.map((album) => ( + + ))} +
+
+ + +
+ ) +} diff --git a/app/page.tsx b/app/page.tsx index 98ff035..8384cfd 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,19 +1,43 @@ -import { Button } from "@/components/ui/button" +import { AlbumCard, type Album } from "@/components/album-card" +import { PlayerBar } from "@/components/player-bar" + +const albums: Album[] = [ + { title: "Live from the Hollywood Bowl", artist: "AJR", cover: null }, + { title: "Ends of the Earth", artist: "The Longest Johns", cover: null }, + { title: "The Parting Glass - Single", artist: "The Ramparts", cover: null }, + { title: "Fairytale of New York - Single", artist: "The Ramparts", cover: null }, + { title: "The Rocky Road to Dublin - Single", artist: "The Ramparts", cover: null }, + { title: "1778 - EP", artist: "The Wellermen", cover: null }, + { title: "The High Kings", artist: "The High Kings", cover: null }, + { title: "The Fall-Off", artist: "J. Cole", cover: null }, + { title: "Enchanted Isle", artist: "VOCES8", cover: null }, + { title: "Unknown Album", artist: "", cover: null }, + { title: "Song of Durin (Complete Edition)", artist: "Clamavi De Profundis", cover: null }, + { title: "Sid Meier's Civilization V (Soundtrack)", artist: "Geoff Knorr & Michael Curran", cover: null }, + { title: "The Last Goodbye - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "Do You Hear the People Sing? - Single", artist: "Seth Staton Watkins & Aaron Dolan", cover: null }, + { title: "Fiddler's Green - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "The Orange and the Green - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "Horse Soldier, Horse Soldier - Single", artist: "Seth Staton Watkins", cover: null }, + { title: "My Mother Told Me (feat. 3lake) - Single", artist: "Seth Staton Watkins", cover: null }, +] export default function Page() { return ( -
-
-
-

Project ready!

-

You may now add components and start building.

-

We've already added the button component for you.

- -
-
- (Press d to toggle dark mode) +
+
+

Recently Added

+
+ +
+
+ {albums.map((album) => ( + + ))}
+ +
) } diff --git a/components/album-card.tsx b/components/album-card.tsx new file mode 100644 index 0000000..7d0967c --- /dev/null +++ b/components/album-card.tsx @@ -0,0 +1,48 @@ +import Image from "next/image" +import Link from "next/link" + +export type Album = { + // id: string + title: string + artist: string + // artistID: string + cover: string | null +} + +export function AlbumCard({ album }: { album: Album }) { + return ( +
+ + {album.cover ? ( + {album.title} + ) : ( + {album.title} + )} + +
+ +

{album.title}

+ + +

+ {album.artist} +

+ +
+
+ ) +} diff --git a/components/app-sidebar.tsx b/components/app-sidebar.tsx new file mode 100644 index 0000000..9812953 --- /dev/null +++ b/components/app-sidebar.tsx @@ -0,0 +1,135 @@ +"use client" + +import { + Disc3, + House, + ListMusic, + Mic, + Music2, + Search, +} from "lucide-react" + +import { useRouter, usePathname } from "next/navigation" + +import { Avatar, AvatarFallback } from "@/components/ui/avatar" +import { + Sidebar, + SidebarContent, + SidebarFooter, + SidebarGroup, + SidebarGroupContent, + SidebarGroupLabel, + SidebarHeader, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from "@/components/ui/sidebar" +import Image from "next/image" + +const browse = [ + { title: "Search", path: "", icon: Search }, + { title: "Home", path: "/", icon: House }, +] + +const library = [ + { title: "Recently Added", path: "/library/recently-added", icon: ListMusic }, + { title: "Artists", path: "/library/artists", icon: Mic }, + { title: "Albums", path: "/library/albums", icon: Disc3 }, + { title: "Songs", path: "/library/songs", icon: Music2 }, +] + +const playlists = [ + { title: "All Playlists", path: "", icon: ListMusic }, + { title: "Favorite Songs", path: "", icon: ListMusic }, + { title: "Choir & Bands", path: "", icon: ListMusic }, + { title: "Plays", path: "", icon: ListMusic }, + { title: "Sea Shanties", path: "", icon: ListMusic }, + { title: "Stay Civilized", path: "", icon: ListMusic }, +] + +export function AppSidebar() { + const router = useRouter() + const pathname = usePathname() + + return ( + + +
+ {"oTunes"} + oTunes +
+
+ + + + + + {browse.map((item) => ( + + router.push(item.path)} + > + + {item.title} + + + ))} + + + + + + Library + + + {library.map((item) => ( + + router.push(item.path)} + > + + {item.title} + + + ))} + + + + + + Playlists + + + {playlists.map((item) => ( + + router.push(item.path)} + > + + {item.title} + + + ))} + + + + + + + + + + + JH + + Joshua Higgins + + + + +
+ ) +} diff --git a/components/player-bar.tsx b/components/player-bar.tsx new file mode 100644 index 0000000..2e7b8c2 --- /dev/null +++ b/components/player-bar.tsx @@ -0,0 +1,60 @@ +import { + ListMusic, + Music, + Pause, + Repeat, + Shuffle, + SkipBack, + SkipForward, + Volume2, +} from "lucide-react" + +import { Button } from "@/components/ui/button" + +export function PlayerBar() { + return ( +
+
+
+ + + + + +
+ +
+
+
+

Ends of the Earth

+

+ The Longest Johns — Ends of the Earth +

+
+
+ +
+ + + +
+
+
+ ) +} diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..bcb9380 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/placeholder-album.svg b/public/placeholder-album.svg new file mode 100644 index 0000000..fe56e9b --- /dev/null +++ b/public/placeholder-album.svg @@ -0,0 +1,13 @@ + \ No newline at end of file