-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from LucasSonego/electron
Electron
- Loading branch information
Showing
53 changed files
with
354 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ node_modules/ | |
|
||
# production | ||
/build | ||
/dist/win-unpacked | ||
|
||
# misc | ||
.DS_Store | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = [require.resolve("./.webpack.config.js")]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = config => { | ||
config.target = "electron-renderer"; | ||
return config; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
directories: | ||
output: dist | ||
buildResources: build | ||
appId: f1-better-telemetry-by-lucassonego | ||
productName: F1 Better Telemetry | ||
copyright: 'Copyright © 2021 ${author}' | ||
mac: | ||
category: public.app-category.utilities | ||
extends: null | ||
extraMetadata: | ||
main: main.js | ||
files: | ||
- filter: | ||
- '**/*' | ||
- build | ||
electronVersion: 11.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 1.0.0 | ||
files: | ||
- url: F1-Better-Telemetry-Setup-1.0.0.exe | ||
sha512: 81+bPquRFfHXWDytOzbDBS48YY8IozcP8HXyZzaErZ9v0V2rH62WPqYqMSat3Yb5aO3kbYmDMf+hBQBc8nMAxg== | ||
size: 81809167 | ||
path: F1-Better-Telemetry-Setup-1.0.0.exe | ||
sha512: 81+bPquRFfHXWDytOzbDBS48YY8IozcP8HXyZzaErZ9v0V2rH62WPqYqMSat3Yb5aO3kbYmDMf+hBQBc8nMAxg== | ||
releaseDate: '2021-01-21T18:58:39.090Z' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require("./telemetryClient")(); | ||
|
||
const electron = require("electron"); | ||
const app = electron.app; | ||
const BrowserWindow = electron.BrowserWindow; | ||
const path = require("path"); | ||
const isDev = require("electron-is-dev"); | ||
|
||
let mainWindow; | ||
|
||
function createWindow() { | ||
mainWindow = new BrowserWindow({ | ||
width: 1200, | ||
height: 650, | ||
minHeight: 650, | ||
minWidth: 1200, | ||
frame: false, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
enableRemoteModule: true, | ||
}, | ||
icon: __dirname + "/icon.png", | ||
}); | ||
mainWindow.loadURL( | ||
isDev | ||
? "http://localhost:3000" | ||
: `file://${path.join(__dirname, "./build/index.html")}` | ||
); | ||
// mainWindow.webContents.openDevTools(); | ||
mainWindow.on("closed", () => (mainWindow = null)); | ||
} | ||
|
||
app.on("ready", createWindow); | ||
|
||
app.on("window-all-closed", () => { | ||
if (process.platform !== "darwin") { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on("activate", () => { | ||
if (mainWindow === null) { | ||
createWindow(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"name": "f1-better-telemetry", | ||
"version": "1.0.0", | ||
"description": "Live telemetry from Codemasters F1 game", | ||
"author": { | ||
"name": "Lucas Sônego", | ||
"email": "sonego_lucas@outlook.com", | ||
"url": "https://github.com/LucasSonego" | ||
}, | ||
"private": false, | ||
"license": "MIT", | ||
"homepage": "./", | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^5.11.4", | ||
"@testing-library/react": "^11.1.0", | ||
"@testing-library/user-event": "^12.1.10", | ||
"cross-env": "^7.0.3", | ||
"express": "^4.17.1", | ||
"f1-telemetry-client": "^0.1.18", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react-icons": "^3.11.0", | ||
"react-scripts": "4.0.0", | ||
"socket.io": "^2.3.0", | ||
"socket.io-client": "^2.3.1", | ||
"styled-components": "^5.2.1", | ||
"web-vitals": "^0.2.4", | ||
"electron-is-dev": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"electron": "^11.2.0", | ||
"@rescripts/cli": "^0.0.15", | ||
"@rescripts/rescript-env": "^0.0.12", | ||
"concurrently": "^5.3.0", | ||
"electron-builder": "^22.9.1", | ||
"wait-on": "^5.2.1" | ||
}, | ||
"main": "main.js", | ||
"build": { | ||
"appId": "f1-better-telemetry-by-lucassonego", | ||
"productName": "F1 Better Telemetry", | ||
"copyright": "Copyright © 2021 ${author}", | ||
"mac": { | ||
"category": "public.app-category.utilities" | ||
}, | ||
"extends": null, | ||
"extraMetadata": { | ||
"main": "main.js" | ||
}, | ||
"files": [ | ||
"**/*", | ||
"build" | ||
] | ||
}, | ||
"scripts": { | ||
"react-start": "rescripts start", | ||
"react-build": "rescripts build", | ||
"react-test": "rescripts test --env=jsdom", | ||
"react-eject": "react-scripts eject", | ||
"electron-build": "electron-builder", | ||
"release": "yarn react-build && electron-builder --publish=always", | ||
"build": "yarn react-build && yarn electron-build", | ||
"start": "concurrently \"cross-env BROWSER=none yarn react-start\" \"wait-on http://localhost:3000 && electron .\"" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
import { remote } from "electron"; | ||
|
||
import { | ||
VscClose, | ||
VscChromeMaximize, | ||
VscChromeMinimize, | ||
} from "react-icons/vsc"; | ||
import { Container } from "./styles"; | ||
|
||
function TitleBar() { | ||
return ( | ||
<Container> | ||
<span>F1 Better Telemetry</span> | ||
<div className="controls"> | ||
<button onClick={() => remote.getCurrentWindow().minimize()}> | ||
<div className="button-content"> | ||
<VscChromeMinimize className="minimize" /> | ||
</div> | ||
</button> | ||
<button | ||
onClick={() => | ||
remote.getCurrentWindow().isMaximized() | ||
? remote.getCurrentWindow().unmaximize() | ||
: remote.getCurrentWindow().maximize() | ||
} | ||
> | ||
<div className="button-content"> | ||
<VscChromeMaximize className="maximize" /> | ||
</div> | ||
</button> | ||
<button onClick={() => remote.getCurrentWindow().close()}> | ||
<div className="button-content"> | ||
<VscClose className="close" /> | ||
</div> | ||
</button> | ||
</div> | ||
</Container> | ||
); | ||
} | ||
|
||
export default TitleBar; |
Oops, something went wrong.