This commit is contained in:
ghost2023
2026-06-02 14:04:23 +03:00
parent 243803fc29
commit 169e49faae
2 changed files with 4 additions and 5 deletions

View File

@@ -32,8 +32,6 @@ import NewBookingPage from "./pages/bookings/NewBookingPage";
import TrackingPage from "./pages/tracking/TrackingPage"; import TrackingPage from "./pages/tracking/TrackingPage";
import BillingPage from "./pages/billing/BillingPage"; import BillingPage from "./pages/billing/BillingPage";
import { useEffect } from "react"; import { useEffect } from "react";
import CustomerOnBoarding from "./pages/customers/on_boarding/TransportrOnBoarding";
import CustomerOnboardingPage from "./pages/customers/on_boarding/CustomerOnboardingPage";
const sidebarItems: SidebarItem[] = [ const sidebarItems: SidebarItem[] = [
{ label: "Home", href: "/portal", icon: <Home /> }, { label: "Home", href: "/portal", icon: <Home /> },
@@ -46,12 +44,13 @@ const sidebarItems: SidebarItem[] = [
const App = () => { const App = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const location = useLocation(); const location = useLocation();
const { user, isPending, logout, customer } = useAuth(); const { user, isPending, logout, customer, customerQuery } = useAuth();
useEffect(() => { useEffect(() => {
if (isPending) return; if (isPending) return;
const isInProtectedRoutes = sidebarItems.find((item) => const isInProtectedRoutes = sidebarItems.find((item) =>
location.pathname.startsWith(item.href), location.pathname.startsWith(item.href),
); );
console.log({ isInProtectedRoutes, location });
if (!user) { if (!user) {
if (isInProtectedRoutes) return navigate("/login"); if (isInProtectedRoutes) return navigate("/login");
return; return;

View File

@@ -130,7 +130,7 @@ export function Step5CargoDetails({
<div className="mb-2 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10"> <div className="mb-2 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10">
<Package className="h-4 w-4 text-primary" /> <Package className="h-4 w-4 text-primary" />
</div> </div>
<p className="font-semibold">Container</p> <p className="font-semibold">Containerized</p>
<p className="mt-0.5 text-xs text-muted-foreground"> <p className="mt-0.5 text-xs text-muted-foreground">
Pre-packed containerized cargo (20ft / 40ft). Pre-packed containerized cargo (20ft / 40ft).
</p> </p>
@@ -145,7 +145,7 @@ export function Step5CargoDetails({
<div className="mb-2 flex h-9 w-9 items-center justify-center rounded-lg bg-amber-100"> <div className="mb-2 flex h-9 w-9 items-center justify-center rounded-lg bg-amber-100">
<Weight className="h-4 w-4 text-amber-600" /> <Weight className="h-4 w-4 text-amber-600" />
</div> </div>
<p className="font-semibold">Bulk</p> <p className="font-semibold">General Cargo</p>
<p className="mt-0.5 text-xs text-muted-foreground"> <p className="mt-0.5 text-xs text-muted-foreground">
Bulk commodities or break-bulk cargo. Bulk commodities or break-bulk cargo.
</p> </p>