From 31d3647595207ad9de73fe3a217a98e6c53e31ff Mon Sep 17 00:00:00 2001 From: aliamanuba Date: Sun, 10 Jul 2022 20:17:38 +0800 Subject: [PATCH] Settings Page and About Page in Settings Page --- public/electron.js | 4 ++- src/App.js | 6 ++-- src/components/Settings/settings.css | 36 +++++++++++++++++++++++ src/components/Settings/settings.js | 43 ++++++++++++++++++++++++++-- 4 files changed, 83 insertions(+), 6 deletions(-) diff --git a/public/electron.js b/public/electron.js index adf4e9e..7c9ac5b 100644 --- a/public/electron.js +++ b/public/electron.js @@ -31,7 +31,9 @@ const menuBar = [ submenu: [ { label: 'About Incogine Editor', - role: 'about' + click: () => { + mainWindow.webContents.executeJavaScript('window.SettingsPage("about")') + } }, { type: 'separator' }, { role: 'services' }, diff --git a/src/App.js b/src/App.js index c9ffb3d..b7f2964 100644 --- a/src/App.js +++ b/src/App.js @@ -116,9 +116,9 @@ function App() { const [notifyNotTauri, setnotifyNotTauri] = useState(false); - window.SettingsPage = function () { + window.SettingsPage = function (content) { if (!docsState.docs.some(doc => doc.type === "settings")) { - window.AddTab(true, { title: "Settings", file: null, content: null, saved: true, type: "settings" }) + window.AddTab(true, { title: "Settings", file: null, content: "about", saved: true, type: "settings" }) } } @@ -248,7 +248,7 @@ function App() {
{docsState.docs[docsState.selected].type === "text/code" ?