feat: Show connected robots finished with unit test 94% coverage
ref: N25B-142
This commit is contained in:
22
src/App.tsx
22
src/App.tsx
@@ -1,5 +1,4 @@
|
||||
import { Routes, Route, Link } from 'react-router'
|
||||
import { useState } from 'react'
|
||||
import './App.css'
|
||||
import TemplatePage from './pages/TemplatePage/Template.tsx'
|
||||
import Home from './pages/Home/Home.tsx'
|
||||
@@ -9,16 +8,6 @@ import VisProg from "./pages/VisProgPage/VisProg.tsx";
|
||||
|
||||
function App(){
|
||||
|
||||
// Define what our conencted robot should include
|
||||
type Robot = {
|
||||
id: string;
|
||||
name: string;
|
||||
port: number;
|
||||
};
|
||||
|
||||
// (Acces to) the array of connected robots
|
||||
const [connectedRobots, setConnectedRobots] = useState<Robot[]>([]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<header>
|
||||
@@ -30,16 +19,7 @@ function App(){
|
||||
<Route path="/template" element={<TemplatePage />} />
|
||||
<Route path="/editor" element={<VisProg />} />
|
||||
<Route path="/robot" element={<Robot />} />
|
||||
<Route
|
||||
path="/ConnectedRobots"
|
||||
// Pass the useState to the page to update from there
|
||||
element={
|
||||
<ConnectedRobots
|
||||
connectedRobots={connectedRobots}
|
||||
setConnectedRobots={setConnectedRobots}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<Route path="/ConnectedRobots" element={<ConnectedRobots />} />
|
||||
</Routes>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user