- Timestamp:
- 02/09/26 21:45:41 (5 months ago)
- Branches:
- main
- Children:
- 0808ef2
- Parents:
- 03a8d87 (diff), 27660af (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- frontend/src
- Files:
-
- 3 added
- 3 edited
-
App.tsx (modified) (3 diffs)
-
pages/MySongs.tsx (added)
-
pages/Nav.tsx (modified) (2 diffs)
-
pages/PublishSong.tsx (added)
-
utils/consts.ts (added)
-
utils/types.ts (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/App.tsx
r03a8d87 r890e036 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
r03a8d87 r890e036 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
r03a8d87 r890e036 4 4 email?: string; 5 5 profilePhoto?: string | null; 6 role?: "ADMIN" | "NONADMIN"; 6 isAdmin: boolean; 7 isArtist: boolean; 7 8 } 8 9 … … 107 108 songCount: number; 108 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 } 119 120 export interface Contributor { 121 username: string; 122 fullName: string; 123 role: string; 124 } 125 126 export interface ArtistSearchResult { 127 username: string; 128 fullName: string; 129 profilePhoto?: string; 130 } 131 132 export interface SongEntry { 133 title: string; 134 link: string; 135 contributors: Contributor[]; 136 }
Note:
See TracChangeset
for help on using the changeset viewer.
