diff --git a/src/pages/Home/Home.module.css b/src/pages/Visualization/Visualization.module.css
similarity index 100%
rename from src/pages/Home/Home.module.css
rename to src/pages/Visualization/Visualization.module.css
diff --git a/src/pages/Visualization/Visualization.tsx b/src/pages/Visualization/Visualization.tsx
new file mode 100644
index 00000000..b8075792
--- /dev/null
+++ b/src/pages/Visualization/Visualization.tsx
@@ -0,0 +1,188 @@
+import { createContext, useState, Dispatch, SetStateAction, useCallback, useEffect, useRef } from "react";
+
+import { useMutation } from "@tanstack/react-query";
+import styles from "./Visualization.module.css";
+import "./gutter.css";
+import PublicHeader from "../components/PublicHeader";
+import LoggedInHeader from "../components/LoggedInHeader";
+import LeftSection from "./components/LeftSection/LeftSection";
+import RightSection from "./components/RightSection/RightSection";
+
+import Split from "react-split";
+import { ValidTypeDto, isValidTypeDtoArray } from "@/pages/Visualization/types/dto/ValidTypeDto";
+
+//zustand store
+import { useConsoleStore, useCodeFlowLengthStore } from "@/store/console";
+import { useArrowStore } from "@/store/arrow";
+import { useUserStore } from "@/store/user";
+// 원본 코드 타입 정의
+interface CodeContextType {
+ code: string;
+ setCode: Dispatch
>;
+}
+// 전처리한 코드 타입 정의
+interface PreprocessedCodeContextType {
+ preprocessedCodes: ValidTypeDto[];
+ setPreprocessedCodes: Dispatch>;
+}
+// Create contexts
+export const CodeContext = createContext({
+ code: "",
+ setCode: () => {},
+});
+
+export const PreprocessedCodesContext = createContext({
+ preprocessedCodes: [],
+ setPreprocessedCodes: () => {},
+});
+
+export default function Visualization() {
+ const [code, setCode] = useState(
+ ["a = 3", "for i in range(a):", " print(' ' * ((a - 1) - i), end = '')", " print('*' * (2 * i + 1))"].join("\n")
+ );
+ const [preprocessedCodes, setPreprocessedCodes] = useState([]);
+ // zustand store
+ const consoleIdx = useConsoleStore((state) => state.consoleIdx);
+ const resetConsole = useConsoleStore((state) => state.resetConsole);
+ const incrementConsoleIdx = useConsoleStore((state) => state.incrementConsoleIdx);
+ const decrementConsoleIdx = useConsoleStore((state) => state.decrementConsoleIdx);
+ const codeFlowLength = useCodeFlowLengthStore((state) => state.codeFlowLength);
+ const setDisplayNone = useArrowStore((state) => state.setDisplayNone);
+ const loggedInUserName = useUserStore((state) => state.loggedInUserName);
+ const [isPlaying, setIsPlaying] = useState(false);
+
+ const mutation = useMutation({
+ mutationFn: async (code: string) => {
+ return fetch("http://localhost:8080/edupi_visualize/v1/python", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ source_code: code }),
+ });
+ },
+ async onSuccess(data) {
+ try {
+ const jsonData = await data.json();
+ // 타입 체크 함수
+ if (isValidTypeDtoArray(jsonData)) {
+ setPreprocessedCodes(jsonData);
+ setDisplayNone(false);
+ } else {
+ throw new Error("데이터 형식이 올바르지 않습니다");
+ }
+ } catch (error) {
+ console.error("Data processing error:", error);
+ alert("데이터의 형식이 올바르지 않습니다.");
+ }
+ },
+ onError(error) {
+ console.error("Submit Error:", error);
+ alert("코드 처리 중 에러가 발생했습니다.");
+ },
+ });
+ const handleSubmit = (event: React.FormEvent) => {
+ event.preventDefault();
+ resetConsole();
+ mutation.mutate(code);
+ setIsPlaying(() => true);
+ };
+
+ const onPlay = () => {
+ if (codeFlowLength === 0) return;
+ setIsPlaying((prev) => !prev);
+ };
+
+ const onForward = useCallback(() => {
+ if (consoleIdx < codeFlowLength - 1) {
+ incrementConsoleIdx();
+ }
+ }, [consoleIdx, codeFlowLength]);
+
+ const onBack = useCallback(() => {
+ if (consoleIdx > 0) {
+ decrementConsoleIdx();
+ }
+ }, [consoleIdx]);
+ const intervalRef = useRef(null);
+ useEffect(() => {
+ if (isPlaying) {
+ intervalRef.current = setInterval(onForward, 1000);
+ } else {
+ if (intervalRef.current) {
+ clearInterval(intervalRef.current);
+ }
+ }
+ return () => {
+ if (intervalRef.current) {
+ clearInterval(intervalRef.current);
+ }
+ };
+ }, [isPlaying, consoleIdx, codeFlowLength]);
+
+ return (
+
+
+ {loggedInUserName === "" ? : }
+
+
+
+
+
+
+ 실행코드
+
+
+
+
+
+
+
+
+
+ {isPlaying ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+ ({consoleIdx}/{codeFlowLength - 1 == -1 ? 0 : codeFlowLength - 1})
+
+
Play Speed
+
+ 1X
+ 2X
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/pages/Home/components/LeftSection/LeftSection.module.css b/src/pages/Visualization/components/LeftSection/LeftSection.module.css
similarity index 100%
rename from src/pages/Home/components/LeftSection/LeftSection.module.css
rename to src/pages/Visualization/components/LeftSection/LeftSection.module.css
diff --git a/src/pages/Home/components/LeftSection/LeftSection.tsx b/src/pages/Visualization/components/LeftSection/LeftSection.tsx
similarity index 100%
rename from src/pages/Home/components/LeftSection/LeftSection.tsx
rename to src/pages/Visualization/components/LeftSection/LeftSection.tsx
diff --git a/src/pages/Home/components/LeftSection/components/CodeEditor.module.css b/src/pages/Visualization/components/LeftSection/components/CodeEditor.module.css
similarity index 100%
rename from src/pages/Home/components/LeftSection/components/CodeEditor.module.css
rename to src/pages/Visualization/components/LeftSection/components/CodeEditor.module.css
diff --git a/src/pages/Home/components/LeftSection/components/CodeEditor.tsx b/src/pages/Visualization/components/LeftSection/components/CodeEditor.tsx
similarity index 97%
rename from src/pages/Home/components/LeftSection/components/CodeEditor.tsx
rename to src/pages/Visualization/components/LeftSection/components/CodeEditor.tsx
index 43932f3b..75623294 100644
--- a/src/pages/Home/components/LeftSection/components/CodeEditor.tsx
+++ b/src/pages/Visualization/components/LeftSection/components/CodeEditor.tsx
@@ -1,7 +1,7 @@
import { useContext, Fragment, useRef, useEffect, useState } from "react";
import Editor, { OnMount } from "@monaco-editor/react";
import * as monaco from "monaco-editor";
-import { CodeContext } from "../../../Home";
+import { CodeContext } from "../../../Visualization";
// Zustand
import { useEditorStore } from "@/store/editor";
diff --git a/src/pages/Home/components/LeftSection/components/Console.module.css b/src/pages/Visualization/components/LeftSection/components/Console.module.css
similarity index 100%
rename from src/pages/Home/components/LeftSection/components/Console.module.css
rename to src/pages/Visualization/components/LeftSection/components/Console.module.css
diff --git a/src/pages/Home/components/LeftSection/components/Console.tsx b/src/pages/Visualization/components/LeftSection/components/Console.tsx
similarity index 100%
rename from src/pages/Home/components/LeftSection/components/Console.tsx
rename to src/pages/Visualization/components/LeftSection/components/Console.tsx
diff --git a/src/pages/Home/components/RightSection/RightSection.tsx b/src/pages/Visualization/components/RightSection/RightSection.tsx
similarity index 93%
rename from src/pages/Home/components/RightSection/RightSection.tsx
rename to src/pages/Visualization/components/RightSection/RightSection.tsx
index e709d377..7e9c6fed 100644
--- a/src/pages/Home/components/RightSection/RightSection.tsx
+++ b/src/pages/Visualization/components/RightSection/RightSection.tsx
@@ -1,6 +1,5 @@
import { useState, useContext, useEffect, useRef } from "react";
-import { PreprocessedCodesContext } from "../../Home";
-import "./RightSection.css";
+import { PreprocessedCodesContext } from "../../Visualization";
import Split from "react-split";
import _ from "lodash";
import ResizeObserver from "resize-observer-polyfill";
@@ -8,17 +7,17 @@ import ResizeObserver from "resize-observer-polyfill";
import Arrow from "./components/Arrow/Arrow";
// 타입 정의
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
-import { ActivateItem } from "@/pages/Home/types/activateItem";
-import { VariablesDto } from "@/pages/Home/types/dto/variablesDto";
-import { ForDto } from "@/pages/Home/types/dto/forDto";
-import { PrintDto } from "@/pages/Home/types/dto/printDto";
-import { IfElseDto } from "@/pages/Home/types/dto/ifElseDto";
-import { CodeFlowVariableDto } from "@/pages/Home/types/dto/codeFlowVariableDto";
-import { PrintItem } from "@/pages/Home/types/codeFlow/printItem";
-import { VariableDto } from "@/pages/Home/types/dto/variableDto";
-import { WhileDto } from "@/pages/Home/types/dto/whileDto";
-import { AllDataStructureItem } from "@/pages/Home/types/dataStructuresItem/allDataStructureItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
+import { ActivateItem } from "@/pages/Visualization/types/activateItem";
+import { VariablesDto } from "@/pages/Visualization/types/dto/variablesDto";
+import { ForDto } from "@/pages/Visualization/types/dto/forDto";
+import { PrintDto } from "@/pages/Visualization/types/dto/printDto";
+import { IfElseDto } from "@/pages/Visualization/types/dto/ifElseDto";
+import { CodeFlowVariableDto } from "@/pages/Visualization/types/dto/codeFlowVariableDto";
+import { PrintItem } from "@/pages/Visualization/types/codeFlow/printItem";
+import { VariableDto } from "@/pages/Visualization/types/dto/variableDto";
+import { WhileDto } from "@/pages/Visualization/types/dto/whileDto";
+import { AllDataStructureItem } from "@/pages/Visualization/types/dataStructuresItem/allDataStructureItem";
// services폴더에서 가져온 함수
import { addCodeFlow } from "./services/addCodeFlow";
import { insertIntoDepth } from "./services/insertIntoDepth";
@@ -35,7 +34,7 @@ import { findDeleteUsedId } from "./services/findDeleteUsedId";
//rendUtils에서 가져온 함수
import { renderingStructure } from "./renderingStructure";
import { renderingCodeFlow } from "./renderingCodeFlow";
-import { IfElseChangeDto } from "@/pages/Home/types/dto/ifElseChangeDto";
+import { IfElseChangeDto } from "@/pages/Visualization/types/dto/ifElseChangeDto";
import { refreshCodeFlow } from "./services/refreshCodeFlow";
import { deleteCodeFlow } from "./services/deleteCodeFlow";
diff --git a/src/pages/Home/components/RightSection/components/Arrow/Arrow.tsx b/src/pages/Visualization/components/RightSection/components/Arrow/Arrow.tsx
similarity index 100%
rename from src/pages/Home/components/RightSection/components/Arrow/Arrow.tsx
rename to src/pages/Visualization/components/RightSection/components/Arrow/Arrow.tsx
diff --git a/src/pages/Home/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.module.css b/src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.module.css
rename to src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.module.css
diff --git a/src/pages/Home/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.tsx b/src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.tsx
similarity index 94%
rename from src/pages/Home/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.tsx
rename to src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.tsx
index 2816b91c..f9816c0d 100644
--- a/src/pages/Home/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.tsx
+++ b/src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/CodeFlowListWrapper.tsx
@@ -4,7 +4,7 @@ import styles from "./CodeFlowListWrapper.module.css";
//components
import CodeFlowListBlock from "./components/CodeFlowListBlock";
//type
-import { CodeFlowListItem } from "@/pages/Home/types/codeFlow/codeFlowListItem";
+import { CodeFlowListItem } from "@/pages/Visualization/types/codeFlow/codeFlowListItem";
//zustand
import { useArrowStore } from "@/store/arrow";
interface CodeFlowWrapperItemProps {
diff --git a/src/pages/Home/components/RightSection/components/CodeFlowListWrapper/components/CodeFlowListBlock.tsx b/src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/components/CodeFlowListBlock.tsx
similarity index 100%
rename from src/pages/Home/components/RightSection/components/CodeFlowListWrapper/components/CodeFlowListBlock.tsx
rename to src/pages/Visualization/components/RightSection/components/CodeFlowListWrapper/components/CodeFlowListBlock.tsx
diff --git a/src/pages/Home/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.module.css b/src/pages/Visualization/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.module.css
rename to src/pages/Visualization/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.tsx b/src/pages/Visualization/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.tsx
similarity index 94%
rename from src/pages/Home/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.tsx
rename to src/pages/Visualization/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.tsx
index 2f34840d..859ede97 100644
--- a/src/pages/Home/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/CodeFlowVariableBox/CodeFlowVariableBox.tsx
@@ -3,7 +3,7 @@ import styles from "./CodeFlowVariableBox.module.css";
import cx from "classnames";
//type
-import { CodeFlowVariableItem } from "@/pages/Home/types/codeFlow/codeFlowVariableItem";
+import { CodeFlowVariableItem } from "@/pages/Visualization/types/codeFlow/codeFlowVariableItem";
//zustand
import { useArrowStore } from "@/store/arrow";
diff --git a/src/pages/Home/components/RightSection/components/ElifBox/ElifBox.module.css b/src/pages/Visualization/components/RightSection/components/ElifBox/ElifBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/ElifBox/ElifBox.module.css
rename to src/pages/Visualization/components/RightSection/components/ElifBox/ElifBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/ElifBox/ElifBox.tsx b/src/pages/Visualization/components/RightSection/components/ElifBox/ElifBox.tsx
similarity index 94%
rename from src/pages/Home/components/RightSection/components/ElifBox/ElifBox.tsx
rename to src/pages/Visualization/components/RightSection/components/ElifBox/ElifBox.tsx
index 97a1baf8..b10bcac0 100644
--- a/src/pages/Home/components/RightSection/components/ElifBox/ElifBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/ElifBox/ElifBox.tsx
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
import styles from "./ElifBox.module.css";
import cx from "classnames";
import { AnimatePresence, motion } from "framer-motion";
-import { ConditionItem } from "@/pages/Home/types/conditionItem";
+import { ConditionItem } from "@/pages/Visualization/types/codeFlow/conditionItem";
type Props = {
children: ReactNode;
diff --git a/src/pages/Home/components/RightSection/components/ElseBox/ElseBox.module.css b/src/pages/Visualization/components/RightSection/components/ElseBox/ElseBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/ElseBox/ElseBox.module.css
rename to src/pages/Visualization/components/RightSection/components/ElseBox/ElseBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/ElseBox/ElseBox.tsx b/src/pages/Visualization/components/RightSection/components/ElseBox/ElseBox.tsx
similarity index 94%
rename from src/pages/Home/components/RightSection/components/ElseBox/ElseBox.tsx
rename to src/pages/Visualization/components/RightSection/components/ElseBox/ElseBox.tsx
index e9e13f41..c5a1648b 100644
--- a/src/pages/Home/components/RightSection/components/ElseBox/ElseBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/ElseBox/ElseBox.tsx
@@ -1,7 +1,7 @@
import { ReactNode } from "react";
import cx from "classnames";
import { AnimatePresence, motion } from "framer-motion";
-import { ConditionItem } from "@/pages/Home/types/conditionItem";
+import { ConditionItem } from "@/pages/Visualization/types/codeFlow/conditionItem";
type Props = {
children?: ReactNode;
isLight: boolean;
diff --git a/src/pages/Home/components/RightSection/components/ForBox/ForBox.module.css b/src/pages/Visualization/components/RightSection/components/ForBox/ForBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/ForBox/ForBox.module.css
rename to src/pages/Visualization/components/RightSection/components/ForBox/ForBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/ForBox/ForBox.tsx b/src/pages/Visualization/components/RightSection/components/ForBox/ForBox.tsx
similarity index 97%
rename from src/pages/Home/components/RightSection/components/ForBox/ForBox.tsx
rename to src/pages/Visualization/components/RightSection/components/ForBox/ForBox.tsx
index ae4867c1..fdbd616d 100644
--- a/src/pages/Home/components/RightSection/components/ForBox/ForBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/ForBox/ForBox.tsx
@@ -4,7 +4,7 @@ import cx from "classnames";
import { AnimatePresence, motion } from "framer-motion";
//type
-import { ForItem } from "@/pages/Home/types/forItem";
+import { ForItem } from "@/pages/Visualization/types/codeFlow/forItem";
//zustand
import { useArrowStore } from "@/store/arrow";
interface ForItemProps {
diff --git a/src/pages/Home/components/RightSection/components/IfBox/IfBox.module.css b/src/pages/Visualization/components/RightSection/components/IfBox/IfBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/IfBox/IfBox.module.css
rename to src/pages/Visualization/components/RightSection/components/IfBox/IfBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/IfBox/IfBox.tsx b/src/pages/Visualization/components/RightSection/components/IfBox/IfBox.tsx
similarity index 94%
rename from src/pages/Home/components/RightSection/components/IfBox/IfBox.tsx
rename to src/pages/Visualization/components/RightSection/components/IfBox/IfBox.tsx
index cfcb6426..aebbb84a 100644
--- a/src/pages/Home/components/RightSection/components/IfBox/IfBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/IfBox/IfBox.tsx
@@ -3,7 +3,7 @@ import { ReactNode } from "react";
import styles from "./IfBox.module.css";
import cx from "classnames";
import { AnimatePresence, motion } from "framer-motion";
-import { ConditionItem } from "@/pages/Home/types/conditionItem";
+import { ConditionItem } from "@/pages/Visualization/types/codeFlow/conditionItem";
type Props = { children?: ReactNode; isLight: boolean; ifItem: ConditionItem };
function IfBox({ children, isLight, ifItem }: Props) {
diff --git a/src/pages/Home/components/RightSection/components/ListWrapper/ListWrapper.module.css b/src/pages/Visualization/components/RightSection/components/ListWrapper/ListWrapper.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/ListWrapper/ListWrapper.module.css
rename to src/pages/Visualization/components/RightSection/components/ListWrapper/ListWrapper.module.css
diff --git a/src/pages/Home/components/RightSection/components/ListWrapper/ListWrapper.tsx b/src/pages/Visualization/components/RightSection/components/ListWrapper/ListWrapper.tsx
similarity index 84%
rename from src/pages/Home/components/RightSection/components/ListWrapper/ListWrapper.tsx
rename to src/pages/Visualization/components/RightSection/components/ListWrapper/ListWrapper.tsx
index b5840106..f1aedbf8 100644
--- a/src/pages/Home/components/RightSection/components/ListWrapper/ListWrapper.tsx
+++ b/src/pages/Visualization/components/RightSection/components/ListWrapper/ListWrapper.tsx
@@ -1,6 +1,6 @@
import styles from "./ListWrapper.module.css";
import { ListBlock } from "./components/ListBlock";
-import { DataStructureListItem } from "@/pages/Home/types/dataStructureListItem";
+import { DataStructureListItem } from "@/pages/Visualization/types/dataStructuresItem/dataStructureListItem";
type Props = {
listItem: DataStructureListItem;
};
diff --git a/src/pages/Home/components/RightSection/components/ListWrapper/components/ListBlock.tsx b/src/pages/Visualization/components/RightSection/components/ListWrapper/components/ListBlock.tsx
similarity index 96%
rename from src/pages/Home/components/RightSection/components/ListWrapper/components/ListBlock.tsx
rename to src/pages/Visualization/components/RightSection/components/ListWrapper/components/ListBlock.tsx
index cf0fcfbd..739eb17d 100644
--- a/src/pages/Home/components/RightSection/components/ListWrapper/components/ListBlock.tsx
+++ b/src/pages/Visualization/components/RightSection/components/ListWrapper/components/ListBlock.tsx
@@ -3,7 +3,7 @@ import cx from "classnames";
type Props = {
exprItem: string;
- isLight: boolean;
+ isLight?: boolean;
index: number;
};
export const ListBlock = ({ exprItem, isLight, index }: Props) => {
diff --git a/src/pages/Home/components/RightSection/components/PrintBox/PrintBox.module.css b/src/pages/Visualization/components/RightSection/components/PrintBox/PrintBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/PrintBox/PrintBox.module.css
rename to src/pages/Visualization/components/RightSection/components/PrintBox/PrintBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/PrintBox/PrintBox.tsx b/src/pages/Visualization/components/RightSection/components/PrintBox/PrintBox.tsx
similarity index 96%
rename from src/pages/Home/components/RightSection/components/PrintBox/PrintBox.tsx
rename to src/pages/Visualization/components/RightSection/components/PrintBox/PrintBox.tsx
index 6e0ec29c..5184d3d7 100644
--- a/src/pages/Home/components/RightSection/components/PrintBox/PrintBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/PrintBox/PrintBox.tsx
@@ -1,6 +1,6 @@
import cx from "classnames";
import styles from "./PrintBox.module.css";
-import { PrintItem } from "@/pages/Home/types/printItem";
+import { PrintItem } from "@/pages/Visualization/types/codeFlow/printItem";
import { AnimatePresence, motion } from "framer-motion";
type Props = {
diff --git a/src/pages/Home/components/RightSection/components/VariableBox/VariableBox.module.css b/src/pages/Visualization/components/RightSection/components/VariableBox/VariableBox.module.css
similarity index 100%
rename from src/pages/Home/components/RightSection/components/VariableBox/VariableBox.module.css
rename to src/pages/Visualization/components/RightSection/components/VariableBox/VariableBox.module.css
diff --git a/src/pages/Home/components/RightSection/components/VariableBox/VariableBox.tsx b/src/pages/Visualization/components/RightSection/components/VariableBox/VariableBox.tsx
similarity index 100%
rename from src/pages/Home/components/RightSection/components/VariableBox/VariableBox.tsx
rename to src/pages/Visualization/components/RightSection/components/VariableBox/VariableBox.tsx
diff --git a/src/pages/Home/components/RightSection/components/WhileBox/WhileBox.tsx b/src/pages/Visualization/components/RightSection/components/WhileBox/WhileBox.tsx
similarity index 95%
rename from src/pages/Home/components/RightSection/components/WhileBox/WhileBox.tsx
rename to src/pages/Visualization/components/RightSection/components/WhileBox/WhileBox.tsx
index 922738e4..2ed769eb 100644
--- a/src/pages/Home/components/RightSection/components/WhileBox/WhileBox.tsx
+++ b/src/pages/Visualization/components/RightSection/components/WhileBox/WhileBox.tsx
@@ -1,7 +1,7 @@
import { ReactNode } from "react";
import cx from "classnames";
-import { WhileItem } from "@/pages/Home/types/codeFlow/whileItem";
+import { WhileItem } from "@/pages/Visualization/types/codeFlow/whileItem";
import { AnimatePresence, motion } from "framer-motion";
type Props = {
diff --git a/src/pages/Home/components/RightSection/renderingCodeFlow.tsx b/src/pages/Visualization/components/RightSection/renderingCodeFlow.tsx
similarity index 89%
rename from src/pages/Home/components/RightSection/renderingCodeFlow.tsx
rename to src/pages/Visualization/components/RightSection/renderingCodeFlow.tsx
index 0fa1d567..c1b9f4cc 100644
--- a/src/pages/Home/components/RightSection/renderingCodeFlow.tsx
+++ b/src/pages/Visualization/components/RightSection/renderingCodeFlow.tsx
@@ -1,5 +1,5 @@
import { useRef, useEffect, ReactNode } from "react";
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
import { AnimatePresence, motion } from "framer-motion";
import { ReactElement } from "react";
import PrintBox from "./components/PrintBox/PrintBox";
@@ -12,13 +12,13 @@ import CodeFlowListWrapper from "./components/CodeFlowListWrapper/CodeFlowListWr
import WhileBox from "./components/WhileBox/WhileBox";
// type import
-import { ElseItem } from "@/pages/Home/types/codeFlow/elseItem";
-import { ForItem } from "@/pages/Home/types/codeFlow/forItem";
-import { PrintItem } from "@/pages/Home/types/codeFlow/printItem";
-import { ConditionItem } from "@/pages/Home/types/codeFlow/conditionItem";
-import { CodeFlowVariableItem } from "@/pages/Home/types/codeFlow/codeFlowVariableItem";
-import { CodeFlowListItem } from "@/pages/Home/types/codeFlow/codeFlowListItem";
-import { WhileItem } from "@/pages/Home/types/codeFlow/whileItem";
+import { ElseItem } from "@/pages/Visualization/types/codeFlow/elseItem";
+import { ForItem } from "@/pages/Visualization/types/codeFlow/forItem";
+import { PrintItem } from "@/pages/Visualization/types/codeFlow/printItem";
+import { ConditionItem } from "@/pages/Visualization/types/codeFlow/conditionItem";
+import { CodeFlowVariableItem } from "@/pages/Visualization/types/codeFlow/codeFlowVariableItem";
+import { CodeFlowListItem } from "@/pages/Visualization/types/codeFlow/codeFlowListItem";
+import { WhileItem } from "@/pages/Visualization/types/codeFlow/whileItem";
//zustand
import { useArrowStore } from "@/store/arrow";
@@ -35,7 +35,6 @@ const CodeFlowItem = ({ codeFlow, width, height, children }: Props) => {
const setRight = useArrowStore((state) => state.setRight);
useEffect(() => {
- console.log("codeFlow", codeFlow);
if (ref.current && codeFlow.isLight) {
const rect = ref.current.getBoundingClientRect();
setTop(rect.top);
diff --git a/src/pages/Home/components/RightSection/renderingStructure.tsx b/src/pages/Visualization/components/RightSection/renderingStructure.tsx
similarity index 93%
rename from src/pages/Home/components/RightSection/renderingStructure.tsx
rename to src/pages/Visualization/components/RightSection/renderingStructure.tsx
index 9f805552..fec9f5f2 100644
--- a/src/pages/Home/components/RightSection/renderingStructure.tsx
+++ b/src/pages/Visualization/components/RightSection/renderingStructure.tsx
@@ -6,8 +6,8 @@ import { ReactElement } from "react";
import VariableBox from "./components/VariableBox/VariableBox";
import ListWrapper from "./components/ListWrapper/ListWrapper";
//type
-import { DataStructureVarItem } from "@/pages/Home/types/dataStructureVarItem";
-import { DataStructureListItem } from "@/pages/Home/types/dataStructureListItem";
+import { DataStructureVarItem } from "@/pages/Visualization/types/dataStructuresItem/dataStructureVarItem";
+import { DataStructureListItem } from "@/pages/Visualization/types/dataStructuresItem/dataStructureListItem";
//zustand
import { useArrowStore } from "@/store/arrow";
diff --git a/src/pages/Home/components/RightSection/services/addCodeFlow.ts b/src/pages/Visualization/components/RightSection/services/addCodeFlow.ts
similarity index 91%
rename from src/pages/Home/components/RightSection/services/addCodeFlow.ts
rename to src/pages/Visualization/components/RightSection/services/addCodeFlow.ts
index 5785d53b..00435c87 100644
--- a/src/pages/Home/components/RightSection/services/addCodeFlow.ts
+++ b/src/pages/Visualization/components/RightSection/services/addCodeFlow.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
// 새로운 객체를 CodeFlow에 추가하는 함수
export const addCodeFlow = (
diff --git a/src/pages/Home/components/RightSection/services/createObjectToAdd.ts b/src/pages/Visualization/components/RightSection/services/createObjectToAdd.ts
similarity index 76%
rename from src/pages/Home/components/RightSection/services/createObjectToAdd.ts
rename to src/pages/Visualization/components/RightSection/services/createObjectToAdd.ts
index 894213f6..0b4a9665 100644
--- a/src/pages/Home/components/RightSection/services/createObjectToAdd.ts
+++ b/src/pages/Visualization/components/RightSection/services/createObjectToAdd.ts
@@ -1,14 +1,14 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
-import { ForItem } from "@/pages/Home/types/forItem";
-import { ConditionItem } from "@/pages/Home/types/conditionItem";
-import { PrintItem } from "@/pages/Home/types/printItem";
-import { ForDataToAdd } from "@/pages/Home/types/dataToAdd/forDataToAdd";
-import { PrintDataToAdd } from "@/pages/Home/types/dataToAdd/printDataToAdd";
-import { IfElseDataToAdd } from "@/pages/Home/types/dataToAdd/ifElseDataToAdd";
-import { IfElseChangeDataToAdd } from "@/pages/Home/types/dataToAdd/ifElseChangeDataToAdd";
-import { CodeFlowVariableDtoToAdd } from "@/pages/Home/types/dataToAdd/codeFlowVariableDataToAdd";
-import { WhileDto } from "@/pages/Home/types/dto/whileDto";
-import { CodeFlowListDto } from "@/pages/Home/types/dto/codeFlowListDto";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
+import { ForItem } from "@/pages/Visualization/types/codeFlow/forItem";
+import { ConditionItem } from "@/pages/Visualization/types/codeFlow/conditionItem";
+import { PrintItem } from "@/pages/Visualization/types/codeFlow/printItem";
+import { ForDataToAdd } from "@/pages/Visualization/types/dataToAdd/forDataToAdd";
+import { PrintDataToAdd } from "@/pages/Visualization/types/dataToAdd/printDataToAdd";
+import { IfElseDataToAdd } from "@/pages/Visualization/types/dataToAdd/ifElseDataToAdd";
+import { IfElseChangeDataToAdd } from "@/pages/Visualization/types/dataToAdd/ifElseChangeDataToAdd";
+import { CodeFlowVariableDtoToAdd } from "@/pages/Visualization/types/dataToAdd/codeFlowVariableDataToAdd";
+import { WhileDto } from "@/pages/Visualization/types/dto/whileDto";
+import { CodeFlowListDto } from "@/pages/Visualization/types/dto/codeFlowListDto";
// 스택에 넣을 객체를 생성하는 함수
export const createObjectToAdd = (
preprocessedCode: PrintDataToAdd | ForDataToAdd | IfElseDataToAdd | WhileDto
diff --git a/src/pages/Home/components/RightSection/services/deleteCodeFlow.ts b/src/pages/Visualization/components/RightSection/services/deleteCodeFlow.ts
similarity index 86%
rename from src/pages/Home/components/RightSection/services/deleteCodeFlow.ts
rename to src/pages/Visualization/components/RightSection/services/deleteCodeFlow.ts
index 9926521f..ce5f74f2 100644
--- a/src/pages/Home/components/RightSection/services/deleteCodeFlow.ts
+++ b/src/pages/Visualization/components/RightSection/services/deleteCodeFlow.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const deleteCodeFlow = (codeFlows: AllObjectItem[], toDeleteId: number): AllObjectItem[] => {
return codeFlows
diff --git a/src/pages/Home/components/RightSection/services/findDeleteUsedId.ts b/src/pages/Visualization/components/RightSection/services/findDeleteUsedId.ts
similarity index 80%
rename from src/pages/Home/components/RightSection/services/findDeleteUsedId.ts
rename to src/pages/Visualization/components/RightSection/services/findDeleteUsedId.ts
index d8075808..982c9648 100644
--- a/src/pages/Home/components/RightSection/services/findDeleteUsedId.ts
+++ b/src/pages/Visualization/components/RightSection/services/findDeleteUsedId.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const findDeleteUsedId = (targetChild: AllObjectItem[]): number[] => {
let idsToDelete: number[] = [];
diff --git a/src/pages/Home/components/RightSection/services/findTargetChild.ts b/src/pages/Visualization/components/RightSection/services/findTargetChild.ts
similarity index 85%
rename from src/pages/Home/components/RightSection/services/findTargetChild.ts
rename to src/pages/Visualization/components/RightSection/services/findTargetChild.ts
index bdb3fc21..47306433 100644
--- a/src/pages/Home/components/RightSection/services/findTargetChild.ts
+++ b/src/pages/Visualization/components/RightSection/services/findTargetChild.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const findTargetChild = (codeFlows: AllObjectItem[], toAddObject: AllObjectItem): AllObjectItem[] => {
let targetChild: AllObjectItem[] = [];
diff --git a/src/pages/Home/components/RightSection/services/insertEqualToDepth.ts b/src/pages/Visualization/components/RightSection/services/insertEqualToDepth.ts
similarity index 85%
rename from src/pages/Home/components/RightSection/services/insertEqualToDepth.ts
rename to src/pages/Visualization/components/RightSection/services/insertEqualToDepth.ts
index d43306ec..ab75edce 100644
--- a/src/pages/Home/components/RightSection/services/insertEqualToDepth.ts
+++ b/src/pages/Visualization/components/RightSection/services/insertEqualToDepth.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const insertEqualToDepth = (
codeFlows: AllObjectItem[],
diff --git a/src/pages/Home/components/RightSection/services/insertIntoDepth.ts b/src/pages/Visualization/components/RightSection/services/insertIntoDepth.ts
similarity index 86%
rename from src/pages/Home/components/RightSection/services/insertIntoDepth.ts
rename to src/pages/Visualization/components/RightSection/services/insertIntoDepth.ts
index 2434eda6..1162f79f 100644
--- a/src/pages/Home/components/RightSection/services/insertIntoDepth.ts
+++ b/src/pages/Visualization/components/RightSection/services/insertIntoDepth.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const insertIntoDepth = (
codeFlows: AllObjectItem[],
toAddObject: AllObjectItem,
diff --git a/src/pages/Home/components/RightSection/services/refreshCodeFlow.ts b/src/pages/Visualization/components/RightSection/services/refreshCodeFlow.ts
similarity index 92%
rename from src/pages/Home/components/RightSection/services/refreshCodeFlow.ts
rename to src/pages/Visualization/components/RightSection/services/refreshCodeFlow.ts
index ab7f7082..99611a29 100644
--- a/src/pages/Home/components/RightSection/services/refreshCodeFlow.ts
+++ b/src/pages/Visualization/components/RightSection/services/refreshCodeFlow.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const refreshCodeFlow = (
codeFlows: AllObjectItem[], //현제 코드흐름 시각화 정보를 담고 있는 리스트
diff --git a/src/pages/Home/components/RightSection/services/turnLight.ts b/src/pages/Visualization/components/RightSection/services/turnLight.ts
similarity index 83%
rename from src/pages/Home/components/RightSection/services/turnLight.ts
rename to src/pages/Visualization/components/RightSection/services/turnLight.ts
index 85d73610..117df4cd 100644
--- a/src/pages/Home/components/RightSection/services/turnLight.ts
+++ b/src/pages/Visualization/components/RightSection/services/turnLight.ts
@@ -1,5 +1,5 @@
-import { ActivateItem } from "@/pages/Home/types/activateItem";
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { ActivateItem } from "@/pages/Visualization/types/activateItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
// 하이라이트 효과를 줘야하는 부분을 표시해주는 함수
export const turnLight = (
diff --git a/src/pages/Home/components/RightSection/services/turnOffAllNodeLight.ts b/src/pages/Visualization/components/RightSection/services/turnOffAllNodeLight.ts
similarity index 74%
rename from src/pages/Home/components/RightSection/services/turnOffAllNodeLight.ts
rename to src/pages/Visualization/components/RightSection/services/turnOffAllNodeLight.ts
index 0d222b71..3f3a3865 100644
--- a/src/pages/Home/components/RightSection/services/turnOffAllNodeLight.ts
+++ b/src/pages/Visualization/components/RightSection/services/turnOffAllNodeLight.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
export const turnOffAllNodeLight = (codeFlows: AllObjectItem[]): AllObjectItem[] => {
return codeFlows.map((codeFlow) => {
diff --git a/src/pages/Home/components/RightSection/services/updateActivate.ts b/src/pages/Visualization/components/RightSection/services/updateActivate.ts
similarity index 85%
rename from src/pages/Home/components/RightSection/services/updateActivate.ts
rename to src/pages/Visualization/components/RightSection/services/updateActivate.ts
index 5e3b9314..31dcca27 100644
--- a/src/pages/Home/components/RightSection/services/updateActivate.ts
+++ b/src/pages/Visualization/components/RightSection/services/updateActivate.ts
@@ -1,5 +1,5 @@
-import { ActivateItem } from "@/pages/Home/types/activateItem";
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { ActivateItem } from "@/pages/Visualization/types/activateItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
// 현재 불이 켜져야하는 부분을 표시해주는 함수
export const updateActivate = (
diff --git a/src/pages/Home/components/RightSection/services/updateCodeFlow.ts b/src/pages/Visualization/components/RightSection/services/updateCodeFlow.ts
similarity index 93%
rename from src/pages/Home/components/RightSection/services/updateCodeFlow.ts
rename to src/pages/Visualization/components/RightSection/services/updateCodeFlow.ts
index 16e6139b..a3481c28 100644
--- a/src/pages/Home/components/RightSection/services/updateCodeFlow.ts
+++ b/src/pages/Visualization/components/RightSection/services/updateCodeFlow.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "@/pages/Home/types/codeFlow/allObjectItem";
+import { AllObjectItem } from "@/pages/Visualization/types/codeFlow/allObjectItem";
// 객체를 수정해야하는 경우에 실행하는 함수
export const updateCodeFlow = (
diff --git a/src/pages/Home/components/RightSection/services/updateDataStructure.ts b/src/pages/Visualization/components/RightSection/services/updateDataStructure.ts
similarity index 81%
rename from src/pages/Home/components/RightSection/services/updateDataStructure.ts
rename to src/pages/Visualization/components/RightSection/services/updateDataStructure.ts
index 65822dc5..0f476839 100644
--- a/src/pages/Home/components/RightSection/services/updateDataStructure.ts
+++ b/src/pages/Visualization/components/RightSection/services/updateDataStructure.ts
@@ -1,4 +1,4 @@
-import { AllDataStructureItem } from "@/pages/Home/types/dataStructuresItem/allDataStructureItem";
+import { AllDataStructureItem } from "@/pages/Visualization/types/dataStructuresItem/allDataStructureItem";
// 자료구조 부분을 수정할때 실행하는 함수
export const updateDataStructure = (
targetName: string,
diff --git a/src/pages/Home/gutter.css b/src/pages/Visualization/gutter.css
similarity index 100%
rename from src/pages/Home/gutter.css
rename to src/pages/Visualization/gutter.css
diff --git a/src/pages/Home/types/activateItem.ts b/src/pages/Visualization/types/activateItem.ts
similarity index 100%
rename from src/pages/Home/types/activateItem.ts
rename to src/pages/Visualization/types/activateItem.ts
diff --git a/src/pages/Home/types/codeFlow/allObjectItem.ts b/src/pages/Visualization/types/codeFlow/allObjectItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/allObjectItem.ts
rename to src/pages/Visualization/types/codeFlow/allObjectItem.ts
diff --git a/src/pages/Home/types/codeFlow/assignVizItem.ts b/src/pages/Visualization/types/codeFlow/assignVizItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/assignVizItem.ts
rename to src/pages/Visualization/types/codeFlow/assignVizItem.ts
diff --git a/src/pages/Home/types/codeFlow/codeFlowListItem.ts b/src/pages/Visualization/types/codeFlow/codeFlowListItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/codeFlowListItem.ts
rename to src/pages/Visualization/types/codeFlow/codeFlowListItem.ts
diff --git a/src/pages/Home/types/codeFlow/codeFlowVariableItem.ts b/src/pages/Visualization/types/codeFlow/codeFlowVariableItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/codeFlowVariableItem.ts
rename to src/pages/Visualization/types/codeFlow/codeFlowVariableItem.ts
diff --git a/src/pages/Home/types/codeFlow/conditionItem.ts b/src/pages/Visualization/types/codeFlow/conditionItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/conditionItem.ts
rename to src/pages/Visualization/types/codeFlow/conditionItem.ts
diff --git a/src/pages/Home/types/codeFlow/elseItem.ts b/src/pages/Visualization/types/codeFlow/elseItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/elseItem.ts
rename to src/pages/Visualization/types/codeFlow/elseItem.ts
diff --git a/src/pages/Home/types/codeFlow/forItem.ts b/src/pages/Visualization/types/codeFlow/forItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/forItem.ts
rename to src/pages/Visualization/types/codeFlow/forItem.ts
diff --git a/src/pages/Home/types/codeFlow/listItem.ts b/src/pages/Visualization/types/codeFlow/listItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/listItem.ts
rename to src/pages/Visualization/types/codeFlow/listItem.ts
diff --git a/src/pages/Home/types/codeFlow/printItem.ts b/src/pages/Visualization/types/codeFlow/printItem.ts
similarity index 76%
rename from src/pages/Home/types/codeFlow/printItem.ts
rename to src/pages/Visualization/types/codeFlow/printItem.ts
index 87284ed8..49d93556 100644
--- a/src/pages/Home/types/codeFlow/printItem.ts
+++ b/src/pages/Visualization/types/codeFlow/printItem.ts
@@ -1,4 +1,4 @@
-import { AllObjectItem } from "./codeFlow/allObjectItem";
+import { AllObjectItem } from "./allObjectItem";
export interface PrintItem {
id: number;
diff --git a/src/pages/Home/types/codeFlow/whileItem.ts b/src/pages/Visualization/types/codeFlow/whileItem.ts
similarity index 100%
rename from src/pages/Home/types/codeFlow/whileItem.ts
rename to src/pages/Visualization/types/codeFlow/whileItem.ts
diff --git a/src/pages/Home/types/dataStructuresItem/allDataStructureItem.ts b/src/pages/Visualization/types/dataStructuresItem/allDataStructureItem.ts
similarity index 100%
rename from src/pages/Home/types/dataStructuresItem/allDataStructureItem.ts
rename to src/pages/Visualization/types/dataStructuresItem/allDataStructureItem.ts
diff --git a/src/pages/Home/types/dataStructuresItem/dataStructureListItem.ts b/src/pages/Visualization/types/dataStructuresItem/dataStructureListItem.ts
similarity index 100%
rename from src/pages/Home/types/dataStructuresItem/dataStructureListItem.ts
rename to src/pages/Visualization/types/dataStructuresItem/dataStructureListItem.ts
diff --git a/src/pages/Home/types/dataStructuresItem/dataStructureVarItem.ts b/src/pages/Visualization/types/dataStructuresItem/dataStructureVarItem.ts
similarity index 100%
rename from src/pages/Home/types/dataStructuresItem/dataStructureVarItem.ts
rename to src/pages/Visualization/types/dataStructuresItem/dataStructureVarItem.ts
diff --git a/src/pages/Home/types/dataToAdd/codeFlowVariableDataToAdd.ts b/src/pages/Visualization/types/dataToAdd/codeFlowVariableDataToAdd.ts
similarity index 100%
rename from src/pages/Home/types/dataToAdd/codeFlowVariableDataToAdd.ts
rename to src/pages/Visualization/types/dataToAdd/codeFlowVariableDataToAdd.ts
diff --git a/src/pages/Home/types/dataToAdd/forDataToAdd.ts b/src/pages/Visualization/types/dataToAdd/forDataToAdd.ts
similarity index 100%
rename from src/pages/Home/types/dataToAdd/forDataToAdd.ts
rename to src/pages/Visualization/types/dataToAdd/forDataToAdd.ts
diff --git a/src/pages/Home/types/dataToAdd/ifElseChangeDataToAdd.ts b/src/pages/Visualization/types/dataToAdd/ifElseChangeDataToAdd.ts
similarity index 100%
rename from src/pages/Home/types/dataToAdd/ifElseChangeDataToAdd.ts
rename to src/pages/Visualization/types/dataToAdd/ifElseChangeDataToAdd.ts
diff --git a/src/pages/Home/types/dataToAdd/ifElseDataToAdd.ts b/src/pages/Visualization/types/dataToAdd/ifElseDataToAdd.ts
similarity index 100%
rename from src/pages/Home/types/dataToAdd/ifElseDataToAdd.ts
rename to src/pages/Visualization/types/dataToAdd/ifElseDataToAdd.ts
diff --git a/src/pages/Home/types/dataToAdd/printDataToAdd.ts b/src/pages/Visualization/types/dataToAdd/printDataToAdd.ts
similarity index 100%
rename from src/pages/Home/types/dataToAdd/printDataToAdd.ts
rename to src/pages/Visualization/types/dataToAdd/printDataToAdd.ts
diff --git a/src/pages/Home/types/dto/ValidTypeDto.ts b/src/pages/Visualization/types/dto/ValidTypeDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/ValidTypeDto.ts
rename to src/pages/Visualization/types/dto/ValidTypeDto.ts
diff --git a/src/pages/Home/types/dto/codeFlowListDto.ts b/src/pages/Visualization/types/dto/codeFlowListDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/codeFlowListDto.ts
rename to src/pages/Visualization/types/dto/codeFlowListDto.ts
diff --git a/src/pages/Home/types/dto/codeFlowVariableDto.ts b/src/pages/Visualization/types/dto/codeFlowVariableDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/codeFlowVariableDto.ts
rename to src/pages/Visualization/types/dto/codeFlowVariableDto.ts
diff --git a/src/pages/Home/types/dto/forDto.ts b/src/pages/Visualization/types/dto/forDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/forDto.ts
rename to src/pages/Visualization/types/dto/forDto.ts
diff --git a/src/pages/Home/types/dto/ifElseChangeDto.ts b/src/pages/Visualization/types/dto/ifElseChangeDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/ifElseChangeDto.ts
rename to src/pages/Visualization/types/dto/ifElseChangeDto.ts
diff --git a/src/pages/Home/types/dto/ifElseDto.ts b/src/pages/Visualization/types/dto/ifElseDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/ifElseDto.ts
rename to src/pages/Visualization/types/dto/ifElseDto.ts
diff --git a/src/pages/Home/types/dto/printDto.ts b/src/pages/Visualization/types/dto/printDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/printDto.ts
rename to src/pages/Visualization/types/dto/printDto.ts
diff --git a/src/pages/Home/types/dto/variableDto.ts b/src/pages/Visualization/types/dto/variableDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/variableDto.ts
rename to src/pages/Visualization/types/dto/variableDto.ts
diff --git a/src/pages/Home/types/dto/variablesDto.ts b/src/pages/Visualization/types/dto/variablesDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/variablesDto.ts
rename to src/pages/Visualization/types/dto/variablesDto.ts
diff --git a/src/pages/Home/types/dto/whileDto.ts b/src/pages/Visualization/types/dto/whileDto.ts
similarity index 100%
rename from src/pages/Home/types/dto/whileDto.ts
rename to src/pages/Visualization/types/dto/whileDto.ts
diff --git a/src/pages/components/LoggedInHeader.module.css b/src/pages/components/LoggedInHeader.module.css
index 2d52065b..ae08e58b 100644
--- a/src/pages/components/LoggedInHeader.module.css
+++ b/src/pages/components/LoggedInHeader.module.css
@@ -7,6 +7,9 @@ header {
border-bottom: 1px solid var(--gray01);
background-color: #fff;
}
+.header-logo img {
+ height: 32px;
+}
.bg-blue {
background-color: #f8f9ff;
}
@@ -35,4 +38,5 @@ header {
.logout {
color: #5a5a5a;
+ cursor: pointer;
}
diff --git a/src/pages/components/LoggedInHeader.tsx b/src/pages/components/LoggedInHeader.tsx
index cad6fafd..093cf5a5 100644
--- a/src/pages/components/LoggedInHeader.tsx
+++ b/src/pages/components/LoggedInHeader.tsx
@@ -1,24 +1,44 @@
import styles from "./LoggedInHeader.module.css";
-
+import { useUserStore } from "@/store/user";
+import { Cookies } from "react-cookie";
+import { Link, NavLink } from "react-router-dom";
const LoggedInHeader = () => {
+ const cookies = new Cookies();
+ const loggedInUserName = useUserStore((state) => state.loggedInUserName);
+ const resetUser = useUserStore((state) => state.resetUser);
+ const logout = () => {
+ resetUser();
+ cookies.remove("token");
+ };
+ console.log(NavLink);
return (
);
diff --git a/src/pages/components/PublicHeader.module.css b/src/pages/components/PublicHeader.module.css
index fc9c984f..9b9152d4 100644
--- a/src/pages/components/PublicHeader.module.css
+++ b/src/pages/components/PublicHeader.module.css
@@ -7,6 +7,9 @@ header {
border-bottom: 1px solid var(--gray01);
background-color: #fff;
}
+.header-logo img {
+ height: 32px;
+}
.bg-blue {
background-color: #f8f9ff;
}
diff --git a/src/pages/components/PublicHeader.tsx b/src/pages/components/PublicHeader.tsx
index bb447001..b54ea481 100644
--- a/src/pages/components/PublicHeader.tsx
+++ b/src/pages/components/PublicHeader.tsx
@@ -1,23 +1,27 @@
+import { Link } from "react-router-dom";
import styles from "./PublicHeader.module.css";
const PublicHeader = () => {
return (
);
diff --git a/src/store/user.ts b/src/store/user.ts
index 3ca0d418..7f8ae4f2 100644
--- a/src/store/user.ts
+++ b/src/store/user.ts
@@ -1,16 +1,22 @@
import { create } from "zustand";
import { devtools } from "zustand/middleware";
interface UserState {
- loggedInUserId: string;
- loggedInUserPassword: string;
- setLoggedInUserId: (user: string) => void;
- setLoggedInUserPassword: (password: string) => void;
+ loggedInUserEmail: string;
+ loggedInUserName: string;
+ loggedInUserRole: string;
+ setLoggedInUserEmail: (user: string) => void;
+ setLoggedInUserName: (username: string) => void;
+ setLoggedInUserRole: (role: string) => void;
+ resetUser: () => void;
}
export const useUserStore = create(
devtools((set) => ({
- loggedInUserId: "",
- loggedInUserPassword: "",
- setLoggedInUserId: (loggedInUserId) => set({ loggedInUserId }),
- setLoggedInUserPassword: (loggedInUserPassword) => set({ loggedInUserPassword }),
+ loggedInUserEmail: "",
+ loggedInUserName: "",
+ loggedInUserRole: "",
+ setLoggedInUserEmail: (loggedInUserEmail) => set({ loggedInUserEmail }),
+ setLoggedInUserName: (loggedInUserName) => set({ loggedInUserName }),
+ setLoggedInUserRole: (loggedInUserRole) => set({ loggedInUserRole }),
+ resetUser: () => set({ loggedInUserEmail: "", loggedInUserName: "", loggedInUserRole: "" }),
}))
);