2022-09-16 17:18:15 +00:00
|
|
|
import { Grid, GridItem } from '@chakra-ui/react';
|
2022-09-17 06:32:59 +00:00
|
|
|
import CurrentImageDisplay from './features/gallery/CurrentImageDisplay';
|
2022-09-16 17:18:15 +00:00
|
|
|
import LogViewer from './features/system/LogViewer';
|
|
|
|
import PromptInput from './features/sd/PromptInput';
|
|
|
|
import ProgressBar from './features/header/ProgressBar';
|
|
|
|
import { useEffect } from 'react';
|
|
|
|
import { useAppDispatch } from './app/hooks';
|
|
|
|
import { requestAllImages } from './app/socketio';
|
|
|
|
import ProcessButtons from './features/sd/ProcessButtons';
|
2022-09-17 06:32:59 +00:00
|
|
|
import ImageGallery from './features/gallery/ImageGallery';
|
2022-09-16 17:18:15 +00:00
|
|
|
import SiteHeader from './features/header/SiteHeader';
|
|
|
|
import OptionsAccordion from './features/sd/OptionsAccordion';
|
|
|
|
|
|
|
|
const App = () => {
|
2022-09-17 06:32:59 +00:00
|
|
|
const dispatch = useAppDispatch();
|
|
|
|
|
|
|
|
// Load images from the gallery once
|
|
|
|
useEffect(() => {
|
|
|
|
dispatch(requestAllImages());
|
|
|
|
}, [dispatch]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Grid
|
|
|
|
width="100vw"
|
|
|
|
height="100vh"
|
|
|
|
templateAreas={`
|
2022-09-16 17:18:15 +00:00
|
|
|
"header header header header"
|
|
|
|
"progressBar progressBar progressBar progressBar"
|
|
|
|
"menu prompt processButtons imageRoll"
|
|
|
|
"menu currentImage currentImage imageRoll"`}
|
2022-09-17 06:32:59 +00:00
|
|
|
gridTemplateRows={'36px 10px 100px auto'}
|
|
|
|
gridTemplateColumns={'350px auto 100px 388px'}
|
|
|
|
gap={2}
|
|
|
|
>
|
|
|
|
<GridItem area={'header'} pt={1}>
|
|
|
|
<SiteHeader />
|
|
|
|
</GridItem>
|
|
|
|
<GridItem area={'progressBar'}>
|
|
|
|
<ProgressBar />
|
|
|
|
</GridItem>
|
|
|
|
<GridItem pl="2" area={'menu'} overflowY="scroll">
|
|
|
|
<OptionsAccordion />
|
|
|
|
</GridItem>
|
|
|
|
<GridItem area={'prompt'}>
|
|
|
|
<PromptInput />
|
|
|
|
</GridItem>
|
|
|
|
<GridItem area={'processButtons'}>
|
|
|
|
<ProcessButtons />
|
|
|
|
</GridItem>
|
|
|
|
<GridItem area={'currentImage'}>
|
|
|
|
<CurrentImageDisplay />
|
|
|
|
</GridItem>
|
|
|
|
<GridItem pr="2" area={'imageRoll'} overflowY="scroll">
|
|
|
|
<ImageGallery />
|
|
|
|
</GridItem>
|
|
|
|
</Grid>
|
|
|
|
<LogViewer />
|
|
|
|
</>
|
|
|
|
);
|
2022-09-16 17:18:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default App;
|