diff --git a/Dashboard/package.json b/Dashboard/package.json index 6127fd8..7573eeb 100644 --- a/Dashboard/package.json +++ b/Dashboard/package.json @@ -51,6 +51,8 @@ }, "license": "ISC", "dependencies": { + "@fluentui/react": "^8.61.0", + "@fluentui/react-icons-mdl2": "^1.3.4", "@reduxjs/toolkit": "^1.7.1", "@types/jest": "^27.0.2", "@types/node": "^15.14.9", diff --git a/Dashboard/src/App.tsx b/Dashboard/src/App.tsx index d3c89de..4d914dd 100644 --- a/Dashboard/src/App.tsx +++ b/Dashboard/src/App.tsx @@ -1,11 +1,8 @@ -import React, { useState } from "react"; +import React from "react"; import { createGlobalStyle } from "styled-components"; -import Select from "react-select"; -import SerialPort from "serialport"; -import electron from "electron"; +import { registerIcons } from "@fluentui/react/lib/Styling"; +import { ChevronDownIcon, CancelIcon } from "@fluentui/react-icons-mdl2"; import KnobSection from "./Components/KnobSection"; -import { useAppDispatch } from "./redux/hooks"; -import { connect, disconnect, setSerialPort } from "./redux/slices/serialConnectionSlice"; import Settings from "./Components/Settings"; const GlobalStyle = createGlobalStyle` @@ -20,84 +17,19 @@ const GlobalStyle = createGlobalStyle` } `; -const options: [{value: string, label:string}] = [{ value: "placeholder", label: "Select Port" }]; - -const fetchPorts = async () => { - const data = await SerialPort.list(); - options.shift(); - data.forEach((comPort) => { options.push({ value: comPort.path, label: comPort.path }); }); -}; - const App = () => { - const dispatch = useAppDispatch(); - - fetchPorts(); - - const [portSelectionValue, setPortSelectionValue] = useState(options[0]); - const handlePortChange = async (selectedOption: any) => { - setPortSelectionValue(selectedOption); - dispatch(setSerialPort(selectedOption.value)); - }; - + registerIcons({ + icons: { + ChevronDown: , + Cancel: , + }, + }); return ( -
+ <> - - - - - - -