Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed dev tools and fixed small changes #151

Merged
merged 2 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
58 changes: 57 additions & 1 deletion Electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const {
shell,
session
} = require("electron");
const isDev = true;
const windowStateKeeper = require("electron-window-state");
const path = require("path");
const {
Expand Down Expand Up @@ -40,6 +39,8 @@ function createWindow() {
const primaryDisplay = screen.getPrimaryDisplay();
const primaryDisplayBounds = primaryDisplay.bounds;

const isDev = app.isPackaged ? false : true;

const win = new BrowserWindow({
x: mainWindowState.x,
y: mainWindowState.y,
Expand Down Expand Up @@ -81,6 +82,61 @@ function createWindow() {
},
});

const template = [
{
label: 'SYNK',
submenu: [
{
label: 'About SYNK',
click() {
dialog.showMessageBox(win, {
type: 'info',
icon: path.join(__dirname, 'icon.png'),
message: 'SYNK',
detail: 'v0.1.0 \n\n©2024 Clueless Jellybeans',
buttons: ['Ok'],
defaultId: 0
})
}
},
{
type: 'separator'
},
{
label: 'Hide SYNK',
click() {
win.hide()
},
},
{
type: 'separator'
},

{
label: 'Show SYNK',
click() {
win.show()
},
},
{
type: 'separator'
},

{
label: 'Quit SYNK',
click() {
win.close()
}
},
]
}
];

if(!isDev) {
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}

splashScreen.loadFile(
isDev
? './Frontend/public/preload.html'
Expand Down
20 changes: 10 additions & 10 deletions Frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

// const root = ReactDOM.createRoot(document.getElementById('root'));
// root.render(
// <React.StrictMode>
// <App />
// </React.StrictMode>
// );

ReactDOM.render(
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);

// ReactDOM.render(
// <React.StrictMode>
// <App />
// </React.StrictMode>,
// document.getElementById('root')
// );

reportWebVitals();
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"chart.js": "^4.4.2",
"child_process": "^1.0.2",
"chokidar": "^3.6.0",
"electron-is-dev": "^3.0.1",
"electron-packager": "^17.1.2",
"electron-tray-window": "^1.2.7",
"electron-window-state": "^5.0.3",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4818,6 +4818,11 @@ electron-download@^4.1.0:
semver "^5.4.1"
sumchecker "^2.0.2"

electron-is-dev@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-3.0.1.tgz#1cbc79b1dd046787903acd357efdfab6549dc17a"
integrity sha512-8TjjAh8Ec51hUi3o4TaU0mD3GMTOESi866oRNavj9A3IQJ7pmv+MJVmdZBFGw4GFT36X7bkqnuDNYvkQgvyI8Q==

electron-packager@^17.1.2:
version "17.1.2"
resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-17.1.2.tgz#18030b28024d242b706d0a8a67ed4cd1a57311aa"
Expand Down
Loading