Changeset 8dd3e22 for frontend/src
- Timestamp:
- 02/09/26 20:44:24 (5 months ago)
- Branches:
- main
- Children:
- 27660af
- Parents:
- c684a6d
- Location:
- frontend/src
- Files:
-
- 2 added
- 3 edited
-
App.tsx (modified) (3 diffs)
-
pages/MySongs.tsx (added)
-
pages/Nav.tsx (modified) (2 diffs)
-
pages/PublishSong.tsx (added)
-
utils/types.ts (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/App.tsx
rc684a6d r8dd3e22 17 17 import Login from "./pages/Login"; 18 18 import MusicalCollection from "./pages/MusicalCollection"; 19 import MySongs from "./pages/MySongs"; 19 20 import Nav from "./pages/Nav"; 21 import PublishSong from "./pages/PublishSong"; 20 22 import Register from "./pages/Register"; 21 23 import SongDetail from "./pages/SongDetail"; … … 28 30 // show sidebar only if user is logged in and is on the landing page 29 31 const isLandingPage = location.pathname === "/"; 30 const [isSidebarOpen, setIsSidebarOpen] = useState(!!user && isLandingPage); 32 const [isSidebarOpen, setIsSidebarOpen] = useState( 33 !!user && isLandingPage && !user?.isArtist && !user?.isAdmin, 34 ); 31 35 32 36 // Open sidebar when user logs in and navigates to landing page 33 37 useEffect(() => { 34 if (user && isLandingPage ) {38 if (user && isLandingPage && !user.isArtist && !user.isAdmin) { 35 39 setIsSidebarOpen(true); 36 40 } … … 104 108 }, 105 109 { 110 path: "/my-songs", 111 element: <MySongs />, 112 }, 113 { 114 path: "/publish", 115 element: <PublishSong />, 116 }, 117 { 106 118 path: "/songs/:id", 107 119 element: <SongDetail />, -
frontend/src/pages/Nav.tsx
rc684a6d r8dd3e22 22 22 setUser(undefined); 23 23 setIsDropdownOpen(false); 24 toast.success("Logout successful!"); 24 window.location.href = "/"; 25 // toast.success("Logout successful!"); 25 26 } catch (error) { 26 27 console.error("Logout failed:", error); … … 81 82 {!isAuthLoading && ( 82 83 <div className="flex items-center space-x-3"> 84 {user?.isArtist && ( 85 <Link 86 to="/my-songs" 87 className="text-white hover:text-[#1db954] px-4 py-2 text-sm font-medium transition-colors" 88 > 89 My Songs 90 </Link> 91 )} 83 92 {user ? ( 84 93 <div className="relative" ref={dropdownRef}> -
frontend/src/utils/types.ts
rc684a6d r8dd3e22 108 108 songCount: number; 109 109 } 110 111 export interface CatalogItem { 112 id: number; 113 title: string; 114 genre: string; 115 cover: string | null; 116 type: "SONG" | "ALBUM"; 117 releaseDate: string; 118 }
Note:
See TracChangeset
for help on using the changeset viewer.
