Skip to content

Commit 88bbbea

Browse files
authored
Merge pull request #39 from oslabs-beta/revert-38-master
Revert "Children added to parent components will have their children props destructured to parents automatically"
2 parents 5397ad4 + a8a4e95 commit 88bbbea

File tree

15 files changed

+146
-484
lines changed

15 files changed

+146
-484
lines changed

main.js

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

58+
5859
function toggleTutorial() {
5960
mainWindow.webContents.send('tutorial_clicked');
6061
}
@@ -121,17 +122,16 @@ const createWindow = () => {
121122
{
122123
label: 'Edit',
123124
submenu: [
124-
{
125+
{
125126
label: 'Undo',
126-
accelerator: process.platform === 'darwin' ? 'Cmd+Z' : 'Ctrl+Z', //these hotkeys are a tad bit glitchy
127+
accelerator: process.platform === 'darwin' ? 'Cmd+Z' : 'Ctrl+Z', //these hotkeys are a tad bit glitchy
127128
click() {
128129
undo();
129130
}
130131
},
131-
{
132+
{
132133
label: 'Redo',
133-
accelerator:
134-
process.platform === 'darwin' ? 'Cmd+Shift+Z' : 'Ctrl+Shift+Z',
134+
accelerator: 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
]
@@ -269,7 +269,7 @@ app.on('ready', () => {
269269
}
270270
globalShortcut.register('Escape', () => {
271271
escape();
272-
});
272+
})
273273
});
274274

275275
// Quit when all windows are closed.

src/actions/actionCreators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ export const addComponent = ({ title }: { title: string }) => (
6161
dispatch({ type: ADD_COMPONENT, payload: { title } });
6262
};
6363

64-
export const addProp = ({ key, type }: { key: string; type: string }) => ({
64+
export const addProp = (prop: PropInt) => ({
6565
type: ADD_PROP,
66-
payload: { key, type }
66+
payload: { ...prop }
6767
});
6868

6969
export const changeTutorial = (tutorial: number) => ({

src/components/AddChildProps.tsx

Lines changed: 0 additions & 101 deletions
This file was deleted.

src/components/CodePreview.tsx

Lines changed: 0 additions & 111 deletions
This file was deleted.

src/components/bottom/BottomPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class BottomPanel extends Component<BottomPanelPropsInt> {
4444
} = this.props;
4545

4646
return (
47-
<div className='bottom-panel' style={{ width: '100%' }}>
47+
<div className="bottom-panel" style={{ width: '100%' }}>
4848
<BottomTabs
4949
components={components}
5050
focusComponent={focusComponent}

src/components/bottom/BottomTabs.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
142142
focusComponent,
143143
deleteProp,
144144
addProp,
145-
changeFocusComponent,
146145
focusChild,
147146
updateCode,
148147
toggleCodeEdit,
@@ -166,12 +165,12 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
166165
<Tab
167166
disableRipple
168167
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
169-
label='Application Tree'
168+
label="Application Tree"
170169
/>
171170
<Tab
172171
disableRipple
173172
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
174-
label='Code Preview'
173+
label="Code Preview"
175174
/>
176175
<Tab
177176
disableRipple
@@ -188,13 +187,13 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
188187
<Tab
189188
disableRipple
190189
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
191-
label='Add Child Props'
190+
label="Add Child Props"
192191
/>
193192
</Tabs>
194193

195194
{value === 0 && (
196195
<div
197-
id='treeWrapper'
196+
id="treeWrapper"
198197
style={{
199198
width: '100%',
200199
height: '100%'
@@ -231,9 +230,9 @@ class BottomTabs extends Component<BottomTabsPropsInt, StateInt> {
231230
{value === 1 && (
232231
<CodePreview
233232
focusComponent={focusComponent}
234-
components={components}
235-
changeFocusComponent={changeFocusComponent}
236233
updateCode={updateCode}
234+
components={components}
235+
changeFocusComponent={this.props.changeFocusComponent}
237236
toggleCodeEdit={toggleCodeEdit}
238237
codeReadOnly={codeReadOnly}
239238
/>

0 commit comments

Comments
 (0)