use authenticated layout

This commit is contained in:
m5r
2021-10-24 22:25:01 +02:00
parent fbe31a508d
commit 4facb32e74
11 changed files with 20 additions and 32 deletions

View File

@ -1,5 +1,6 @@
import type { ErrorInfo, FunctionComponent } from "react";
import type { ErrorInfo } from "react";
import { Component, Suspense } from "react";
import type { BlitzLayout } from "blitz";
import {
Head,
withRouter,
@ -8,10 +9,11 @@ import {
CSRFTokenMismatchError,
NotFoundError,
RedirectError,
Routes,
} from "blitz";
import type { WithRouterProps } from "next/dist/client/with-router";
import appLogger from "../../../../integrations/logger";
import appLogger from "integrations/logger";
import Footer from "./footer";
import Loader from "./loader";
@ -24,7 +26,7 @@ type Props = {
const logger = appLogger.child({ module: "Layout" });
const AppLayout: FunctionComponent<Props> = ({ children, title, pageTitle = title, hideFooter = false }) => {
const AppLayout: BlitzLayout<Props> = ({ children, title, pageTitle = title, hideFooter = false }) => {
return (
<>
{pageTitle ? (
@ -49,6 +51,8 @@ const AppLayout: FunctionComponent<Props> = ({ children, title, pageTitle = titl
);
};
AppLayout.authenticate = { redirectTo: Routes.SignIn() };
type ErrorBoundaryState =
| {
isError: false;