joshigaurava commented on code in PR #10389: URL: https://github.com/apache/pinot/pull/10389#discussion_r1134040833
########## pinot-controller/src/main/resources/app/App.tsx: ########## @@ -18,48 +18,42 @@ */ import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import { CircularProgress, createStyles, makeStyles, MuiThemeProvider } from '@material-ui/core'; -import { Switch, Route, HashRouter as Router, Redirect } from 'react-router-dom'; -import theme from './theme'; +import { Switch, Route, Redirect, useHistory } from 'react-router-dom'; import Layout from './components/Layout'; import RouterData from './router'; import PinotMethodUtils from './utils/PinotMethodUtils'; -import CustomNotification from './components/CustomNotification'; -import { NotificationContextProvider } from './components/Notification/NotificationContextProvider'; import app_state from './app_state'; +import { useAuthProvider } from './components/auth/AuthProvider'; +import { AppLoadingIndicator } from './components/AppLoadingIndicator'; import { AuthWorkflow } from 'Models'; -const useStyles = makeStyles(() => - createStyles({ - loader: { - position: 'fixed', - left: '50%', - top: '30%' - }, - }) -); - -const App = () => { +export const App = () => { const [clusterName, setClusterName] = React.useState(''); const [loading, setLoading] = React.useState(true); - const oidcSignInFormRef = React.useRef<HTMLFormElement>(null); const [isAuthenticated, setIsAuthenticated] = React.useState(null); - const [issuer, setIssuer] = React.useState(null); - const [redirectUri, setRedirectUri] = React.useState(null); - const [clientId, setClientId] = React.useState(null); - const [authWorkflow, setAuthWorkflow] = React.useState(null); - const [authorizationEndpoint, setAuthorizationEndpoint] = React.useState( - null - ); const [role, setRole] = React.useState(''); + const { authenticated, authWorkflow } = useAuthProvider(); + const history = useHistory(); + + React.useEffect(() => { Review Comment: Minor and not a blocker: can you pleease fix the import so that you can use just `useEffect`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org