* add basic title bar * add title bar actions * fix layout * update title bar * update layout * fix title bar for macOS * UI * setup menu for macOS * fix title bar logo
20 lines
446 B
TypeScript
20 lines
446 B
TypeScript
import { Navigate } from "react-router-dom";
|
|
import { AppSettingsProviderContext } from "../context";
|
|
import { useContext } from "react";
|
|
|
|
export const ProtectedPage = ({
|
|
children,
|
|
redirectPath = "/landing",
|
|
}: {
|
|
children: React.ReactNode;
|
|
redirectPath?: string;
|
|
}) => {
|
|
const { initialized } = useContext(AppSettingsProviderContext);
|
|
|
|
if (!initialized) {
|
|
return <Navigate to={redirectPath} replace />;
|
|
}
|
|
|
|
return children;
|
|
};
|