Skip to content

Commit 8e9af9e

Browse files
committed
Merge branch 'stretch' of https://github.com/oslabs-beta/ReacType into native
2 parents ec609bc + d91b7ba commit 8e9af9e

20 files changed

+491
-329
lines changed

main.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ function redo() {
5555
mainWindow.webContents.send('redo');
5656
}
5757

58-
5958
function toggleTutorial() {
6059
mainWindow.webContents.send('tutorial_clicked');
6160
}
@@ -122,16 +121,17 @@ const createWindow = () => {
122121
{
123122
label: 'Edit',
124123
submenu: [
125-
{
124+
{
126125
label: 'Undo',
127-
accelerator: process.platform === 'darwin' ? 'Cmd+Z' : 'Ctrl+Z', //these hotkeys are a tad bit glitchy
126+
accelerator: process.platform === 'darwin' ? 'Cmd+Z' : 'Ctrl+Z', //these hotkeys are a tad bit glitchy
128127
click() {
129128
undo();
130129
}
131130
},
132-
{
131+
{
133132
label: 'Redo',
134-
accelerator: process.platform === 'darwin' ? 'Cmd+Shift+Z' : 'Ctrl+Shift+Z',
133+
accelerator:
134+
process.platform === 'darwin' ? 'Cmd+Shift+Z' : 'Ctrl+Shift+Z',
135135
click() {
136136
redo();
137137
}
@@ -142,8 +142,8 @@ const createWindow = () => {
142142
{ role: 'paste' },
143143
{ role: 'pasteandmatchstyle' },
144144
{ role: 'delete' },
145-
{ role: 'selectall' },
146-
],
145+
{ role: 'selectall' }
146+
]
147147
},
148148
{
149149
label: 'View',
@@ -172,9 +172,9 @@ const createWindow = () => {
172172
}
173173
},
174174
{
175-
label: 'Tutorial',
176-
click() {
177-
toggleTutorial();
175+
label: 'Tutorial',
176+
click() {
177+
toggleTutorial();
178178
}
179179
}
180180
]
@@ -242,10 +242,11 @@ const createWindow = () => {
242242
mainWindow = null;
243243
});
244244

245+
// UNCOMMENT THIS DURING DEVELOPMENT TO ENABLE CONSOLE TO OPEN UPON LAUNCH
245246
// dev tools opened on every browser creation
246-
mainWindow.webContents.once('dom-ready', () => {
247-
mainWindow.webContents.openDevTools();
248-
});
247+
// mainWindow.webContents.once('dom-ready', () => {
248+
// mainWindow.webContents.openDevTools();
249+
// });
249250
};
250251

251252
// This method will be called when Electron has finished
@@ -269,7 +270,7 @@ app.on('ready', () => {
269270
}
270271
globalShortcut.register('Escape', () => {
271272
escape();
272-
})
273+
});
273274
});
274275

275276
// Quit when all windows are closed.

src/actions/__tests__/actionCreator.test.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,6 @@ describe('Testing All of The Action Creators', () => {
115115
expect(actions.editComponent(payld)).toEqual(expectedAction);
116116
});
117117

118-
it('handleClose returns a proper action', () => {
119-
const expectedAction = {
120-
type: types.HANDLE_CLOSE,
121-
payload: false
122-
};
123-
expect(actions.handleClose()).toEqual(expectedAction);
124-
});
125-
126118
it('handleTransform returns a proper action', () => {
127119
const payld = { x: 100, y: 200, width: 50, height: 75 };
128120
const componentId = 2;

src/actions/actionCreators.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,6 @@ export const exportFiles = ({
241241
);
242242
};
243243

244-
export const handleClose = (): Action => ({
245-
type: HANDLE_CLOSE,
246-
payload: false
247-
});
248-
249244
export const handleTransform = (
250245
componentId: number,
251246
childId: number,

src/components/bottom/AddChildProps.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ class AddChildProps extends Component<ChildPropsTypes> {
6464
data={focusComponent.childrenArray}
6565
title="Add Your Child Props Here!"
6666
/>
67-
68-
{/* BUTTON FUNCTIONALITY PENDING
69-
<button
70-
onClick={() => {
71-
this.tableRef.current.onQueryChange();
72-
}}
73-
>
74-
Sean Sucks
75-
</button> */}
7667
</div>
7768
);
7869
}

src/components/bottom/BottomPanel.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { Component } from 'react';
22
import { connect } from 'react-redux';
33
import {
4-
handleClose,
54
deleteProp,
65
addProp,
76
toggleNative,
@@ -16,7 +15,6 @@ const IPC = require('electron').ipcRenderer;
1615
const mapDispatchToProps = (dispatch: any) => ({
1716
addProp: (prop: PropInt) => dispatch(addProp(prop)),
1817
deleteProp: (id: number) => dispatch(deleteProp(id)),
19-
handleNotificationClose: () => dispatch(handleClose()),
2018
toggleNative: () => dispatch(toggleNative()),
2119
toggleCodeEdit: () => dispatch(toggleCodeEdit())
2220
});

src/components/bottom/BottomTabs.tsx

Lines changed: 64 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ import Tree from 'react-d3-tree';
77
import Props from './Props';
88
import HtmlAttr from './HtmlAttr';
99
import CodePreview from './CodePreview';
10-
import Switch from '@material-ui/core/Switch';
1110
import { ComponentsInt, PropsInt } from '../../interfaces/Interfaces';
1211
import Box from '@material-ui/core/Box';
13-
import FormGroup from '@material-ui/core/FormGroup';
14-
import FormControlLabel from '@material-ui/core/FormControlLabel';
1512

1613
interface BottomTabsPropsInt extends PropsInt {
1714
deleteProp(id: number): void;
@@ -30,70 +27,6 @@ interface StateInt {
3027
translate: { x: number; y: number };
3128
}
3229

33-
const styles = (theme: Theme): any => ({
34-
root: {
35-
flexGrow: 1,
36-
backgroundColor: '#333333',
37-
height: '100%',
38-
color: '#fff',
39-
boxShadow: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)'
40-
},
41-
bottomHeader: {
42-
flex: 1,
43-
flexDirection: 'row',
44-
alignItems: 'center',
45-
Width: '200px'
46-
},
47-
tabsRoot: {
48-
borderBottom: '0.5px solid #424242'
49-
},
50-
tabsIndicator: {
51-
backgroundColor: '#1de9b6'
52-
},
53-
tabRoot: {
54-
textTransform: 'initial',
55-
minWidth: 40,
56-
fontWeight: theme.typography.fontWeightRegular,
57-
// marginRight: theme.spacing.unit * 4,
58-
marginRight: theme.spacing(4), // JZ: updated syntax as per deprecation warning
59-
60-
fontFamily: [
61-
'-apple-system',
62-
'BlinkMacSystemFont',
63-
'"Segoe UI"',
64-
'Roboto',
65-
'"Helvetica Neue"',
66-
'Arial',
67-
'sans-serif',
68-
'"Apple Color Emoji"',
69-
'"Segoe UI Emoji"',
70-
'"Segoe UI Symbol"'
71-
].join(','),
72-
'&:hover': {
73-
color: '#1de9b6',
74-
opacity: 1
75-
},
76-
'&$tabSelected': {
77-
color: '#33eb91',
78-
fontWeight: theme.typography.fontWeightMedium
79-
},
80-
'&:focus': {
81-
color: '#4aedc4'
82-
}
83-
},
84-
tabSelected: {},
85-
typography: {
86-
padding: theme.spacing(3) // JZ: updated syntax as per deprecation warning
87-
},
88-
padding: {
89-
padding: `0 ${theme.spacing(2)}px` // JZ: updated syntax as per deprecation warning
90-
},
91-
switch: {
92-
marginRight: '10px',
93-
marginTop: '2px'
94-
}
95-
});
96-
9730
class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
9831
constructor(props: BottomTabsPropsInt) {
9932
super(props);
@@ -103,6 +36,7 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
10336
};
10437
}
10538
treeWrapper: HTMLDivElement;
39+
10640
componentDidMount() {
10741
// dynamically center the tree based on the div size
10842
const dimensions = this.treeWrapper.getBoundingClientRect();
@@ -209,31 +143,7 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
209143
htmlAttribCount ? `(${htmlAttribCount})` : ''
210144
} `}
211145
/>
212-
{/* <Tab
213-
disableRipple
214-
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
215-
label="Add Child Props"
216-
/> */}
217146
</Tabs>
218-
{
219-
// REACT NATIVE TOGGLE REMOVED AND MOVED TO LEFTCONTAINER. REMOVE THIS CODE IF NO ADVERSE EFFECTS FOUND
220-
/* <FormGroup>
221-
<FormControlLabel
222-
className={classes.switch}
223-
control={
224-
<Switch
225-
checked={native}
226-
color="primary"
227-
onChange={() => {
228-
toggleNative();
229-
}}
230-
/>
231-
}
232-
label="Native Mode"
233-
labelPlacement="start"
234-
/>
235-
</FormGroup> */
236-
}
237147
</Box>
238148
{value === 0 && (
239149
<div
@@ -292,4 +202,67 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
292202
}
293203
}
294204

205+
const styles = (theme: Theme): any => ({
206+
root: {
207+
flexGrow: 1,
208+
backgroundColor: '#333333',
209+
height: '100%',
210+
color: '#fff',
211+
boxShadow: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)'
212+
},
213+
bottomHeader: {
214+
flex: 1,
215+
flexDirection: 'row',
216+
alignItems: 'center',
217+
Width: '200px'
218+
},
219+
tabsRoot: {
220+
borderBottom: '0.5px solid #424242'
221+
},
222+
tabsIndicator: {
223+
backgroundColor: '#1de9b6'
224+
},
225+
tabRoot: {
226+
textTransform: 'initial',
227+
minWidth: 40,
228+
fontWeight: theme.typography.fontWeightRegular,
229+
marginRight: theme.spacing(4), // JZ: updated syntax as per deprecation warning
230+
231+
fontFamily: [
232+
'-apple-system',
233+
'BlinkMacSystemFont',
234+
'"Segoe UI"',
235+
'Roboto',
236+
'"Helvetica Neue"',
237+
'Arial',
238+
'sans-serif',
239+
'"Apple Color Emoji"',
240+
'"Segoe UI Emoji"',
241+
'"Segoe UI Symbol"'
242+
].join(','),
243+
'&:hover': {
244+
color: '#1de9b6',
245+
opacity: 1
246+
},
247+
'&$tabSelected': {
248+
color: '#33eb91',
249+
fontWeight: theme.typography.fontWeightMedium
250+
},
251+
'&:focus': {
252+
color: '#4aedc4'
253+
}
254+
},
255+
tabSelected: {},
256+
typography: {
257+
padding: theme.spacing(3) // JZ: updated syntax as per deprecation warning
258+
},
259+
padding: {
260+
padding: `0 ${theme.spacing(2)}px` // JZ: updated syntax as per deprecation warning
261+
},
262+
switch: {
263+
marginRight: '10px',
264+
marginTop: '2px'
265+
}
266+
});
267+
295268
export default withStyles(styles)(BottomTabs);

src/components/bottom/CodePreview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class CodePreview extends Component<CodePreviewProps> {
8585
readOnly={this.props.codeReadOnly}
8686
editorProps={{ $blockScrolling: true }}
8787
fontSize={16}
88+
tabSize={2}
8889
/>
8990
<div style={{ display: 'flex', flexDirection: 'column' }}>
9091
<Button

0 commit comments

Comments
 (0)