Skip to content

Commit b330b62

Browse files
committed
minor styling changes
2 parents 51f19da + df4cff8 commit b330b62

File tree

4 files changed

+252
-231
lines changed

4 files changed

+252
-231
lines changed

main.js

Lines changed: 76 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
const path = require("path");
22

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

127
// Uncomment below for hot reloading during development
138
// require('electron-reload')(__dirname);
149

1510
// const isDev = true;
16-
const isDev =
17-
process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
11+
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
1812

1913
// Keep a global reference of the window object, if you don't, the window will
2014
// be closed automatically when the JavaScript object is garbage collected.
@@ -24,53 +18,53 @@ let mainWindow;
2418
function openFile() {
2519
// Opens file dialog looking for markdown
2620
const files = dialog.showOpenDialog(mainWindow, {
27-
properties: ["openFile"],
21+
properties: ['openFile'],
2822
filters: [
2923
{
30-
name: "Images",
31-
extensions: ["jpeg", "jpg", "png", "gif", "pdf"]
32-
}
33-
]
24+
name: 'Images',
25+
extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf'],
26+
},
27+
],
3428
});
3529

3630
// if no files
3731
if (!files) return;
3832
const file = files[0];
3933

4034
// Send fileContent to renderer
41-
mainWindow.webContents.send("new-file", file);
35+
mainWindow.webContents.send('new-file', file);
4236
}
4337

4438
// Choose directory
45-
ipcMain.on("choose_app_dir", event => {
39+
ipcMain.on('choose_app_dir', (event) => {
4640
const directory = dialog.showOpenDialog(mainWindow, {
47-
properties: ["openDirectory"],
48-
buttonLabel: "Export"
41+
properties: ['openDirectory'],
42+
buttonLabel: 'Export',
4943
});
5044

5145
if (!directory) return;
52-
event.sender.send("app_dir_selected", directory[0]);
46+
event.sender.send('app_dir_selected', directory[0]);
5347
});
5448

55-
ipcMain.on("view_app_dir", (event, appDir) => {
49+
ipcMain.on('view_app_dir', (event, appDir) => {
5650
shell.openItem(appDir);
5751
});
5852

5953
// Update file
60-
ipcMain.on("update-file", () => {
54+
ipcMain.on('update-file', () => {
6155
openFile();
6256
});
6357

6458
const createWindow = () => {
6559
// Create the browser window.
6660
// eslint-disable-next-line
67-
const { width, height } = require("electron").screen.getPrimaryDisplay().size;
61+
const { width, height } = require('electron').screen.getPrimaryDisplay().size;
6862
mainWindow = new BrowserWindow({
6963
width,
7064
height,
7165
webPreferences: {
7266
zoomFactor: 0.7,
73-
"node-Integration": false
67+
'node-Integration': false,
7468
},
7569
show: false,
7670
icon: path.join(__dirname, "/src/public/icons/mac/icon.icns"),
@@ -83,22 +77,22 @@ const createWindow = () => {
8377
// and load the index.html of the app.
8478
mainWindow.loadURL(`file://${__dirname}/build/index.html`);
8579
// load page once window is loaded
86-
mainWindow.once("ready-to-show", () => {
80+
mainWindow.once('ready-to-show', () => {
8781
mainWindow.show();
8882
});
8983

9084
const template = [
9185
{
92-
label: "File",
86+
label: 'File',
9387
submenu: [
9488
{
95-
label: "Open File",
96-
accelerator: process.platform === "darwin" ? "Cmd+O" : "Ctrl+Shift+O",
89+
label: 'Open File',
90+
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
9791
click() {
9892
openFile();
99-
}
100-
}
101-
]
93+
},
94+
},
95+
],
10296
},
10397
// {
10498
// label: 'Edit',
@@ -115,90 +109,89 @@ const createWindow = () => {
115109
// ],
116110
// },
117111
{
118-
label: "View",
112+
label: 'View',
119113
submenu: [
120-
{ role: "reload" },
121-
{ role: "forcereload" },
122-
{ type: "separator" },
123-
{ role: "resetzoom" },
124-
{ role: "zoomin" },
125-
{ role: "zoomout" },
126-
{ type: "separator" },
127-
{ role: "togglefullscreen" }
128-
]
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+
],
129123
},
130124
{
131-
role: "window",
132-
submenu: [{ role: "minimize" }, { role: "close" }]
125+
role: 'window',
126+
submenu: [{ role: 'minimize' }, { role: 'close' }],
133127
},
134128
{
135-
role: "help",
129+
role: 'help',
136130
submenu: [
137131
{
138-
label: "Learn More",
132+
label: 'Learn More',
139133
click() {
140-
shell.openExternal("https://electronjs.org");
141-
}
142-
}
143-
]
134+
shell.openExternal('https://electronjs.org');
135+
},
136+
},
137+
],
144138
},
145139
{
146-
label: "Developer",
140+
label: 'Developer',
147141
submenu: [
148142
{
149-
label: "Toggle Developer Tools",
150-
accelerator:
151-
process.platform === "darwin" ? "Alt+Command+I" : "Ctrl+Shift+I",
143+
label: 'Toggle Developer Tools',
144+
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
152145
click() {
153146
mainWindow.webContents.toggleDevTools();
154-
}
155-
}
156-
]
157-
}
147+
},
148+
},
149+
],
150+
},
158151
];
159152

160-
if (process.platform === "darwin") {
153+
if (process.platform === 'darwin') {
161154
template.unshift({
162155
label: app.getName(),
163156
submenu: [
164-
{ role: "about" },
165-
{ type: "separator" },
166-
{ role: "services", submenu: [] },
167-
{ type: "separator" },
168-
{ role: "hide" },
169-
{ role: "hideothers" },
170-
{ role: "unhide" },
171-
{ type: "separator" },
172-
{ role: "quit" }
173-
]
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+
],
174167
});
175168

176169
// Edit menu
177170
template[2].submenu.push(
178171
{
179-
type: "separator"
172+
type: 'separator',
180173
},
181174
{
182-
label: "Speech",
183-
submenu: [{ role: "startspeaking" }, { role: "stopspeaking" }]
184-
}
175+
label: 'Speech',
176+
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
177+
},
185178
);
186179

187180
// Window menu
188181
template[4].submenu = [
189-
{ role: "close" },
190-
{ role: "minimize" },
191-
{ role: "zoom" },
192-
{ type: "separator" },
193-
{ role: "front" }
182+
{ role: 'close' },
183+
{ role: 'minimize' },
184+
{ role: 'zoom' },
185+
{ type: 'separator' },
186+
{ role: 'front' },
194187
];
195188
}
196189

197190
const menu = Menu.buildFromTemplate(template);
198191
Menu.setApplicationMenu(menu);
199192

200193
// Emitted when the window is closed.
201-
mainWindow.on("closed", () => {
194+
mainWindow.on('closed', () => {
202195
// Dereference the window object, usually you would store windows
203196
// in an array if your app supports multi windows, this is the time
204197
// when you should delete the corresponding element.
@@ -209,13 +202,13 @@ const createWindow = () => {
209202
// This method will be called when Electron has finished
210203
// initialization and is ready to create browser windows.
211204
// Some APIs can only be used after this event occurs.
212-
app.on("ready", () => {
205+
app.on('ready', () => {
213206
if (isDev) {
214207
const {
215208
default: installExtension,
216209
REACT_DEVELOPER_TOOLS,
217-
REDUX_DEVTOOLS
218-
} = require("electron-devtools-installer");
210+
REDUX_DEVTOOLS,
211+
} = require('electron-devtools-installer');
219212

220213
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
221214
.then(() => {
@@ -228,15 +221,15 @@ app.on("ready", () => {
228221
});
229222

230223
// Quit when all windows are closed.
231-
app.on("window-all-closed", () => {
224+
app.on('window-all-closed', () => {
232225
// On OS X it is common for applications and their menu bar
233226
// to stay active until the user quits explicitly with Cmd + Q
234-
if (process.platform !== "darwin") {
227+
if (process.platform !== 'darwin') {
235228
app.quit();
236229
}
237230
});
238231

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

src/components/TransformerComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from "react";
22
import { Transformer } from "react-konva";
3-
import { ChildInt } from "../utils/interfaces";
3+
import { ChildInt } from "../utils/interfaces.ts";
44

55
interface PropsInt {
66
focusChild: ChildInt;

src/public/styles/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ LEFT COLUMN
7373
.left {
7474
padding: 10px;
7575
width: 20%;
76-
min-width: 300px;
76+
min-width: 310px;
7777
display: flex;
7878
flex-direction: column;
7979
position: relative;

0 commit comments

Comments
 (0)