Skip to content

Commit 632dbcf

Browse files
committed
fixed merging issues
2 parents acabf63 + 879a79a commit 632dbcf

24 files changed

+649
-318
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn
22
yarn.lock
3+
package-lock.json
34
### Linux ###
45
*~
56

main.js

Lines changed: 15 additions & 3 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.
@@ -139,7 +147,8 @@ const createWindow = () => {
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();
145154
}
@@ -195,6 +204,9 @@ 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

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.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@
8888
"dependencies": {
8989
"@material-ui/core": "^3.9.3",
9090
"@material-ui/icons": "^2.0.0",
91+
"@types/prettier": "^1.19.0",
9192
"@types/react": "^16.8.14",
9293
"@types/react-dom": "^16.8.4",
9394
"@types/react-redux": "^7.0.8",
95+
"@types/react-syntax-highlighter": "^11.0.4",
9496
"autoprefixer": "^9.0.1",
9597
"babel-polyfill": "^6.26.0",
9698
"classnames": "^2.2.6",

src/actions/components.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
2-
ComponentInt, ComponentsInt, PropInt, ChildInt, Action, ApplicationStateInt, LoadInitData, AddComponent
3-
} from '../utils/Interfaces.ts';
2+
ComponentInt, ComponentsInt, PropInt, ChildInt, Action
3+
} from '../utils/Interfaces';
44

55
import {
66
LOAD_INIT_DATA,
@@ -26,14 +26,14 @@ import {
2626
ADD_PROP,
2727
DELETE_ALL_DATA,
2828
UPDATE_HTML_ATTR,
29-
UPDATE_CHILDREN_SORT,
29+
// UPDATE_CHILDREN_SORT, --The reason why this is commented out is because of the unused reducer of the same name, for the component that is unfinished with the same name. Check out the Sort Children component to see what it does.
3030
CHANGE_IMAGE_SOURCE,
3131
DELETE_IMAGE
32-
} from '../actionTypes/index.ts';
32+
} from '../actionTypes/index';
3333

34-
import { loadState } from '../localStorage';
35-
import createFiles from '../utils/createFiles.util.ts';
36-
import createApplicationUtil from '../utils/createApplication.util.ts';
34+
import { loadState } from '../localStorage'; //this is a warning from 'localStorage' being a .js file instead of .ts. Convert to .ts to remove this warning.
35+
import createFiles from '../utils/createFiles.util';
36+
import createApplicationUtil from '../utils/createApplication.util';
3737

3838
export const changeImagePath = (imageSource: string) => ({
3939
type: CHANGE_IMAGE_SOURCE,
@@ -51,7 +51,7 @@ export const loadInitData = () => (dispatch: (arg: Action) => void) => {
5151
});
5252
};
5353

54-
export const addComponent = ({ title }: { title: string }) => (dispatch: (arg: AddComponent) => void) => {
54+
export const addComponent = ({ title }: { title: string }) => (dispatch: (arg: Action) => void) => {
5555
dispatch({ type: ADD_COMPONENT, payload: { title } });
5656
};
5757

@@ -81,7 +81,7 @@ export const deleteComponent = ({
8181
}) => (dispatch: (arg: Action) => void) => {
8282
// find all places where the "to be deleted" is a child and do what u gotta do
8383
stateComponents.forEach((parent: ComponentInt) => {
84-
parent.childrenArray
84+
parent.childrenArrayChildInt
8585
.filter((child: ChildInt) => child.childComponentId === componentId)
8686
.forEach((child: ChildInt) => {
8787
dispatch({
@@ -146,9 +146,8 @@ export const exportFiles = ({
146146
dispatch({
147147
type: EXPORT_FILES
148148
});
149-
150149
createFiles(components, path, appName, exportAppBool)
151-
.then((dir: string) =>
150+
.then((dir: any) =>
152151
dispatch({
153152
type: EXPORT_FILES_SUCCESS,
154153
payload: { status: true, dir: dir[0] }
@@ -195,7 +194,7 @@ export const createApplication = ({
195194
genOption: number;
196195
appName: string;
197196
exportAppBool: boolean;
198-
}) => (dispatch: (arg: Action) => void) => {
197+
}) => (dispatch: (arg: any) => void) => {
199198
if (genOption === 0) {
200199
exportAppBool = false;
201200
dispatch(

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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ class CodePreview extends Component<Props> {
2626
}}
2727
>
2828
<SyntaxHighlighter style={hybrid}>
29-
{format(componentRender(focusComponent, components))}}
29+
{format(componentRender(focusComponent, components), {
30+
singleQuote: true,
31+
trailingComma: 'es5',
32+
bracketSpacing: true,
33+
jsxBracketSameLine: true,
34+
parser: 'typescript'
35+
})}
3036
</SyntaxHighlighter>
3137
</div>
3238
);

src/components/GrandchildRectangle.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import React, { Component } from "react";
22
import { Rect, Group } from "react-konva";
33
import { ComponentsInt, ComponentInt, ChildInt } from "../utils/Interfaces.ts";
44

5+
//////////////////////////////////////////////////////////////////////////////
6+
/////Logic in this component is mainly the same as Rectangle.tsx./////////////
7+
/////Not going to bother commenting too much in here for this reason./////////
8+
//////////////////////////////////////////////////////////////////////////////
9+
510
interface PropsInt {
611
x: number;
712
y: number;
@@ -45,6 +50,7 @@ class GrandchildRectangle extends Component<PropsInt, StateInt> {
4550
);
4651
}
4752

53+
//pretty sure this does nothing here because an image source is never passed down this deep...
4854
setImage = (imageSource: string): void => {
4955
if (!imageSource) return;
5056
const image = new window.Image();
@@ -75,7 +81,7 @@ class GrandchildRectangle extends Component<PropsInt, StateInt> {
7581
// the Rect emits changes to child width and height with help from Transformer
7682
return (
7783
<Group
78-
draggable={false}
84+
draggable={false} //this logic is necessary to make sure the user can't click on any grandchildren
7985
x={x}
8086
y={y}
8187
scaleX={scaleX}

0 commit comments

Comments
 (0)