Ignore:
Timestamp:
02/09/26 20:44:24 (5 months ago)
Author:
Filip Gavrilovski <filipgavrilovski28@…>
Branches:
main
Children:
27660af
Parents:
c684a6d
Message:

add client side form for publishing new music with mock data and api calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/App.tsx

    rc684a6d r8dd3e22  
    1717import Login from "./pages/Login";
    1818import MusicalCollection from "./pages/MusicalCollection";
     19import MySongs from "./pages/MySongs";
    1920import Nav from "./pages/Nav";
     21import PublishSong from "./pages/PublishSong";
    2022import Register from "./pages/Register";
    2123import SongDetail from "./pages/SongDetail";
     
    2830        // show sidebar only if user is logged in and is on the landing page
    2931        const isLandingPage = location.pathname === "/";
    30         const [isSidebarOpen, setIsSidebarOpen] = useState(!!user && isLandingPage);
     32        const [isSidebarOpen, setIsSidebarOpen] = useState(
     33                !!user && isLandingPage && !user?.isArtist && !user?.isAdmin,
     34        );
    3135
    3236        // Open sidebar when user logs in and navigates to landing page
    3337        useEffect(() => {
    34                 if (user && isLandingPage) {
     38                if (user && isLandingPage && !user.isArtist && !user.isAdmin) {
    3539                        setIsSidebarOpen(true);
    3640                }
     
    104108                        },
    105109                        {
     110                                path: "/my-songs",
     111                                element: <MySongs />,
     112                        },
     113                        {
     114                                path: "/publish",
     115                                element: <PublishSong />,
     116                        },
     117                        {
    106118                                path: "/songs/:id",
    107119                                element: <SongDetail />,
Note: See TracChangeset for help on using the changeset viewer.