-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e5b26b
commit 0ce2129
Showing
5 changed files
with
28 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
import './assets/css/App.css'; | ||
import { Routes, Route, Navigate } from 'react-router-dom'; | ||
import {} from 'react-router-dom'; | ||
import AuthLayout from './layouts/auth'; | ||
import AdminLayout from './layouts/admin'; | ||
import RTLLayout from './layouts/rtl'; | ||
import React from 'react'; | ||
import theme from 'theme/theme'; | ||
import { ChakraProvider } from '@chakra-ui/react'; | ||
import { | ||
ChakraProvider, | ||
// extendTheme | ||
} from '@chakra-ui/react'; | ||
import initialTheme from './theme/theme'; // { themeGreen } | ||
import { useState } from 'react'; | ||
// Chakra imports | ||
|
||
export default function Main() { | ||
// eslint-disable-next-line | ||
const [currentTheme, setCurrentTheme] = useState(initialTheme); | ||
return ( | ||
<ChakraProvider theme={theme}> | ||
<React.StrictMode> | ||
<Routes> | ||
<Route path="auth/*" element={<AuthLayout />} /> | ||
<Route | ||
path="admin/*" | ||
element={ | ||
<AdminLayout theme={currentTheme} setTheme={setCurrentTheme} /> | ||
} | ||
/> | ||
<Route | ||
path="rtl/*" | ||
element={ | ||
<RTLLayout theme={currentTheme} setTheme={setCurrentTheme} /> | ||
} | ||
/> | ||
<Route path="/" element={<Navigate to="/admin" replace />} /> | ||
</Routes> | ||
</React.StrictMode> | ||
<ChakraProvider theme={currentTheme}> | ||
<Routes> | ||
<Route path="auth/*" element={<AuthLayout />} /> | ||
<Route | ||
path="admin/*" | ||
element={ | ||
<AdminLayout theme={currentTheme} setTheme={setCurrentTheme} /> | ||
} | ||
/> | ||
<Route | ||
path="rtl/*" | ||
element={ | ||
<RTLLayout theme={currentTheme} setTheme={setCurrentTheme} /> | ||
} | ||
/> | ||
<Route path="/" element={<Navigate to="/admin" replace />} /> | ||
</Routes> | ||
</ChakraProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters