Moved projects to their own separate subdirectories
This commit is contained in:
19
Web/src/components/protectedRoute.jsx
Normal file
19
Web/src/components/protectedRoute.jsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { withAuthenticationRequired } from "@auth0/auth0-react";
|
||||
import React from "react";
|
||||
import { SplashScreen } from "./shared/splashScreen";
|
||||
|
||||
export const ProtectedRoute = ({ layout, header, footer, view, viewProps }) => {
|
||||
const ProtectedView = withAuthenticationRequired(layout, {
|
||||
// onRedirecting: () => (
|
||||
// <div className="page-layout">
|
||||
// <SplashScreen message="You are being redirected to the authentication page" />
|
||||
// </div>
|
||||
// ),
|
||||
});
|
||||
|
||||
const Header = () => React.createElement(header);
|
||||
const Footer = () => React.createElement(footer);
|
||||
const View = () => React.createElement(view, viewProps);
|
||||
|
||||
return <ProtectedView header={<Header/>} footer={<Footer />} content={<View />} />;
|
||||
};
|
||||
Reference in New Issue
Block a user