diff --git a/client/src/components/Editor.js b/client/src/components/Editor.js
index 82441d2..cf2d7f1 100644
--- a/client/src/components/Editor.js
+++ b/client/src/components/Editor.js
@@ -35,6 +35,12 @@ export const Editor = ({ blocks, onValidateClick, forwardedRef, validateAll }) =
toggleMode={toggleMode}
/>
}
+ { (showMistakeBar && isCompact) &&
+
+ }
+ { (showMistakeBar && !isCompact) &&
+
+ }
>
diff --git a/client/src/components/Editor.module.css b/client/src/components/Editor.module.css
index 85140c7..971eb26 100644
--- a/client/src/components/Editor.module.css
+++ b/client/src/components/Editor.module.css
@@ -7,6 +7,7 @@
composes: Editor;
display: flex;
flex-direction: row;
+ overflow: auto;
}
.Carousel {
@@ -15,7 +16,26 @@
}
-.SideMistakeBar{
- flex-grow: 1;
+.SideMistakeBar {
+ position: absolute;
+ flex-grow: 0;
+ align-self: flex-start;
+ right: 0;
+ margin-right: 3px;
}
+
+ .guideline-compact {
+ margin-top: 2rem;
+ width: 50px;
+ height: 100%;
+ flex-shrink: 0;
+ }
+
+ .guideline-expand {
+ margin-top: 2rem;
+ width: 350px;
+ height: 100%;
+ flex-shrink: 0;
+ }
+
diff --git a/client/src/components/Header.js b/client/src/components/Header.js
index b2aa044..b99e15d 100644
--- a/client/src/components/Header.js
+++ b/client/src/components/Header.js
@@ -113,12 +113,12 @@ export const Header = ({
percWidth="7%"
percHeight="7%"
message={message}
- messageStyle="header-loading"
+ messageStyle="header-loading"
/>
}
-
+
>
diff --git a/client/src/components/SideMistakeBar.module.css b/client/src/components/SideMistakeBar.module.css
index 2b77656..064a7a9 100644
--- a/client/src/components/SideMistakeBar.module.css
+++ b/client/src/components/SideMistakeBar.module.css
@@ -1,11 +1,12 @@
.container {
+ composes: SideMistakeBar from "./Editor.module.css";
display: grid;
grid-template-rows: 50px 280px;
grid-template-columns: 350px;
grid-template-areas:
"title"
"body";
- position: relative;
+ position: absolute;
background-color: var(--mistake-bar-dark);
color: var(--text-dark);
flex-direction: column;
@@ -144,6 +145,7 @@
.compact-container {
+ composes: SideMistakeBar from "./Editor.module.css";
display: flex;
flex-direction: column;
margin-top: 2rem;
@@ -151,6 +153,7 @@
height: fit-content;
background-color: var(--text-dark);
font-weight: bold;
+
}
.compact-button {
diff --git a/client/src/components/TextBox.js b/client/src/components/TextBox.js
index d79698e..10bef9b 100644
--- a/client/src/components/TextBox.js
+++ b/client/src/components/TextBox.js
@@ -6,6 +6,7 @@ import { ReactComponent as CloseIcon } from "../icons/close.svg"
import { ReactComponent as ValidateOutline } from "../icons/validate-outline.svg"
import { ReactComponent as Save } from "../icons/save.svg"
import { MistakeHighlighter } from './MistakeHighlighter'
+import ReactLoading from 'react-loading'
import axios from 'axios'
export const TextBox = ({
@@ -29,6 +30,8 @@ export const TextBox = ({
const [isValidated, setIsValidated] = useState(false)
const textAreaRef = useRef()
const [uniqueId, setUniqueId] = useState("")
+ const [loadValidate, setLoadValidate] = useState(false)
+ const [loadSave, setLoadSave] = useState(false)
useEffect(() => {
setUniqueId(() => uniqueid)
@@ -36,6 +39,8 @@ export const TextBox = ({
const handleOnValidateClick = () => {
onValidateClick()
+ setLoadValidate(() => true)
+ setTimeout(() => setLoadValidate(() => false), 3750)
setTimeout(() => setIsValidated(() => true), 500)
}
@@ -65,6 +70,8 @@ export const TextBox = ({
}
const onSaveClick = (e, id) => {
+ setLoadSave(() => true)
+ setTimeout(() => setLoadSave(() => false), 1000)
const newContent = textAreaRef.current.innerText
if (uniqueId === undefined) postBlock(newContent)
else putBlock(newContent)
@@ -150,14 +157,20 @@ export const TextBox = ({