diff --git a/src/layouts/dashbord/index.tsx b/src/layouts/dashbord/index.tsx index 7e06de5..88a37dd 100644 --- a/src/layouts/dashbord/index.tsx +++ b/src/layouts/dashbord/index.tsx @@ -14,6 +14,7 @@ import useAuth from "hooks/useAuth"; import useNavigateCustom from "hooks/useNavigateCustom"; import { getPath } from "routes/path"; import { PageID } from "pages"; +import useBackDrop from "hooks/useBackDrop"; function Copyright() { return ( @@ -29,6 +30,8 @@ function App() { const { navigateWhenChanged } = useNavigateCustom(); + const { setShowBackDrop } = useBackDrop(); + const [mobileOpen, setMobileOpen] = useState(false); const { drawerWidth, innerWidth, contentsWidth } = useDashboard(); @@ -37,16 +40,17 @@ function App() { setMobileOpen(!mobileOpen); }; - console.log("へい"); + useEffect(() => { + setShowBackDrop(!initialized); + if (initialized && !authenticated) { + navigateWhenChanged(getPath(PageID.PAGE_403)); + } + }, [initialized, authenticated]); if (!initialized) { return null; } - if (!authenticated) { - navigateWhenChanged(getPath(PageID.PAGE_403)); - } - return ( 支払済み - + 各種申請