RC-4: move AppContext to src/app/contexts
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import FuseUtils from '@fuse/utils';
|
import FuseUtils from '@fuse/utils';
|
||||||
import AppContext from 'app/AppContext';
|
import AppContext from 'src/app/contexts/AppContext';
|
||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import { matchRoutes } from 'react-router-dom';
|
import { matchRoutes } from 'react-router-dom';
|
||||||
import withRouter from '@fuse/core/withRouter';
|
import withRouter from '@fuse/core/withRouter';
|
||||||
@@ -50,6 +50,7 @@ class FuseAuthorization extends Component {
|
|||||||
const { location, userRole } = this.props;
|
const { location, userRole } = this.props;
|
||||||
const { pathname } = location;
|
const { pathname } = location;
|
||||||
const redirectUrl = loginRedirectUrl || this.defaultLoginRedirectUrl;
|
const redirectUrl = loginRedirectUrl || this.defaultLoginRedirectUrl;
|
||||||
|
console.log(location, userRole, redirectUrl);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
User is guest
|
User is guest
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useDeepCompareEffect } from '@fuse/hooks';
|
import { useDeepCompareEffect } from '@fuse/hooks';
|
||||||
import _ from '@lodash';
|
import _ from '@lodash';
|
||||||
import AppContext from 'app/AppContext';
|
import AppContext from 'src/app/contexts/AppContext';
|
||||||
import {
|
import {
|
||||||
generateSettings,
|
generateSettings,
|
||||||
selectFuseCurrentSettings,
|
selectFuseCurrentSettings,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { selectMainTheme } from 'app/store/fuse/settingsSlice';
|
|||||||
import FuseAuthorization from '@fuse/core/FuseAuthorization';
|
import FuseAuthorization from '@fuse/core/FuseAuthorization';
|
||||||
import settingsConfig from 'app/configs/settingsConfig';
|
import settingsConfig from 'app/configs/settingsConfig';
|
||||||
import withAppProviders from './withAppProviders';
|
import withAppProviders from './withAppProviders';
|
||||||
import { AuthProvider } from './auth/AuthContext';
|
import { AuthProvider } from './contexts/AuthContext';
|
||||||
|
|
||||||
// import axios from 'axios';
|
// import axios from 'axios';
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import FuseDialog from '@fuse/core/FuseDialog';
|
|||||||
import FuseMessage from '@fuse/core/FuseMessage';
|
import FuseMessage from '@fuse/core/FuseMessage';
|
||||||
import FuseSuspense from '@fuse/core/FuseSuspense';
|
import FuseSuspense from '@fuse/core/FuseSuspense';
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import AppContext from 'app/AppContext';
|
import AppContext from 'src/app/contexts/AppContext';
|
||||||
import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice';
|
import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice';
|
||||||
import { memo, useContext } from 'react';
|
import { memo, useContext } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import FuseSuspense from '@fuse/core/FuseSuspense';
|
import FuseSuspense from '@fuse/core/FuseSuspense';
|
||||||
import AppContext from 'app/AppContext';
|
import AppContext from 'src/app/contexts/AppContext';
|
||||||
import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice';
|
import { selectFuseCurrentLayoutConfig } from 'app/store/fuse/settingsSlice';
|
||||||
import i18next from 'i18next';
|
import i18next from 'i18next';
|
||||||
import { memo, useContext } from 'react';
|
import { memo, useContext } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { useRoutes } from 'react-router-dom';
|
import { useRoutes } from 'react-router-dom';
|
||||||
import { useAuth } from 'src/app/auth/AuthContext';
|
import { useAuth } from 'src/app/contexts/AuthContext';
|
||||||
import FooterLayout2 from './components/FooterLayout2';
|
import FooterLayout2 from './components/FooterLayout2';
|
||||||
import HeaderLayout2 from './components/HeaderLayout2';
|
import HeaderLayout2 from './components/HeaderLayout2';
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|||||||
import { StyledEngineProvider } from '@mui/material/styles';
|
import { StyledEngineProvider } from '@mui/material/styles';
|
||||||
import routes from 'app/configs/routesConfig';
|
import routes from 'app/configs/routesConfig';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import AppContext from './AppContext';
|
import AppContext from './contexts/AppContext';
|
||||||
|
|
||||||
const withAppProviders = (Component) => (props) => {
|
const withAppProviders = (Component) => (props) => {
|
||||||
const WrapperComponent = () => (
|
const WrapperComponent = () => (
|
||||||
|
|||||||
Reference in New Issue
Block a user