Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
index.jsx38 linesDownload Raw Back to SecurityPages
1import ReactDOM from 'react-dom';2import React from 'react';3import { SnackbarProvider } from 'notistack';4import Theme from '../Theme/index';5import LoginPage from './LoginPage';6import ForgotPasswordPage from './ForgotPasswordPage';7import PasswordResetPage from './PasswordResetPage';8import MfaRegisterPage from './MfaRegisterPage';9import MfaValidatePage from './MfaValidatePage';10 11window.renderSecurityPage = function(pageName, pageProps, otherProps) {12  let ComponentPageMap = {13    'login_user': LoginPage,14    'forgot_password': ForgotPasswordPage,15    'reset_password': PasswordResetPage,16    'mfa_register': MfaRegisterPage,17    'mfa_validate': MfaValidatePage,18  };19 20  const Page = ComponentPageMap[pageName];21 22  if(Page) {23    ReactDOM.render(24      <Theme>25        <SnackbarProvider26          maxSnack={5}27          anchorOrigin={{ horizontal: 'right', vertical: 'top' }}>28          <Page {...pageProps} {...otherProps} />29        </SnackbarProvider>30      </Theme>31      , document.querySelector('#root'));32  } else {33    ReactDOM.render(34      <h1>Invalid Page</h1>35      , document.querySelector('#root'));36  }37};38 
codekingpro/portable-devtools · Team Ai