From e89d12f13b76dd0ea31b0f1f2d554f0846f41604 Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Sat, 10 Jul 2021 16:19:37 +0200 Subject: [PATCH] Use styled-components for window border --- Dashboard/src/App.tsx | 53 +++++++++++++++++++++++----------------- Dashboard/src/index.html | 13 +--------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/Dashboard/src/App.tsx b/Dashboard/src/App.tsx index 1d436c2..28cef00 100644 --- a/Dashboard/src/App.tsx +++ b/Dashboard/src/App.tsx @@ -1,32 +1,40 @@ import React from "react"; -// import SerialPort from "serialport"; -import { remote } from "electron"; +import SerialPort from "serialport"; +import { createGlobalStyle } from "styled-components"; import Knob from "./Components/Knob"; -const App = () => { - // https://www.electronjs.org/docs/api/system-preferences#systempreferencesgetcolorcolor-windows-macos - console.log(remote.systemPreferences.getColor("active-border")); // border - // https://www.electronjs.org/docs/api/system-preferences#systempreferencesgetaccentcolor-windows-macos - console.log(remote.systemPreferences.getAccentColor()); // accent color +const GlobalStyle = createGlobalStyle` + html { + border-style: solid; + border-color: #363636; + border-width: 1px; + box-sizing: border-box; + height: 100%; + border-bottom-style: hidden; + border-right-style: hidden; + } +`; - // const port = new SerialPort("COM5", { - // baudRate: 9600, - // autoOpen: false, - // }); - // const handler = () => { - // // eslint-disable-next-line - // port.write("off", (err) => { - // if (err) { - // return console.log("Error on write: ", err.message); - // } - // console.log("message written"); - // }); - // }; +const App = () => { + const port = new SerialPort("COM5", { + baudRate: 9600, + autoOpen: false, + }); + const handler = () => { + // eslint-disable-next-line + port.write("off", (err) => { + if (err) { + return console.log("Error on write: ", err.message); + } + console.log("message written"); + }); + }; return (