This commit is contained in:
Lorraxs 2024-01-02 10:57:38 +07:00
parent 796cd23e8d
commit 65c77d1621
4 changed files with 43 additions and 32 deletions

1
web/.npmrc Normal file
View File

@ -0,0 +1 @@
public-hoist-pattern[]=*@nextui-org/*

BIN
web/public/assets/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

View File

@ -3,7 +3,6 @@ import { useSelector } from 'react-redux';
import { AppActions, RootState } from './store'; import { AppActions, RootState } from './store';
import { ToastContainer } from 'react-toastify'; import { ToastContainer } from 'react-toastify';
import { Box } from 'lr-components'; import { Box } from 'lr-components';
import { NextUIProvider } from '@nextui-org/react';
import AppActionHook from './components/AppActionHook'; import AppActionHook from './components/AppActionHook';
import { isEnvBrowser } from './utils/misc'; import { isEnvBrowser } from './utils/misc';
import { fetchNui } from './utils/fetchNui'; import { fetchNui } from './utils/fetchNui';
@ -25,7 +24,6 @@ function App() {
}, [setSetting]); }, [setSetting]);
return ( return (
<SettingContext.Provider value={{ setting, setSetting, L }}> <SettingContext.Provider value={{ setting, setSetting, L }}>
<NextUIProvider>
<Box <Box
display='flex' display='flex'
position='absolute' position='absolute'
@ -57,7 +55,6 @@ function App() {
></Box> ></Box>
)} )}
<ToastContainer pauseOnFocusLoss={false} hideProgressBar={true} /> <ToastContainer pauseOnFocusLoss={false} hideProgressBar={true} />
</NextUIProvider>
</SettingContext.Provider> </SettingContext.Provider>
); );
} }

View File

@ -4,11 +4,24 @@ import App from './App';
import './index.css'; import './index.css';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { store } from './store'; import { store } from './store';
import { isEnvBrowser } from './utils/misc';
import { NextUIProvider } from '@nextui-org/react';
ReactDOM.createRoot(document.getElementById('root')!).render( const root = document.getElementById('root');
if (isEnvBrowser()) {
// https://i.imgur.com/iPTAdYV.png - Night time img
root!.style.backgroundImage = 'url("https://i.imgur.com/3pzRj9n.png")';
root!.style.backgroundSize = 'cover';
root!.style.backgroundRepeat = 'no-repeat';
root!.style.backgroundPosition = 'center';
}
ReactDOM.createRoot(root!).render(
<React.StrictMode> <React.StrictMode>
<Provider store={store}> <Provider store={store}>
<NextUIProvider>
<App /> <App />
</NextUIProvider>
</Provider> </Provider>
</React.StrictMode> </React.StrictMode>
); );