diff --git a/Canon.Server/client-app/package.json b/Canon.Server/client-app/package.json index bacefa9..e92b3a5 100644 --- a/Canon.Server/client-app/package.json +++ b/Canon.Server/client-app/package.json @@ -20,6 +20,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.51.2", + "react-monaco-editor": "^0.55.0", "react-photo-view": "^1.2.4", "react-router-dom": "^6.22.3" }, diff --git a/Canon.Server/client-app/public/pic/uncompiled.png b/Canon.Server/client-app/public/pic/uncompiled.png new file mode 100644 index 0000000..96ee72d Binary files /dev/null and b/Canon.Server/client-app/public/pic/uncompiled.png differ diff --git a/Canon.Server/client-app/src/Pages/Index.tsx b/Canon.Server/client-app/src/Pages/Index.tsx index df05451..0c06fb5 100644 --- a/Canon.Server/client-app/src/Pages/Index.tsx +++ b/Canon.Server/client-app/src/Pages/Index.tsx @@ -21,7 +21,7 @@ export function Index() { compiledCode: "", sourceCode: "", id: "", - imageAddress: "" + imageAddress: "pic/uncompiled.png" }); const handleValueChange = (value: string) => { setInputValue(value); diff --git a/Canon.Server/client-app/src/Pages/InputField.tsx b/Canon.Server/client-app/src/Pages/InputField.tsx index f92d645..7de5c7f 100644 --- a/Canon.Server/client-app/src/Pages/InputField.tsx +++ b/Canon.Server/client-app/src/Pages/InputField.tsx @@ -1,15 +1,14 @@ -import {TextField} from "@mui/material"; import {CSSProperties, useState} from "react"; +import MonacoEditor from "react-monaco-editor"; // @ts-expect-error ... -export function InputField({ onValueChange }) { +export function InputField({onValueChange}) { const [inputValue, setInputValue] = useState(''); // @ts-expect-error ... - const handleChange = (e) => { - const newValue = e.target.value; + const handleChange = (newValue) => { setInputValue(newValue); onValueChange(newValue); }; @@ -17,20 +16,18 @@ export function InputField({ onValueChange }) { return <>
- +
+ +
} @@ -39,5 +36,5 @@ const inputFieldClassCss: CSSProperties = { width: "100%", height: "100%", padding: "5% 5%", - boxSizing: "border-box" + boxSizing: "border-box", } diff --git a/Canon.Server/client-app/src/Pages/OutputField.tsx b/Canon.Server/client-app/src/Pages/OutputField.tsx index ba1512d..fb6b967 100644 --- a/Canon.Server/client-app/src/Pages/OutputField.tsx +++ b/Canon.Server/client-app/src/Pages/OutputField.tsx @@ -4,14 +4,28 @@ import {PhotoProvider, PhotoView} from "react-photo-view"; // @ts-expect-error ... export function OutputField({imgPath}) { + return <>
- + + {imgPath == "pic/uncompiled.png" ? : + - + } + +