+
Could not saved suggestion
)}
diff --git a/client/src/pages/Home.js b/client/src/pages/Home.js
index aa36e30..0dc6ece 100644
--- a/client/src/pages/Home.js
+++ b/client/src/pages/Home.js
@@ -24,6 +24,8 @@ export function Home({ user }) {
const [nextOriginalText, setNextOriginalText] = useState(1);
const [loading, setLoading] = useState(1);
+ const [enableDisable, setEnableDisable] = useState(true); // submit button is disabled
+
//
//
useEffect(() => {
@@ -62,6 +64,7 @@ export function Home({ user }) {
randomText={randomText}
number={i + 1}
setSelectedSuggestion={setSelectedSuggestion}
+ setEnableDisable={setEnableDisable}
/>
);
});
@@ -85,22 +88,23 @@ export function Home({ user }) {
Suggestions :
- {loading ? (
-
- ) : (
+ {loading ? (
+
+ ) : (
+
+ {suggestions}
+
+
+ )}
+
-
- {suggestions}
-
-
- )}
-
-
diff --git a/client/src/pages/SubmitSuggestion.js b/client/src/pages/SubmitSuggestion.js
index 25b0876..25b6e97 100644
--- a/client/src/pages/SubmitSuggestion.js
+++ b/client/src/pages/SubmitSuggestion.js
@@ -27,10 +27,13 @@ const SubmitSuggestion = (props) => {
};
return (
);
diff --git a/client/src/pages/SuggestionSentence.js b/client/src/pages/SuggestionSentence.js
index fb80c34..f8195c5 100644
--- a/client/src/pages/SuggestionSentence.js
+++ b/client/src/pages/SuggestionSentence.js
@@ -1,26 +1,30 @@
const SuggestionSentence = (props) => {
- const diff = (original, corrected) => {
- const originalWords = original.split(" ");
- const correctedWords = corrected.split(" ");
- let result = "";
- correctedWords.forEach(function (word, i) {
- if (originalWords[i] !== word) {
- result += "" + word + " ";
- } else {
- result += word + " ";
- }
- });
- return result.trim();
- };
-const innerText = diff(props.randomText, props.suggestionText);
+ const diff = (original, corrected) => {
+ const originalWords = original.split(" ");
+ const correctedWords = corrected.split(" ");
+ let result = "";
+ correctedWords.forEach(function (word, i) {
+ if (originalWords[i] !== word) {
+ result += "" + word + " ";
+ } else {
+ result += word + " ";
+ }
+ });
+ return result.trim();
+ };
+ const innerText = diff(props.randomText, props.suggestionText);
return (