Skip to content

Commit 0a54c4a

Browse files
committed
pulled changes from dev branch
2 parents d932e0c + 6d3fbd5 commit 0a54c4a

File tree

9 files changed

+52
-18
lines changed

9 files changed

+52
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ How to use
3535
- **Create Instances on the Canvas**: Each component has its own canvas. Add an element to a component by dragging it onto the canvas. Div components are arbitrarily nestable and useful for complex layouts. Next.js and Gatsby.js projects have Link components to enable client-side navigation to other routes.
3636
- **Component Tree**: Click on the Component Tree tab next to the Code Preview tab to view the component tree hierarchy.
3737
- **Update Styling**: Select an element on the canvas to update its basic style attributes on the right panel. As you create new instances and add styling, watch as your code dynamically generates in the code preview in the bottom panel.
38-
- **Using State in Elements**: As of 10.0.0, you can now select an HTML element on the canvas and then navigate to the customization panel to click a button to pass a variable from state into your element's text or link field.
38+
- **Using State in Elements**: As of 11.0.0, you can now select an HTML element on the canvas and then navigate to the customization panel to click a button to pass a variable from state into your element's text or link field.
3939
- **User Preference Features**: With the click of a button, toggle between light mode and dark mode, depending on your preference.
4040
- **Export project**: Click the “Export Project’ button to export the project’s application files into a TypeScript file. The exported project is fully functional with Webpack, Express server, routing, etc., and will match what is mocked on the canvas.
4141
- **Export project with Tests**: Click the "includes tests" checkbox while exporting to include pre-configured Webpack, Jest, and Typescript files along with tests for your project.
@@ -147,12 +147,12 @@ How to use
147147

148148
[Julie Wu](https://www.linkedin.com/in/jwuarchitect/) [@yutingwu4](https://github.com/yutingwu4)
149149

150+
[Katrina Henderson](https://www.linkedin.com/in/katrinahenderson/) [@kchender](https://github.com/kchender)
151+
150152
[Kevin Park](https://www.linkedin.com/in/xkevinpark/) [@xkevinpark](https://github.com/xkevinpark)
151153

152154
[Khuong Nguyen](https://www.linkedin.com/in/khuong-nguyen/) [@khuongdn16](https://github.com/khuongdn16)
153155

154-
[Katrina Henderson](https://www.linkedin.com/in/katrinahenderson/) [@kchender](https://github.com/kchender)
155-
156156
[Linh Tran](https://www.linkedin.com/in/linhtran51/) [@Linhatran](https://github.com/Linhatran)
157157

158158
[Luke Madden](https://www.linkedin.com/in/lukemadden/) [@lukemadden](https://github.com/lukemadden)

app/src/components/bottom/BottomTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const BottomTabs = (props): JSX.Element => {
4343
Arrow.renderArrow(state.canvasFocus.childId);
4444

4545
return (
46-
<div className={`${classes.root} ${classes.rootLight}`} style={style}>
46+
<div className={`${classes.root} ${classes.rootLight}`} style={{ backgroundColor : '#003366' }}>
4747
<Box display="flex" justifyContent="space-between" alignItems="center" paddingBottom="10px" paddingRight="10px">
4848
<Tabs
4949
value={tab}

app/src/components/login/SignIn.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
295295
</Button>
296296
<Grid container>
297297
<Grid item xs>
298-
<RouteLink to={`/signup`} className="nav_link">
298+
<RouteLink style={{color: props.darkMode ? '#aaaaaa' : 'black'}} to={`/signup`} className="nav_link">
299299
Forgot password?
300300
</RouteLink>
301301
</Grid>
302302
<Grid item>
303-
<RouteLink to={`/signup`} className="nav_link">
303+
<RouteLink style={{color: props.darkMode ? '#aaaaaa' : 'black'}} to={`/signup`} className="nav_link">
304304
Don't have an account? Sign Up
305305
</RouteLink>
306306
</Grid>

app/src/components/login/SignUp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ const SignUp: React.FC<LoginInt & RouteComponentProps> = props => {
312312
</Button>
313313
<Grid container justify="flex-end">
314314
<Grid item>
315-
<RouteLink to={`/login`} className="nav_link">
315+
<RouteLink style={{color: props.darkMode ? '#aaaaaa' : 'black'}} to={`/login`} className="nav_link">
316316
Already have an account? Sign In
317317
</RouteLink>
318318
</Grid>

app/src/components/main/AddLink.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function AddLink({ id, onClickHandler }) {
3737
}
3838

3939
const pagesItems = state.components.filter(comp => state.rootComponents.includes(comp.id));
40+
<<<<<<< HEAD
4041
const dropDown = [<MenuItem style={{ color: isThemeLight? '#000' : '#fff'}} disabled /*hidden selected*/>Pages</MenuItem>].concat(pagesItems.map(comp => <MenuItem style={{ color: isThemeLight? '#000' : '#fff'}} value={comp.name}>{comp.name}</MenuItem>));
4142

4243
return (
@@ -57,11 +58,26 @@ function AddLink({ id, onClickHandler }) {
5758
// }}
5859
label='Pages'
5960
labelId='page-select-label'
61+
=======
62+
const dropDown = pagesItems.map(comp => <MenuItem style={{ color: 'black' }} value={comp.name}>{comp.name}</MenuItem>);
63+
64+
return (
65+
<div style={{padding: '1px', float: 'right', display: 'flex', border: '2px solid red', alignSelf: 'center'}}>
66+
<FormControl size='medium' style={{display: 'flex'}}>
67+
{/* <InputLabel style={ { color: isThemeLight? '#fff' : '#000'} }>Pages</InputLabel> */}
68+
<Select label='pages'
69+
>>>>>>> 6d3fbd545288416cd1e582d188963853b7c08f07
6070
variant="outlined"
6171
onMouseDown={onClickHandler}
6272
onChange={handlePageSelect}
6373
id="page-select"
74+
<<<<<<< HEAD
6475
style={ isThemeLight? {/*backgroundColor: '#eef0f1',*/ color: '#000', border: '1px solid black', height: '28px', width: '200px'} : {backgroundColor: 'gray', color: '#fff', border: '1px solid white', height: '28px', width: '200px'}}
76+
=======
77+
style={ isThemeLight
78+
? {backgroundColor: '#eef0f1', color: '#000', border: '1px solid black', height: '28px', width: '200px'}
79+
: {backgroundColor: 'gray', color: '#fff', border: '1px solid white', height: '28px', width: '200px'}}
80+
>>>>>>> 6d3fbd545288416cd1e582d188963853b7c08f07
6581
>
6682
{dropDown}
6783
</Select>

app/src/components/main/DemoRender.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const DemoRender = (): JSX.Element => {
5353
const componentBuilder = (array: object, key: number = 0) => {
5454
const componentsToRender = [];
5555
for (const element of array) {
56+
5657
if (element.name !== 'separator') {
5758
const elementType = element.name;
5859
const childId = element.childId;
@@ -67,11 +68,15 @@ const DemoRender = (): JSX.Element => {
6768
if (elementType === 'input') componentsToRender.push(<Box component={elementType} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}></Box>);
6869
else if (elementType === 'img') componentsToRender.push(<Box component={elementType} src={activeLink} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}></Box>);
6970
else if (elementType === 'Image') componentsToRender.push(<Box component='img' src={activeLink} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}></Box>);
70-
else if (elementType === 'a') componentsToRender.push(<Box component={elementType} href='javascript:void(0)' className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>);
71+
else if (elementType === 'a' || elementType === 'Link') componentsToRender.push(
72+
activeLink ?
73+
<Box component='a' href='javascript:void(0)' className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>
74+
:<Box component='a' className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>
75+
);
7176
else if (elementType === 'Switch') componentsToRender.push(<Switch>{renderedChildren}</Switch>);
7277
else if (elementType === 'Route') componentsToRender.push(<Route exact path={activeLink}>{renderedChildren}</Route>);
73-
else if (elementType === 'Link') componentsToRender.push(<Box component='a' href='javascript:void(0)' className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}</Box>)/*componentsToRender.push(<Link to={activeLink}>{innerText}</Link>);*/
74-
else componentsToRender.push(<Box component={elementType} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}{renderedChildren}</Box>);
78+
else componentsToRender.push(<Box component={elementType} className={classRender} style={elementStyle} key={key} id={`rend${childId}`}>{innerText}{renderedChildren}</Box>
79+
);
7580
key += 1;
7681
}
7782
}

app/src/containers/CustomizationPanel.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import ProjectManager from '../components/right/ProjectManager';
2424
import StateContext from '../context/context';
2525
import FormSelector from '../components/form/Selector';
2626
import UseStateModal from '../components/bottom/UseStateModal';
27+
import { OutgoingMessage } from 'http';
2728
// Previously named rightContainer, Renamed to Customizationpanel this now hangs on BottomTabs
2829
// need to pass in props to use the useHistory feature of react router
2930
const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
@@ -47,9 +48,21 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
4748
const [useContextObj, setUseContextObj] = useState({});
4849
const [stateUsedObj, setStateUsedObj] = useState({});
4950

51+
//Miko -- save properties of nested div
52+
function deepIterate(arr) {
53+
const output = [];
54+
for(let i = 0; i < arr.length; i++) {
55+
if(arr[i].typeId === 1000) continue;
56+
output.push(arr[i]);
57+
if(arr[i].children.length) {
58+
output.push(...deepIterate(arr[i].children));
59+
}
60+
}
61+
return output;
62+
}
63+
5064
const resetFields = () => {
51-
const currComponent = state.components.find(element => element.id === state.canvasFocus.componentId);
52-
const childrenArray = currComponent.children;
65+
const childrenArray = deepIterate(configTarget.children);
5366
for (const element of childrenArray) {
5467
if (configTarget.child && element.childId === configTarget.child.id) {
5568
const attributes = element.attributes;

app/src/helperFunctions/generateCode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ const generateUnformattedCode = (
286286
${` const [value, setValue] = useState("");${writeStateProps(currComponent.useStateCodes)}`}
287287
${!importReactRouter
288288
? ` return (
289-
<div className="${currComponent.name}" ${formatStyles(currComponent)}>
289+
<div className="${currComponent.name}" ${formatStyles(currComponent.style)}>
290290
\t${writeNestedElements(enrichedChildren)}
291291
</div>
292292
);`
293293
: ` return (
294294
<Router>
295-
<div className="${currComponent.name}" ${formatStyles(currComponent)}>
295+
<div className="${currComponent.name}" ${formatStyles(currComponent.style)}>
296296
\t${writeNestedElements(enrichedChildren)}
297297
</div>
298298
</Router>

app/src/public/styles/theme.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ export const theme1 = createTheme({
55
palette: {
66
type: 'dark',
77
primary: {
8-
main: '#3f51b5',
8+
main: '#003366', // navy blue
99
},
1010
secondary: {
11-
main: '#17a2b8',
11+
main: '#0099e6', // light blue
1212
},
1313
background: {
1414
paper: '#ffffff',
@@ -20,10 +20,10 @@ export const theme2 = createTheme({
2020
palette: {
2121
type: 'light',
2222
primary: {
23-
main: '#3f51b5',
23+
main: '#003366',
2424
},
2525
secondary: {
26-
main: '#17a2b8',
26+
main: '#0099e6',
2727
},
2828
background: {
2929
paper: '#ffffff',

0 commit comments

Comments
 (0)