Skip to content

Commit 2afa4d9

Browse files
committed
research demoRender
1 parent dc55e3f commit 2afa4d9

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

app/src/components/left/ComponentDrag.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import makeStyles from '@mui/styles/makeStyles';
55
import { useSelector } from 'react-redux';
66
import ComponentPanelItem from '../right/ComponentPanelItem';
77

8+
console.log('line 8 ComponentDrag')
89

910
const useStyles = makeStyles({
1011
panelWrapper: {
1112
display: 'flex',
1213
flexDirection: 'column',
1314
alignItems: 'center',
1415
flexGrow: 1,
15-
overflow: 'auto'
16+
overflow: 'auto',
1617
},
1718
panelWrapperList: {
1819
minHeight: 'auto'
@@ -28,6 +29,12 @@ const useStyles = makeStyles({
2829
const ComponentDrag = ({ isVisible, isThemeLight }): JSX.Element | null => {
2930
const classes = useStyles();
3031
const state = useSelector((store: RootState) => store.appState);
32+
console.log("isVisible", isVisible)
33+
console.log("isThemeLight", isThemeLight)
34+
console.log("isVisible", isVisible)
35+
console.log("state", state)
36+
console.log("stateMUI", state.MUITypes)
37+
3138

3239
const isFocus = (targetId: Number) => {
3340
console.log('targetID line 33', targetId)
@@ -73,3 +80,19 @@ const ComponentDrag = ({ isVisible, isThemeLight }): JSX.Element | null => {
7380

7481
export default ComponentDrag;
7582

83+
84+
const propsArray4 = [
85+
{ Name: "align",
86+
Type: "'center' | 'inherit' | 'justify' | 'left' | 'right'",
87+
Default: "'inherit'",
88+
Description: "Set the text-align on the component." },
89+
{ Name: "children", Type: "node" },
90+
{ Name: "classes", Type: "object" },
91+
{ Name: "component", Type: "elementType", Description: "The component used for the root node." },
92+
{ Name: "gutterBottom", Type: "bool", Default: "false", Description: "If true, the text will have a bottom margin." },
93+
{ Name: "noWrap", Type: "bool", Default: "false", Description: "If true, the text will not wrap, but instead will truncate with a text overflow ellipsis." },
94+
{ Name: "paragraph", Type: "bool", Default: "false", Description: "If true, the element will be a paragraph element." },
95+
{ Name: "sx", Type: "Array<func | object | bool> | func | object" },
96+
{ Name: "variant", Type: "'body1' | 'body2' | 'button' | 'caption' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'inherit' | 'overline' | 'subtitle1' | 'subtitle2' | string", Default: "'body1'", Description: "Applies the theme typography styles." },
97+
{ Name: "variantMapping", Type: "object", Default: "{ h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p', inherit: 'p' }", Description: "The component maps the variant prop to a range of different HTML element types." }
98+
];

app/src/components/main/DemoRender.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ const DemoRender = (): JSX.Element => {
8585
if (!event.data || typeof event.data.data !== 'string') return;
8686

8787
const component: string = event.data.data.split('/').at(-1);
88-
console.log('component', component)
8988
// If components aren't defined or component isn't a string, return early
9089
if (!state.components || !component) return;
9190

@@ -110,6 +109,7 @@ const DemoRender = (): JSX.Element => {
110109
const elementType = element.name;
111110
const childId = element.childId;
112111
const elementStyle = element.style;
112+
console.log("elementType", elementType)
113113
console.log("elementStyle", elementStyle)
114114
const innerText = element.attributes.compText;
115115
const classRender = element.attributes.cssClasses;
@@ -167,7 +167,7 @@ const DemoRender = (): JSX.Element => {
167167
>
168168
{innerText}
169169
{renderedChildren}
170-
</Box>
170+
</Box>,
171171
);
172172
else if (elementType === 'Switch')
173173
componentsToRender.push(<Switch>{renderedChildren}</Switch>);
@@ -214,7 +214,7 @@ const DemoRender = (): JSX.Element => {
214214
return;
215215
}
216216
});
217-
console.log('code line 215', code)
217+
console.log('This is the CODE on line 215 of DemoRender', code)
218218
//writes our stylesheet from state to the code
219219
code += `<style>${stylesheet}</style>`;
220220

app/src/containers/CustomizationPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { RootState } from '../redux/store';
4242
import { emitEvent } from '../helperFunctions/socket';
4343
import { Number } from 'mongoose';
4444

45+
4546
// Previously named rightContainer, Renamed to Customizationpanel this now hangs on BottomTabs
4647
// need to pass in props to use the useHistory feature of react router
4748
const CustomizationPanel = ({ isThemeLight }): JSX.Element => {

app/src/helperFunctions/generateCode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const generateUnformattedCode = (
4747
contextParam: any
4848
) => {
4949
const components = [...comps];
50+
console.log("hi from line 50 in the generateCode")
5051
// find the component that we're going to generate code for
5152
const currComponent = components.find((elem) => elem.id === componentId);
5253
// find the unique components that we need to import into this component file

0 commit comments

Comments
 (0)