Skip to content

Commit 3f9ceab

Browse files
committed
cleaned up an extra console log and completed Form Nesting
1 parent 1e0cc09 commit 3f9ceab

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

app/src/components/main/DirectChildHTMLNestable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const snapShotFunc = () => {
8181
});
8282
}
8383
},
84-
84+
8585
collect: (monitor: any) => {
8686
return {
8787
isOver: !!monitor.isOver({ shallow: true })

app/src/helperFunctions/generateCode.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const generateUnformattedCode = (
4646
// check if imports array include the referenced component, if not, add its name to the imports array (e.g. the name/tag of the component/element)
4747
if (!imports.includes(referencedComponent.name))
4848
imports.push(referencedComponent.name);
49-
child['name'] = referencedComponent.name;
50-
return child;
49+
child['name'] = referencedComponent.name;
50+
return child;
5151
} else if (child.type === 'HTML Element') {
5252
const referencedHTML = HTMLTypes.find(elem => elem.id === child.typeId);
5353
child['tag'] = referencedHTML.tag;
@@ -67,7 +67,6 @@ const generateUnformattedCode = (
6767
return child;
6868
}
6969
});
70-
7170
return enrichedChildren;
7271
};
7372

app/src/helperFunctions/manageSeparators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ manageSeparators.handleSeparators = (arr: object[], str: string) => {
4848
// this function replaces separators onto which an element is dropped with the element itself
4949
manageSeparators.mergeSeparator = (arr: object[], index: number) => {
5050
return arr.map((child) => {
51-
if (child.name === 'div' && child.children.length) {
51+
if (child.name === 'div' || child.name === 'form' && child.children.length) {
5252
const divContents = manageSeparators.mergeSeparator(child.children, index);
5353
return { ...child, children: divContents }
5454
}

app/src/reducers/componentReducer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ const reducer = (state: State, action: Action) => {
252252

253253
if (type === 'Component') {
254254
components.forEach(comp => {
255-
console.log('comp in ADDD CHILD', comp)
256255
if (comp.id === typeId) {
257256
componentName = comp.name;
258257
componentChildren = comp.children;

0 commit comments

Comments
 (0)