Broke up the tutorial component into smaller components.

This commit is contained in:
Lucid Kobold
2022-06-23 15:02:44 -05:00
parent f808f6b250
commit a6e6e11ca3
12 changed files with 393 additions and 320 deletions

View File

@@ -3,11 +3,7 @@ import { Provider } from "react-redux";
import { store } from "../app/store";
import { useAppDispatch, useAppSelector } from "../app/hooks";
import { updateLoading } from "../features/calender";
import {
getAndSetTutorial,
setTempTutorialComplete,
setTutorialCompleted
} from "../features/tutorial";
import { getAndSetTutorial } from "../features/tutorial";
import { Box } from "@chakra-ui/react";
import { format } from "date-fns";
import Calender from "../components/calender";
@@ -30,14 +26,6 @@ const IndexPage = (): JSX.Element => {
day: parseInt(format(new Date(), "d"))
});
const handleTempTutorialCompleted = (): void => {
dispatch(setTempTutorialComplete());
};
const handleTutorialCompleted = (): void => {
dispatch(setTutorialCompleted());
};
useEffect(() => {
if (completedTutorial === null && tutorialCompletionInfo === null) {
dispatch(getAndSetTutorial());
@@ -59,11 +47,7 @@ const IndexPage = (): JSX.Element => {
) : completedTutorial ? (
<Calender date={currDate.current} isLoading={isLoading} />
) : (
<Tutorial
setTutorialComplete={handleTutorialCompleted}
setTempTutorialComplete={handleTempTutorialCompleted}
isLoading={isLoading}
/>
<Tutorial isLoading={isLoading} />
)}
</Provider>
</Box>