Skip to content

Commit 6873779

Browse files
Merge pull request #19 from brianjshan/tutorial
🔥 Customized tutorial page 🔥 👍
2 parents fa63ba1 + 0769e9d commit 6873779

File tree

4 files changed

+148
-137
lines changed

4 files changed

+148
-137
lines changed

app/electron/menu.js

Lines changed: 81 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const { Menu } = require("electron");
1+
const { Menu } = require('electron');
22
const { BrowserWindow } = require('electron');
33
const fs = require('fs');
44
const path = require('path');
5-
const isMac = process.platform === "darwin";
5+
const isMac = process.platform === 'darwin';
66
const port = 5000;
77
const tutorialRoute = `http://localhost:${port}/tutorial`;
88

99
// Create a template for a menu and create menu using that template
10-
var MenuBuilder = function (mainWindow, appName) {
10+
var MenuBuilder = function(mainWindow, appName) {
1111
// https://electronjs.org/docs/api/menu#main-process
1212
// "roles" are predefined by Electron and used for standard actions
1313
// https://www.electronjs.org/docs/api/menu-item
@@ -26,13 +26,14 @@ var MenuBuilder = function (mainWindow, appName) {
2626
contextIsolation: true,
2727
enableRemoteModule: false,
2828
zoomFactor: 1.0,
29+
devTools: false
2930
}
3031
});
3132
tutorial.loadURL(`http://localhost:8080/#/tutorial`);
3233
tutorial.show();
33-
}
34+
};
3435

35-
let defaultTemplate = function () {
36+
let defaultTemplate = function() {
3637
return [
3738
// { role: "appMenu" }
3839
...(isMac
@@ -42,202 +43,202 @@ var MenuBuilder = function (mainWindow, appName) {
4243
label: appName,
4344
submenu: [
4445
{
45-
role: "about",
46+
role: 'about'
4647
},
4748
{
48-
type: "separator",
49+
type: 'separator'
4950
},
5051
{
51-
role: "services",
52+
role: 'services'
5253
},
5354
{
54-
type: "separator",
55+
type: 'separator'
5556
},
5657
{
57-
role: "hide",
58+
role: 'hide'
5859
},
5960
{
60-
role: "hideothers",
61+
role: 'hideothers'
6162
},
6263
{
63-
role: "unhide",
64+
role: 'unhide'
6465
},
6566
{
66-
type: "separator",
67+
type: 'separator'
6768
},
6869
{
69-
role: "quit",
70-
},
71-
],
72-
},
70+
role: 'quit'
71+
}
72+
]
73+
}
7374
]
7475
: []),
7576
{
76-
label: "File",
77+
label: 'File',
7778
submenu: [
7879
isMac
7980
? {
80-
role: "close",
81+
role: 'close'
8182
}
8283
: {
83-
role: "quit",
84-
},
85-
],
84+
role: 'quit'
85+
}
86+
]
8687
},
8788
{
88-
label: "Edit",
89+
label: 'Edit',
8990
submenu: [
9091
{
91-
role: "undo",
92+
role: 'undo'
9293
},
9394
{
94-
role: "redo",
95+
role: 'redo'
9596
},
9697
{
97-
type: "separator",
98+
type: 'separator'
9899
},
99100
{
100-
role: "cut",
101+
role: 'cut'
101102
},
102103
{
103-
role: "copy",
104+
role: 'copy'
104105
},
105106
{
106-
role: "paste",
107+
role: 'paste'
107108
},
108109
...(isMac
109110
? [
110111
{
111-
role: "pasteAndMatchStyle",
112+
role: 'pasteAndMatchStyle'
112113
},
113114
{
114-
role: "delete",
115+
role: 'delete'
115116
},
116117
{
117-
role: "selectAll",
118+
role: 'selectAll'
118119
},
119120
{
120-
type: "separator",
121+
type: 'separator'
121122
},
122123
{
123-
label: "Speech",
124+
label: 'Speech',
124125
submenu: [
125126
{
126-
role: "startspeaking",
127+
role: 'startspeaking'
127128
},
128129
{
129-
role: "stopspeaking",
130-
},
131-
],
132-
},
130+
role: 'stopspeaking'
131+
}
132+
]
133+
}
133134
]
134135
: [
135136
{
136-
role: "delete",
137+
role: 'delete'
137138
},
138139
{
139-
type: "separator",
140+
type: 'separator'
140141
},
141142
{
142-
role: "selectAll",
143-
},
144-
]),
145-
],
143+
role: 'selectAll'
144+
}
145+
])
146+
]
146147
},
147148
// { role: "viewMenu" }
148149
{
149-
label: "View",
150+
label: 'View',
150151
submenu: [
151152
{
152-
role: "reload",
153+
role: 'reload'
153154
},
154155
{
155-
role: "forcereload",
156+
role: 'forcereload'
156157
},
157158
{
158-
role: "toggledevtools",
159+
role: 'toggledevtools'
159160
},
160161
{
161-
type: "separator",
162+
type: 'separator'
162163
},
163164
{
164-
role: "resetzoom",
165+
role: 'resetzoom'
165166
},
166167
{
167-
role: "zoomin",
168+
role: 'zoomin'
168169
},
169170
{
170-
role: "zoomout",
171+
role: 'zoomout'
171172
},
172173
{
173-
type: "separator",
174+
type: 'separator'
174175
},
175176
{
176-
role: "togglefullscreen",
177-
},
178-
],
177+
role: 'togglefullscreen'
178+
}
179+
]
179180
},
180181

181182
{
182-
label: "Window",
183+
label: 'Window',
183184
submenu: [
184185
{
185-
role: "minimize",
186+
role: 'minimize'
186187
},
187188
{
188-
role: "zoom",
189+
role: 'zoom'
189190
},
190191
...(isMac
191192
? [
192193
{
193-
type: "separator",
194+
type: 'separator'
194195
},
195196
{
196-
role: "front",
197+
role: 'front'
197198
},
198199
{
199-
type: "separator",
200+
type: 'separator'
200201
},
201202
{
202-
role: "window",
203-
},
203+
role: 'window'
204+
}
204205
]
205206
: [
206207
{
207-
role: "close",
208-
},
209-
]),
210-
],
208+
role: 'close'
209+
}
210+
])
211+
]
211212
},
212213
{
213-
role: "help",
214+
role: 'help',
214215
submenu: [
215216
{
216-
label: "Learn More",
217+
label: 'Learn More',
217218
click: async () => {
218-
const { shell } = require("electron");
219+
const { shell } = require('electron');
219220
await shell.openExternal(
220-
"https://github.com/open-source-labs/ReacType"
221+
'https://github.com/open-source-labs/ReacType'
221222
);
222-
},
223-
},
223+
}
224+
},
224225
{
225-
label: "Tutorial",
226+
label: 'Tutorial',
226227
click: () => openTutorial()
227228
}
228-
],
229-
},
229+
]
230+
}
230231
];
231232
};
232233

233234
// constructs menu from default template
234235
return {
235-
buildMenu: function () {
236+
buildMenu: function() {
236237
const menu = Menu.buildFromTemplate(defaultTemplate());
237238
Menu.setApplicationMenu(menu);
238239

239240
return menu;
240-
},
241+
}
241242
};
242243
};
243244

app/src/components/right/ProjectManager.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,6 @@ const ProjectManager = () => {
163163

164164
return (
165165
<div>
166-
<RouteLink to={'/tutorial'} style={{textDecoration: 'none'}}>
167-
<Button
168-
color="primary"
169-
style={{ ...style.button, marginLeft: '15%', textDecoration: 'none' }}
170-
variant="outlined"
171-
className={classes.button}
172-
>
173-
Tutorial
174-
</Button>
175-
</RouteLink>
176166
<Button
177167
color="primary"
178168
style={{ ...style.button, marginLeft: '15%' }}

app/src/constants/Styling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export default {
33
darkBlue: 'rgb(0, 0, 26)',
44
darkGray: '#252526',
55
tutorialGray: '#f2f0f0'
6-
}
6+
};

0 commit comments

Comments
 (0)