1
- import React , { useState , useEffect } from 'react' ;
2
- import { ThemeProvider , Theme , StyledEngineProvider } from '@mui/material/styles' ;
3
- import NavBar from '../components/top/NavBar' ;
4
- import LeftContainer from './LeftContainer' ;
5
- import MainContainer from './MainContainer' ;
1
+ import React , { useEffect , useState } from 'react' ;
2
+ import {
3
+ StyledEngineProvider ,
4
+ Theme ,
5
+ ThemeProvider
6
+ } from '@mui/material/styles' ;
6
7
import { theme1 , theme2 } from '../public/styles/theme' ;
7
- import { setStyle } from '../redux/reducers/slice/styleSlice' ;
8
8
// Imports for redux toolkit usage
9
- import { useSelector , useDispatch } from 'react-redux' ;
9
+ import { useDispatch , useSelector } from 'react-redux' ;
10
10
11
+ import LeftContainer from './LeftContainer' ;
12
+ import MainContainer from './MainContainer' ;
13
+ import MarketplaceContainer from './MarketplaceContainer' ;
14
+ import NavBar from '../components/top/NavBar' ;
15
+ import { setStyle } from '../redux/reducers/slice/styleSlice' ;
11
16
12
17
declare module '@mui/styles/defaultTheme' {
13
18
// eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -19,34 +24,33 @@ const lightTheme = theme1;
19
24
const darkTheme = theme2 ; // dark mode color in theme.ts not reached
20
25
const AppContainer = ( ) => {
21
26
// setting state for changing light vs dark themes; linked to NavBar.tsx
22
-
23
- const { isDarkMode, style } = useSelector ( ( store ) => ( {
24
- isDarkMode : store . darkMode . isDarkMode ,
25
- style : store . styleSlice ,
26
- } ) ) ;
27
+
28
+ const { isDarkMode, style } = useSelector ( ( store ) => ( {
29
+ isDarkMode : store . darkMode . isDarkMode ,
30
+ style : store . styleSlice
31
+ } ) ) ;
27
32
28
33
const [ isThemeLight , setTheme ] = useState ( ! isDarkMode ) ;
29
34
const dispatch = useDispatch ( ) ;
30
35
31
-
32
36
// Set background color of left and bottom panel on the first render
33
37
// Without this hook, the first render is always going to be white
34
38
useEffect ( ( ) => {
35
- if ( ! isDarkMode ) dispatch ( setStyle ( null ) ) ;
39
+ if ( ! isDarkMode ) dispatch ( setStyle ( null ) ) ;
36
40
else dispatch ( setStyle ( { backgroundColor : '#21262c' } ) ) ;
37
41
} , [ isDarkMode ] ) ;
38
42
39
-
40
43
return (
41
44
< StyledEngineProvider injectFirst >
42
45
< ThemeProvider theme = { ! isDarkMode ? lightTheme : darkTheme } >
43
46
< div >
44
- < NavBar setTheme = { setTheme } isThemeLight = { isThemeLight } />
47
+ < NavBar setTheme = { setTheme } isThemeLight = { isThemeLight } />
45
48
</ div >
46
49
< div className = "app-container" >
47
- < LeftContainer isThemeLight = { isThemeLight } />
48
- < MainContainer isThemeLight = { isThemeLight } />
50
+ < LeftContainer isThemeLight = { isThemeLight } />
51
+ < MainContainer isThemeLight = { isThemeLight } />
49
52
</ div >
53
+ { /* <MarketplaceContainer /> */ }
50
54
</ ThemeProvider >
51
55
</ StyledEngineProvider >
52
56
) ;
0 commit comments