Skip to content

Commit dec4066

Browse files
authored
Merge pull request #62 from oslabs-beta/travis
Bug fix for React Native components and vanilla React components
2 parents 8b50629 + 82d2077 commit dec4066

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,27 @@ In other words, **you can draw prototypes and export React / Typescript code!**
1212

1313
**ReacType** allows the user to _visualize_ their application architecture dynamically, employing a _canvas display_, an _application tree_, and a _real-time component code preview_. The user can create components and load _instances_ of these components, as well as nested HTML elements, onto the canvas. This architecture can then be _exported_ as TypeScript application files to be used as a starter template for any repository.
1414

15-
Download for [MacOS](https://github.com/team-reactype/ReacType/releases/tag/Mac.Version.1.0), [Windows](https://github.com/team-reactype/ReacType/releases/tag/Win.Version.1.0), [Linux](https://github.com/team-reactype/ReacType/releases/tag/Linux.Version.1.0).
15+
**New with version 2.0:**
16+
- React Native mode for iOS/Andoird app design
17+
- Hooks integration with functional components
18+
- History navigation
19+
- Tutorial mode
20+
- New keyboard shortcuts
21+
- Editable code preview
22+
- Prop value designation for component children
23+
24+
Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windows](https://github.com/team-reactype/ReacType/releases/), [Linux](https://github.com/team-reactype/ReacType/releases/).
1625

1726
* **Mac users**: for now you might need to go to your security settings to allow the app run on your system as we do not have an Apple license yet.
1827

28+
* **Linux users**: run the application as a super user in order to read and write files.
29+
1930
![Image of ReacType Application](https://i.imgur.com/0wV7R1P.jpg)
2031

2132
### How to use
2233

2334
- Open the application to start a new project. It will open in the root App component, with its name listed in the left panel and the component represented by the white box on the canvas.
35+
- Switch to React Native mode to change the interface to a mobile app development environment
2436
- To add a new component, type its name in the upper left panel, in the field '**Add class component**', and press enter.
2537
- To render a component **_instance_** to the screen, first select the component, or _parent_, that the instance will be rendered within. This selected component will be represented in a new canvas view, with its own white box. Then press the plus button next to the component name. An instance, or _child_, representation will appear on the canvas.
2638
- To add draggable **HTML elements**, select the image icons on the lower left panel.

src/components/main/Rectangle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class Rectangle extends Component<RectanglePorpsInt> {
178178
stroke={
179179
childType === 'COMP'
180180
? this.getComponentColor(childComponentId)
181-
: native && componentId === 1 && childType !== 'HTML' ? null : '#000000' //sets the parent component color to black
181+
: native && componentId === 1 && (childType !== 'HTML' && childType !== 'NATIVE' )? null : '#000000' //sets the parent component color to black
182182
}
183183
onTransformEnd={event =>
184184
this.handleResize(componentId, childId, event.target, blockSnapSize)

src/reducers/leftReducers.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ export const addChild = (
1616
{
1717
title,
1818
childType = '',
19-
HTMLInfo = {},
20-
native
19+
HTMLInfo = {}
2120
}: {
2221
title: string;
2322
childType: string;
2423
HTMLInfo: { [index: string]: string };
25-
native: boolean;
2624
}
2725
) => {
2826
const strippedTitle = title;
@@ -37,7 +35,7 @@ export const addChild = (
3735
// if childType is NOT included in the array of NATIVE React types && also not coming from left panel then the childType will revert to HTML
3836
!nativeComponentTypes.includes(childType) && childType !== 'COMP'
3937
? (childType = 'HTML')
40-
: (childType = 'NATIVE');
38+
: childType = childType === 'COMP' ? 'COMP' : 'NATIVE';
4139

4240
// view represents the curretn FOCUSED COMPONENT - this is the component where the child is being added to
4341
// we only add childrent (or do any action) to the focused omconent
@@ -78,7 +76,7 @@ export const addChild = (
7876
}
7977

8078
let htmlElemPosition: htmlElemPositionInt = { width: null, height: null };
81-
if (childType === 'HTML') {
79+
if (childType === 'HTML' || childType === 'NATIVE') {
8280
htmlElemPosition = getSize(htmlElement);
8381
// if above function doesnt reutn anything, it means html element is not in our database
8482
//looks like the group that originally worked on this app planend to have a back end that accessed a DB with element types.

0 commit comments

Comments
 (0)