Skip to content

Commit dc55e3f

Browse files
committed
stashed changes to new branch
1 parent aaf7b18 commit dc55e3f

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

app/src/components/left/ComponentDrag.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const useStyles = makeStyles({
2121
color: '#fff'
2222
},
2323
darkThemeFontColor: {
24-
color: '#fff'
24+
color: '#00008B,'
2525
}
2626
});
2727

@@ -30,6 +30,8 @@ const ComponentDrag = ({ isVisible, isThemeLight }): JSX.Element | null => {
3030
const state = useSelector((store: RootState) => store.appState);
3131

3232
const isFocus = (targetId: Number) => {
33+
console.log('targetID line 33', targetId)
34+
console.log('componentID line 34', state.canvasFocus.componentId)
3335
return state.canvasFocus.componentId === targetId ? true : false;
3436
};
3537

app/src/components/main/CanvasContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function CanvasContainer(props: CanvasContainerProps): JSX.Element {
3838
backgroundSize: '8px 8px',
3939
backgroundPosition: '-19px -19px',
4040
borderBottom: 'none',
41-
overflow: 'auto'
41+
overflow: 'auto',
4242
};
4343

4444
//containerRef references the container that will ultimately have the scroll functionality

app/src/components/main/DemoRender.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Component } from '../../interfaces/Interfaces';
1313
import ReactDOMServer from 'react-dom/server';
1414
import { RootState } from '../../redux/store';
1515
import { changeFocus } from '../../redux/reducers/slice/appStateSlice';
16+
import { blue } from '@mui/material/colors';
1617

1718
// DemoRender is the full sandbox demo of our user's custom built React components. DemoRender references the design specifications stored in state to construct
1819
// real react components that utilize hot module reloading to depict the user's prototype application.
@@ -79,11 +80,12 @@ const DemoRender = (): JSX.Element => {
7980
`;
8081

8182
window.onmessage = (event) => {
83+
// console.log('event', event)
8284
// If event.data or event.data.data is undefined, return early
8385
if (!event.data || typeof event.data.data !== 'string') return;
8486

8587
const component: string = event.data.data.split('/').at(-1);
86-
88+
console.log('component', component)
8789
// If components aren't defined or component isn't a string, return early
8890
if (!state.components || !component) return;
8991

@@ -102,10 +104,13 @@ const DemoRender = (): JSX.Element => {
102104
const componentBuilder = (array: any, key: number = 0) => {
103105
const componentsToRender = [];
104106
for (const element of array) {
107+
console.log("array")
108+
console.log(array)
105109
if (element.name !== 'separator') {
106110
const elementType = element.name;
107111
const childId = element.childId;
108112
const elementStyle = element.style;
113+
console.log("elementStyle", elementStyle)
109114
const innerText = element.attributes.compText;
110115
const classRender = element.attributes.cssClasses;
111116
const activeLink = element.attributes.compLink;
@@ -188,6 +193,7 @@ const DemoRender = (): JSX.Element => {
188193
key += 1;
189194
}
190195
}
196+
console.log('componentstoRender array line 196', componentsToRender)
191197
return componentsToRender;
192198
};
193199

@@ -198,16 +204,17 @@ const DemoRender = (): JSX.Element => {
198204
const currComponent = state.components.find(
199205
(element) => element.id === state.canvasFocus.componentId
200206
);
201-
207+
202208
//writes each component to the code
203209
componentBuilder(currComponent.children).forEach((element) => {
204210
try {
205211
code += ReactDOMServer.renderToString(element);
212+
console.log('code line 211', code)
206213
} catch {
207214
return;
208215
}
209216
});
210-
217+
console.log('code line 215', code)
211218
//writes our stylesheet from state to the code
212219
code += `<style>${stylesheet}</style>`;
213220

0 commit comments

Comments
 (0)