How do I protect my navbar component as well which is being attached to my dashboard page, currently it is only protecting the dashboardv2component which is passed as children to a privateroute which checks for auth credentials. What am I doing wrong here that the navbar still shows while the auth check is happening? how do i fix it?
Any help is appreciated.
import PrivateRoute from "@/components/PrivateRouting/PrivateRoute";
import DashboardV2Component from "@/componentsv2/dashboard";
import NavbarV2 from "@/componentsv2/dashboard/navbarcomponent/NavbarV2";
import React from "react";
function DashboardV2() {
return <PrivateRoute component={DashboardV2Component} />;
}
DashboardV2.getLayout = (page) => <NavbarV2>{page}</NavbarV2>;
export default DashboardV2;