Customize title bar (#1184)
* 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
This commit is contained in:
19
enjoy/src/renderer/pages/protected-page.tsx
Normal file
19
enjoy/src/renderer/pages/protected-page.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user