Checkpoint

This commit is contained in:
2022-07-25 16:23:57 -05:00
parent 90e43ada66
commit 3050441e5f
3 changed files with 42 additions and 12 deletions

View File

@ -13,7 +13,7 @@
"@fullcalendar/interaction": "5.10.0", "@fullcalendar/interaction": "5.10.0",
"@fullcalendar/react": "5.10.0", "@fullcalendar/react": "5.10.0",
"@fullcalendar/timegrid": "5.10.0", "@fullcalendar/timegrid": "5.10.0",
"@kingsrook/qqq-frontend-core": "1.0.3", "@kingsrook/qqq-frontend-core": "1.0.5",
"@mui/icons-material": "5.4.1", "@mui/icons-material": "5.4.1",
"@mui/material": "5.4.1", "@mui/material": "5.4.1",
"@mui/styled-engine": "5.4.1", "@mui/styled-engine": "5.4.1",
@ -33,6 +33,7 @@
"chroma-js": "2.4.2", "chroma-js": "2.4.2",
"dropzone": "5.9.2", "dropzone": "5.9.2",
"flatpickr": "4.6.9", "flatpickr": "4.6.9",
"form-data": "4.0.0",
"formik": "2.2.9", "formik": "2.2.9",
"html-react-parser": "1.4.8", "html-react-parser": "1.4.8",
"http-proxy-middleware": "2.0.6", "http-proxy-middleware": "2.0.6",

View File

@ -1,5 +1,5 @@
import ReactDOM from "react-dom"; import ReactDOM from "react-dom";
import {BrowserRouter} from "react-router-dom"; import {BrowserRouter, useNavigate} from "react-router-dom";
import {Auth0Provider} from "@auth0/auth0-react"; import {Auth0Provider} from "@auth0/auth0-react";
import App from "App"; import App from "App";
@ -13,18 +13,49 @@ import React from "react";
const domain = process.env.REACT_APP_AUTH0_DOMAIN; const domain = process.env.REACT_APP_AUTH0_DOMAIN;
const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID; const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;
/*
ReactDOM.render( ReactDOM.render(
<Auth0Provider <BrowserRouter>
domain={domain} <MaterialUIControllerProvider>
clientId={clientId} <ProtectedRoute component={App} />
redirectUri={`${window.location.origin}/dashboards/analytics`} </MaterialUIControllerProvider>
> </BrowserRouter>,
<BrowserRouter> document.getElementById("root"),
);
*/
console.log("what");
// @ts-ignore
function Auth0ProviderWithRedirectCallback({children, ...props})
{
const navigate = useNavigate();
// @ts-ignore
const onRedirectCallback = (appState) =>
{
navigate((appState && appState.returnTo) || window.location.pathname);
};
return (
// @ts-ignore
<Auth0Provider onRedirectCallback={onRedirectCallback} {...props}>
{children}
</Auth0Provider>
);
}
ReactDOM.render(
<BrowserRouter>
<Auth0ProviderWithRedirectCallback
domain={domain}
clientId={clientId}
redirectUri={`${window.location.origin}/dashboards/analytics`}
>
<MaterialUIControllerProvider> <MaterialUIControllerProvider>
<ProtectedRoute component={App} /> <ProtectedRoute component={App} />
</MaterialUIControllerProvider> </MaterialUIControllerProvider>
</BrowserRouter> </Auth0ProviderWithRedirectCallback>
</Auth0Provider>, </BrowserRouter>,
document.getElementById("root"), document.getElementById("root"),
); );
export * from "components/MDButton"; export * from "components/MDButton";

View File

@ -14,8 +14,6 @@
import React, {useEffect, useReducer, useState} from "react"; import React, {useEffect, useReducer, useState} from "react";
import {useParams, useSearchParams} from "react-router-dom"; import {useParams, useSearchParams} from "react-router-dom";
import {useAuth0} from "@auth0/auth0-react";
// @mui material components // @mui material components
import Card from "@mui/material/Card"; import Card from "@mui/material/Card";
import Icon from "@mui/material/Icon"; import Icon from "@mui/material/Icon";