Skip to content

Commit d043841

Browse files
committed
Solved merge conflicts
2 parents d2d58eb + 81ff060 commit d043841

18 files changed

+479
-241
lines changed

main.js

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
const path = require('path');
22

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

512
// Uncomment below for hot reloading during development
613
// require('electron-reload')(__dirname);
714

815
// const isDev = true;
9-
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
16+
const isDev =
17+
process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
1018

1119
// Keep a global reference of the window object, if you don't, the window will
1220
// be closed automatically when the JavaScript object is garbage collected.
@@ -20,9 +28,9 @@ function openFile() {
2028
filters: [
2129
{
2230
name: 'Images',
23-
extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf'],
24-
},
25-
],
31+
extensions: ['jpeg', 'jpg', 'png', 'gif', 'pdf']
32+
}
33+
]
2634
});
2735

2836
// if no files
@@ -37,7 +45,7 @@ function openFile() {
3745
ipcMain.on('choose_app_dir', event => {
3846
const directory = dialog.showOpenDialog(mainWindow, {
3947
properties: ['openDirectory'],
40-
buttonLabel: 'Export',
48+
buttonLabel: 'Export'
4149
});
4250

4351
if (!directory) return;
@@ -62,14 +70,14 @@ const createWindow = () => {
6270
height,
6371
webPreferences: {
6472
zoomFactor: 0.7,
65-
'node-Integration': false,
73+
'node-Integration': false
6674
},
6775
show: false,
6876
icon: path.join(__dirname, '/src/public/icons/mac/icon.icns'),
6977
win: {
7078
icon: path.join(__dirname, '/src/public/icons/win/icon.ico'),
71-
target: ['portable'],
72-
},
79+
target: ['portable']
80+
}
7381
});
7482

7583
// and load the index.html of the app.
@@ -88,9 +96,9 @@ const createWindow = () => {
8896
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+Shift+O',
8997
click() {
9098
openFile();
91-
},
92-
},
93-
],
99+
}
100+
}
101+
]
94102
},
95103
// {
96104
// label: 'Edit',
@@ -116,12 +124,12 @@ const createWindow = () => {
116124
{ role: 'zoomin' },
117125
{ role: 'zoomout' },
118126
{ type: 'separator' },
119-
{ role: 'togglefullscreen' },
120-
],
127+
{ role: 'togglefullscreen' }
128+
]
121129
},
122130
{
123131
role: 'window',
124-
submenu: [{ role: 'minimize' }, { role: 'close' }],
132+
submenu: [{ role: 'minimize' }, { role: 'close' }]
125133
},
126134
{
127135
role: 'help',
@@ -130,22 +138,23 @@ const createWindow = () => {
130138
label: 'Learn More',
131139
click() {
132140
shell.openExternal('https://electronjs.org');
133-
},
134-
},
135-
],
141+
}
142+
}
143+
]
136144
},
137145
{
138146
label: 'Developer',
139147
submenu: [
140148
{
141149
label: 'Toggle Developer Tools',
142-
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
150+
accelerator:
151+
process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
143152
click() {
144153
mainWindow.webContents.toggleDevTools();
145-
},
146-
},
147-
],
148-
},
154+
}
155+
}
156+
]
157+
}
149158
];
150159

151160
if (process.platform === 'darwin') {
@@ -160,19 +169,19 @@ const createWindow = () => {
160169
{ role: 'hideothers' },
161170
{ role: 'unhide' },
162171
{ type: 'separator' },
163-
{ role: 'quit' },
164-
],
172+
{ role: 'quit' }
173+
]
165174
});
166175

167176
// Edit menu
168177
template[2].submenu.push(
169178
{
170-
type: 'separator',
179+
type: 'separator'
171180
},
172181
{
173182
label: 'Speech',
174-
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
175-
},
183+
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }]
184+
}
176185
);
177186

178187
// Window menu
@@ -181,7 +190,7 @@ const createWindow = () => {
181190
{ role: 'minimize' },
182191
{ role: 'zoom' },
183192
{ type: 'separator' },
184-
{ role: 'front' },
193+
{ role: 'front' }
185194
];
186195
}
187196

@@ -195,14 +204,21 @@ const createWindow = () => {
195204
// when you should delete the corresponding element.
196205
mainWindow = null;
197206
});
207+
208+
// dev tools opened on every browser creation
209+
mainWindow.webContents.openDevTools();
198210
};
199211

200212
// This method will be called when Electron has finished
201213
// initialization and is ready to create browser windows.
202214
// Some APIs can only be used after this event occurs.
203215
app.on('ready', () => {
204216
if (isDev) {
205-
const { default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = require('electron-devtools-installer');
217+
const {
218+
default: installExtension,
219+
REACT_DEVELOPER_TOOLS,
220+
REDUX_DEVTOOLS
221+
} = require('electron-devtools-installer');
206222

207223
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
208224
.then(() => {

package-lock.json

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import '../public/styles/style.css';
33
import AppContainer from '../containers/AppContainer';
44

55
export const App: React.SFC = () => (
6-
<div className="app">
6+
<div className='app'>
77
<div>
88
<header style={{ height: '40px', width: '100%' }}>ReacType</header>
99
<AppContainer />

src/components/CodePreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CodePreview extends Component<Props> {
2626
}}
2727
>
2828
<SyntaxHighlighter style={hybrid}>
29-
{format(componentRender(focusComponent, components))}}
29+
{format(componentRender(focusComponent, components))}
3030
</SyntaxHighlighter>
3131
</div>
3232
);

0 commit comments

Comments
 (0)