From 18890fcbc0d2375befbe7e44024b3f8b9d7b269a Mon Sep 17 00:00:00 2001 From: Jerzy Kwiatkowski Date: Mon, 8 Jan 2024 14:31:51 +0100 Subject: [PATCH] Added "learning table" above main table to allow user to make machine start learning again --- react/src/App.js | 100 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 30 deletions(-) diff --git a/react/src/App.js b/react/src/App.js index 21244a1..d707524 100644 --- a/react/src/App.js +++ b/react/src/App.js @@ -7,6 +7,7 @@ function App() { const [tableQuarry, setTableQuarry] = useState(''); const [columns, setColumns] = useState(''); const [results, setResults] = useState(''); + const [isVisible, setIsVisible] = useState(true); const fetchDataFromAPI = async (dataset, table, column) => { try { @@ -24,41 +25,80 @@ function App() { fetchDataFromAPI(datasetQuarry, tableQuarry, columns); }; + const toggleVisibility = () => { + setIsVisible(!isVisible); + }; + return ( -
- setDatasetQuarry(e.target.value)} - /> - setTableQuarry(e.target.value)} - /> -
+ + {isVisible &&
+
+
Learning tables
+
setColumns(e.target.value)} + placeholder="Dataset quarry" + value={datasetQuarry} + onChange={(e) => setDatasetQuarry(e.target.value)} /> + setTableQuarry(e.target.value)} + /> +
+ setColumns(e.target.value)} + /> +
+
} +
+
+
Test tables
+
+ setDatasetQuarry(e.target.value)} + /> + setTableQuarry(e.target.value)} + /> +
+ setColumns(e.target.value)} + /> +
+ + +
- - -
+ ); } -export default App; +export default App; \ No newline at end of file