Skip to content

Commit d82d9ea

Browse files
Merge pull request #110 from tolgamizrakci/development
Development
2 parents 11e0643 + 5e3d31d commit d82d9ea

File tree

5 files changed

+102
-81
lines changed

5 files changed

+102
-81
lines changed

main.js

Lines changed: 88 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
const path = require('path');
22

33
const {
4-
app, BrowserWindow, Menu, shell, dialog, ipcMain,
5-
} = require('electron');
4+
app,
5+
BrowserWindow,
6+
Menu,
7+
shell,
8+
dialog,
9+
ipcMain
10+
} = require("electron");
611

712
// Uncomment below for hot reloading during development
13+
<<<<<<< HEAD
14+
require("electron-reload")(__dirname);
15+
=======
816
// require('electron-reload')(__dirname);
17+
>>>>>>> 11e0643d114b6c294dc2b66c3fd4727ffb173825
918

1019
// const isDev = true;
11-
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
20+
const isDev =
21+
process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
1222

1323
// Keep a global reference of the window object, if you don't, the window will
1424
// be closed automatically when the JavaScript object is garbage collected.
@@ -18,53 +28,53 @@ let mainWindow;
1828
function openFile() {
1929
// Opens file dialog looking for markdown
2030
const files = dialog.showOpenDialog(mainWindow, {
21-
properties: ['openFile'],
31+
properties: ["openFile"],
2232
filters: [
2333
{
24-
name: 'Images',
25-
extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf'],
26-
},
27-
],
34+
name: "Images",
35+
extensions: ["jpeg", "jpg", "png", "gif", "pdf"]
36+
}
37+
]
2838
});
2939

3040
// if no files
3141
if (!files) return;
3242
const file = files[0];
3343

3444
// Send fileContent to renderer
35-
mainWindow.webContents.send('new-file', file);
45+
mainWindow.webContents.send("new-file", file);
3646
}
3747

3848
// Choose directory
39-
ipcMain.on('choose_app_dir', (event) => {
49+
ipcMain.on("choose_app_dir", event => {
4050
const directory = dialog.showOpenDialog(mainWindow, {
41-
properties: ['openDirectory'],
42-
buttonLabel: 'Export',
51+
properties: ["openDirectory"],
52+
buttonLabel: "Export"
4353
});
4454

4555
if (!directory) return;
46-
event.sender.send('app_dir_selected', directory[0]);
56+
event.sender.send("app_dir_selected", directory[0]);
4757
});
4858

49-
ipcMain.on('view_app_dir', (event, appDir) => {
59+
ipcMain.on("view_app_dir", (event, appDir) => {
5060
shell.openItem(appDir);
5161
});
5262

5363
// Update file
54-
ipcMain.on('update-file', () => {
64+
ipcMain.on("update-file", () => {
5565
openFile();
5666
});
5767

5868
const createWindow = () => {
5969
// Create the browser window.
6070
// eslint-disable-next-line
61-
const { width, height } = require('electron').screen.getPrimaryDisplay().size;
71+
const { width, height } = require("electron").screen.getPrimaryDisplay().size;
6272
mainWindow = new BrowserWindow({
6373
width,
6474
height,
6575
webPreferences: {
66-
zoomFactor: 0.9,
67-
'node-Integration': false,
76+
zoomFactor: 0.7,
77+
"node-Integration": false
6878
},
6979
show: false,
7080
icon: path.join(__dirname, '/src/public/icons/mac/icon.icns'),
@@ -77,22 +87,22 @@ const createWindow = () => {
7787
// and load the index.html of the app.
7888
mainWindow.loadURL(`file://${__dirname}/build/index.html`);
7989
// load page once window is loaded
80-
mainWindow.once('ready-to-show', () => {
90+
mainWindow.once("ready-to-show", () => {
8191
mainWindow.show();
8292
});
8393

8494
const template = [
8595
{
86-
label: 'File',
96+
label: "File",
8797
submenu: [
8898
{
89-
label: 'Open File',
90-
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
99+
label: "Open File",
100+
accelerator: process.platform === "darwin" ? "Cmd+O" : "Ctrl+Shift+O",
91101
click() {
92102
openFile();
93-
},
94-
},
95-
],
103+
}
104+
}
105+
]
96106
},
97107
// {
98108
// label: 'Edit',
@@ -109,89 +119,90 @@ const createWindow = () => {
109119
// ],
110120
// },
111121
{
112-
label: 'View',
122+
label: "View",
113123
submenu: [
114-
{ role: 'reload' },
115-
{ role: 'forcereload' },
116-
{ type: 'separator' },
117-
{ role: 'resetzoom' },
118-
{ role: 'zoomin' },
119-
{ role: 'zoomout' },
120-
{ type: 'separator' },
121-
{ role: 'togglefullscreen' },
122-
],
124+
{ role: "reload" },
125+
{ role: "forcereload" },
126+
{ type: "separator" },
127+
{ role: "resetzoom" },
128+
{ role: "zoomin" },
129+
{ role: "zoomout" },
130+
{ type: "separator" },
131+
{ role: "togglefullscreen" }
132+
]
123133
},
124134
{
125-
role: 'window',
126-
submenu: [{ role: 'minimize' }, { role: 'close' }],
135+
role: "window",
136+
submenu: [{ role: "minimize" }, { role: "close" }]
127137
},
128138
{
129-
role: 'help',
139+
role: "help",
130140
submenu: [
131141
{
132-
label: 'Learn More',
142+
label: "Learn More",
133143
click() {
134-
shell.openExternal('https://electronjs.org');
135-
},
136-
},
137-
],
144+
shell.openExternal("https://electronjs.org");
145+
}
146+
}
147+
]
138148
},
139149
{
140-
label: 'Developer',
150+
label: "Developer",
141151
submenu: [
142152
{
143-
label: 'Toggle Developer Tools',
144-
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
153+
label: "Toggle Developer Tools",
154+
accelerator:
155+
process.platform === "darwin" ? "Alt+Command+I" : "Ctrl+Shift+I",
145156
click() {
146157
mainWindow.webContents.toggleDevTools();
147-
},
148-
},
149-
],
150-
},
158+
}
159+
}
160+
]
161+
}
151162
];
152163

153-
if (process.platform === 'darwin') {
164+
if (process.platform === "darwin") {
154165
template.unshift({
155166
label: app.getName(),
156167
submenu: [
157-
{ role: 'about' },
158-
{ type: 'separator' },
159-
{ role: 'services', submenu: [] },
160-
{ type: 'separator' },
161-
{ role: 'hide' },
162-
{ role: 'hideothers' },
163-
{ role: 'unhide' },
164-
{ type: 'separator' },
165-
{ role: 'quit' },
166-
],
168+
{ role: "about" },
169+
{ type: "separator" },
170+
{ role: "services", submenu: [] },
171+
{ type: "separator" },
172+
{ role: "hide" },
173+
{ role: "hideothers" },
174+
{ role: "unhide" },
175+
{ type: "separator" },
176+
{ role: "quit" }
177+
]
167178
});
168179

169180
// Edit menu
170181
template[2].submenu.push(
171182
{
172-
type: 'separator',
183+
type: "separator"
173184
},
174185
{
175-
label: 'Speech',
176-
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
177-
},
186+
label: "Speech",
187+
submenu: [{ role: "startspeaking" }, { role: "stopspeaking" }]
188+
}
178189
);
179190

180191
// Window menu
181192
template[4].submenu = [
182-
{ role: 'close' },
183-
{ role: 'minimize' },
184-
{ role: 'zoom' },
185-
{ type: 'separator' },
186-
{ role: 'front' },
193+
{ role: "close" },
194+
{ role: "minimize" },
195+
{ role: "zoom" },
196+
{ type: "separator" },
197+
{ role: "front" }
187198
];
188199
}
189200

190201
const menu = Menu.buildFromTemplate(template);
191202
Menu.setApplicationMenu(menu);
192203

193204
// Emitted when the window is closed.
194-
mainWindow.on('closed', () => {
205+
mainWindow.on("closed", () => {
195206
// Dereference the window object, usually you would store windows
196207
// in an array if your app supports multi windows, this is the time
197208
// when you should delete the corresponding element.
@@ -202,13 +213,13 @@ const createWindow = () => {
202213
// This method will be called when Electron has finished
203214
// initialization and is ready to create browser windows.
204215
// Some APIs can only be used after this event occurs.
205-
app.on('ready', () => {
216+
app.on("ready", () => {
206217
if (isDev) {
207218
const {
208219
default: installExtension,
209220
REACT_DEVELOPER_TOOLS,
210-
REDUX_DEVTOOLS,
211-
} = require('electron-devtools-installer');
221+
REDUX_DEVTOOLS
222+
} = require("electron-devtools-installer");
212223

213224
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
214225
.then(() => {
@@ -221,15 +232,15 @@ app.on('ready', () => {
221232
});
222233

223234
// Quit when all windows are closed.
224-
app.on('window-all-closed', () => {
235+
app.on("window-all-closed", () => {
225236
// On OS X it is common for applications and their menu bar
226237
// to stay active until the user quits explicitly with Cmd + Q
227-
if (process.platform !== 'darwin') {
238+
if (process.platform !== "darwin") {
228239
app.quit();
229240
}
230241
});
231242

232-
app.on('activate', () => {
243+
app.on("activate", () => {
233244
// On OS X it's common to re-create a window in the app when the
234245
// dock icon is clicked and there are no other windows open.
235246
if (mainWindow === null) {

src/components/DataTable.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import { IconButton } from "@material-ui/core";
1212
const styles = (theme: any) => ({
1313
root: {
1414
width: "80%",
15-
marginTop: theme.spacing.unit * 3
15+
marginTop: theme.spacing.unit * 3,
16+
marginRight: "100px"
1617
// overflowX: "auto"
1718
},
1819
table: {
19-
minWidth: 500
20+
minWidth: 500,
21+
marginRight: "100px"
2022
}
2123
});
2224

src/components/Props.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class Props extends Component<PropInt> {
199199
style={{ marginTop: '20px', width: '90%', height: '80%' }}
200200
>
201201
<Grid container spacing={8}>
202-
<Grid item xs={4}>
202+
<Grid item xs={3}>
203203
<form className="props-input" onSubmit={this.handleAddProp}>
204204
<Grid container spacing={8}>
205205
<Grid item xs={6}>
@@ -288,6 +288,7 @@ class Props extends Component<PropInt> {
288288
deletePropHandler={deleteProp}
289289
/>
290290
</Grid>
291+
<Grid item xs={1} />
291292
</Grid>
292293
</div>
293294
</Fragment>

src/components/TransformerComponent.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
<<<<<<< HEAD
2+
import React, { Component } from "react";
3+
import { Transformer } from "react-konva";
4+
import { ComponentInt, ComponentsInt, ChildInt } from "../utils/interfaces";
5+
=======
16
import React, { Component } from 'react';
27
import { Transformer } from 'react-konva';
38
import { ChildInt } from '../utils/interfaces.ts';
9+
>>>>>>> 11e0643d114b6c294dc2b66c3fd4727ffb173825
410

511
interface PropsInt {
612
focusChild: ChildInt;

src/public/styles/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ html {
1212
body {
1313
margin: 0;
1414
padding: 0;
15-
font-family: 'Open sans', sans-serif;
15+
font-family: "Open sans", sans-serif;
1616
font-weight: 400;
1717
overflow: hidden;
1818
}
@@ -219,6 +219,7 @@ RIGHT COLUMN
219219
flex-direction: row; */
220220
background-color: #fcfcfc;
221221
/* box-shadow: 0 -5px 7px 2px rgb(255, 0, 0); */
222+
margin-right: 100px;
222223
}
223224

224225
.htmlattr {

0 commit comments

Comments
 (0)