1- import React , { useState } from 'react' ;
1+ import React from 'react' ;
22import tw from 'twin.macro' ;
33import '@/assets/tailwind.css' ;
44import { store } from '@/state' ;
@@ -7,12 +7,10 @@ import { hot } from 'react-hot-loader/root';
77import { history } from '@/components/history' ;
88import { SiteSettings } from '@/state/settings' ;
99import IndexRouter from '@/routers/IndexRouter' ;
10- import { ThemeProvider } from "styled-components" ;
1110import earnCredits from '@/api/account/earnCredits' ;
1211import { setupInterceptors } from '@/api/interceptors' ;
1312import { StorefrontSettings } from '@/state/storefront' ;
1413import GlobalStylesheet from '@/assets/css/GlobalStylesheet' ;
15- import { Theme } from '@/theme' ;
1614
1715interface ExtendedWindow extends Window {
1816 SiteConfiguration ?: SiteSettings ;
@@ -39,7 +37,7 @@ setupInterceptors(history);
3937
4038const App = ( ) => {
4139 const { JexactylUser, SiteConfiguration, StoreConfiguration } = window as ExtendedWindow ;
42- const [ theme , setTheme ] = useState < StorefrontSettings [ "images" ] > ( )
40+
4341 if ( JexactylUser && ! store . getState ( ) . user . data ) {
4442 store . getActions ( ) . user . setUserData ( {
4543 uuid : JexactylUser . uuid ,
@@ -72,19 +70,15 @@ const App = () => {
7270 }
7371 }
7472 earn ( ) ;
75- if ( ! theme ) {
76- setTheme ( Theme ( store . getState ( ) . storefront . data ! ) )
77- }
73+
7874 return (
7975 < >
80- < ThemeProvider theme = { theme } >
81- < GlobalStylesheet />
82- < StoreProvider store = { store } >
83- < div css = { tw `mx-auto w-auto` } >
84- < IndexRouter />
85- </ div >
86- </ StoreProvider >
87- </ ThemeProvider >
76+ < GlobalStylesheet />
77+ < StoreProvider store = { store } >
78+ < div css = { tw `mx-auto w-auto` } >
79+ < IndexRouter />
80+ </ div >
81+ </ StoreProvider >
8882 </ >
8983 ) ;
9084} ;
0 commit comments