Spaces:
Sleeping
Sleeping
File size: 842 Bytes
d97b8f9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | import React from "react";
import { useLocation } from "react-router-dom";
import QuickAccess from "./QuickAccess";
import { useAuth } from "@/lib/auth-context";
const QuickAccessWrapper: React.FC = () => {
const location = useLocation();
const { isAuthenticated } = useAuth();
// Routes where QuickAccess should be hidden
const hiddenRoutes = [
"/", // Landing page
"/login",
"/register",
"/forgot-password",
"/reset-password",
"/download-app"
];
// Check if current path is in the hidden routes list
const shouldHide = hiddenRoutes.includes(location.pathname);
// Only render QuickAccess if authenticated and not on a hidden route
if (!isAuthenticated || shouldHide) {
return null;
}
return <QuickAccess />;
};
export default QuickAccessWrapper; |