From 65c08d8d6afbff15386d69d86c865952e82284f9 Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:10:32 +0100 Subject: [PATCH] First rough modal implementation --- Dashboard/src/App.tsx | 3 +- Dashboard/src/Components/Settings.tsx | 51 +++++++++++++++++++++++++++ Dashboard/src/electron.js | 2 +- Dashboard/src/index.html | 1 + 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 Dashboard/src/Components/Settings.tsx diff --git a/Dashboard/src/App.tsx b/Dashboard/src/App.tsx index 234f190..d3c89de 100644 --- a/Dashboard/src/App.tsx +++ b/Dashboard/src/App.tsx @@ -1,12 +1,12 @@ import React, { useState } from "react"; import { createGlobalStyle } from "styled-components"; -// import { useDispatch } from "react-redux"; import Select from "react-select"; import SerialPort from "serialport"; import electron from "electron"; 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` html { @@ -41,6 +41,7 @@ const App = () => { return (
+ + + , + document.getElementById("portal")!, + ); +}; + +export default Settings; diff --git a/Dashboard/src/electron.js b/Dashboard/src/electron.js index a8b062e..d36c502 100644 --- a/Dashboard/src/electron.js +++ b/Dashboard/src/electron.js @@ -118,7 +118,7 @@ function createTray() { { label: "Settings", click: () => { - ipcMain.emit("show-settings"); + mainWindow.webContents.send("show-settings", true); }, }, { diff --git a/Dashboard/src/index.html b/Dashboard/src/index.html index cc9212e..e6bcb91 100644 --- a/Dashboard/src/index.html +++ b/Dashboard/src/index.html @@ -6,5 +6,6 @@
+