From 970c585144cd9079f3915c2a192cd96b37175b23 Mon Sep 17 00:00:00 2001 From: Cristiano Pires Date: Fri, 6 Oct 2023 13:25:16 +0100 Subject: [PATCH] Make Login and Controls actual components --- public/main.js | 4 ++++ src/Components/Controls.js | 32 ++++++++++++++++++++------------ src/Components/Login.js | 35 +++++++++++++++++++---------------- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/public/main.js b/public/main.js index 96fbb05..7f6905c 100644 --- a/public/main.js +++ b/public/main.js @@ -41,6 +41,10 @@ ipcMain.on('minimize', (event, data) => { window.hide(); }); +ipcMain.on('login', (event, data) => +{ + console.log(data) +}); app.on('window-all-closed', ()=> { diff --git a/src/Components/Controls.js b/src/Components/Controls.js index 2ed466a..3287810 100644 --- a/src/Components/Controls.js +++ b/src/Components/Controls.js @@ -1,18 +1,26 @@ import './Controls.css'; -function Controls() { - const close = function () {window.ipcRender.send('close', ' ')}; - const minimize = function () {window.ipcRender.send('minimize', ' ')}; - const maximize = function () {window.ipcRender.send('maximize', ' ')}; +import React from "react"; - return ( -
-
Legendary
-
_
-
-
-
X
-
- ); +class Controls extends React.Component +{ + + close() {window.ipcRender.send('close', ' ')}; + minimize() {window.ipcRender.send('minimize', ' ')}; + maximize() {window.ipcRender.send('maximize', ' ')}; + render() + { + return( +
+
Legendary
+
_
+
-
+
X
+
+ ); + } } + + export default Controls; diff --git a/src/Components/Login.js b/src/Components/Login.js index 6897db4..f005b5a 100644 --- a/src/Components/Login.js +++ b/src/Components/Login.js @@ -1,29 +1,32 @@ +import React from 'react'; import './Login.css'; -function Login() +class Login extends React.Component { - function sendForm(formData) + sendForm(formData) { window.ipcRender.send('login', formData) } - function callRegister() + callRegister() { window.ipcRender.send('register') } - - return( -
-
- - - - - - -
-
- ) + render() + { + return( +
+
+ + + + + + +
+
+ ) + } }