2023-12-11 23:38:52 +07:00
|
|
|
import React from 'react';
|
|
|
|
import { Provider, useSelector } from 'react-redux';
|
2023-12-11 23:41:33 +07:00
|
|
|
import { AppActions, RootState, store } from './store';
|
2023-12-11 23:38:52 +07:00
|
|
|
import { ToastContainer } from 'react-toastify';
|
|
|
|
import { Box } from 'lr-components';
|
|
|
|
import { NextUIProvider } from '@nextui-org/react';
|
2023-12-11 23:41:33 +07:00
|
|
|
import AppActionHook from './components/AppActionHook';
|
2023-12-11 23:38:52 +07:00
|
|
|
|
|
|
|
function App() {
|
|
|
|
const show = useSelector((state: RootState) => state.state.show);
|
|
|
|
return (
|
|
|
|
show && (
|
|
|
|
<NextUIProvider>
|
|
|
|
<Provider store={store}>
|
2023-12-11 23:41:33 +07:00
|
|
|
<Box
|
|
|
|
display='flex'
|
|
|
|
position='absolute'
|
|
|
|
flexWrap='wrap'
|
|
|
|
justifyContent='center'
|
|
|
|
alignItems='center'
|
|
|
|
flexDirection='column'
|
|
|
|
width={'50%'}
|
|
|
|
height={'50%'}
|
|
|
|
rGap={10}
|
|
|
|
>
|
|
|
|
{Object.keys(AppActions).map((action) => {
|
|
|
|
return (
|
|
|
|
<AppActionHook
|
|
|
|
action={action as keyof typeof AppActions}
|
|
|
|
></AppActionHook>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</Box>
|
2023-12-11 23:38:52 +07:00
|
|
|
<Box
|
|
|
|
width={'100%'}
|
|
|
|
height={'100%'}
|
|
|
|
display='flex'
|
|
|
|
justifyContent='center'
|
|
|
|
alignItems='center'
|
|
|
|
className='prose'
|
|
|
|
pointerEvents='none'
|
|
|
|
></Box>
|
|
|
|
|
|
|
|
<ToastContainer pauseOnFocusLoss={false} hideProgressBar={true} />
|
|
|
|
</Provider>
|
|
|
|
</NextUIProvider>
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|