0

I have a problem I'm not able to figure out the issue of. I'm not much familiar with these types of scenarios in React. I have a PrivateLayout which renders its childs inside it. Have a look at the array. PrivateLayout is working fine

 const ProtectedRoutes = [
{
  path: "/",
  component: PrivateLayout,
  children: [
    {
      component: Departments,
      path: "/departments",
    },
    {
      component: ActivityDashboardLayout,
      path: "/admin-dashboard",
      // New layout component
      children: [
        {
          component: Alert,
          path: "/alert",
        },
      ],
    },
  ],
},

];

PrivateLayout.jsx

enter image description here

What i want is, as soon as I navigate to /admin-dashboard I should have another layout that should have the same navbar. When I navigate to the nested routes of admin-dashboard, they all should render between nav and sidebar. Have a look at the image for the reference enter image description here

Muhammad Umar
  • 1,291
  • 7
  • 13
  • do you want to implement the parent layout ? But also want to keep private layout?? Right? Parent Layout will give same navbar to each page. While private layout has some kind of functionality for authentication. Right? – Developer May 17 '23 at 10:38
  • @Developer not really this. Private/Parent layout are both same things. Sorry if I couldnt explain it well. What i want is, i want to see nested routes of admin-dashboard rendering under admindashboard component – Muhammad Umar May 17 '23 at 12:12
  • Oky, so you have two layouts. Both layouts have sidebar, header and content. While sidebar is same in both layouts. And you want that when you are in admin dashboard page or its child pages, then a second layout render. Otherwise the first layout render. Right?? – Developer May 17 '23 at 12:22

0 Answers0