Skip to content

Commit 8eed16b

Browse files
committed
added params to addStateSlice generate codes
1 parent ac765d5 commit 8eed16b

File tree

1 file changed

+49
-23
lines changed

1 file changed

+49
-23
lines changed

app/src/redux/reducers/slice/appStateSlice.ts

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ const appStateSlice = createSlice({
291291
// },
292292
// state.components = components;
293293
// state.rootComponents = rootComponents;
294-
// state.nextComponentId = nextComponentId
294+
state.nextComponentId = nextComponentId
295295

296296

297297
},
@@ -412,14 +412,19 @@ const appStateSlice = createSlice({
412412
state.tailwind,
413413
action.payload.contextParam
414414
);
415-
console.log('entered the addchild2')
415+
416416
// return {
417417
// ...state,
418418
// components,
419419
// nextChildId,
420420
// canvasFocus,
421421
// nextTopSeparatorId
422422
// };
423+
state.components =components;
424+
state.nextChildId = nextChildId;
425+
state.canvasFocus = canvasFocus;
426+
state.nextTopSeparatorId = nextTopSeparatorId;
427+
423428
},
424429
changeTailwind: (state, action) => {
425430
return { ...state, tailwind: action.payload }
@@ -471,7 +476,8 @@ const appStateSlice = createSlice({
471476
[...state.rootComponents],
472477
state.projectType,
473478
state.HTMLTypes,
474-
state.tailwind
479+
state.tailwind,
480+
action.payload.contextParam
475481
);
476482
return { ...state, components };
477483
},
@@ -527,7 +533,8 @@ const appStateSlice = createSlice({
527533
[...state.rootComponents],
528534
state.projectType,
529535
state.HTMLTypes,
530-
state.tailwind
536+
state.tailwind,
537+
action.payload.contextParam
531538
);
532539
return { ...state, components, nextTopSeparatorId };
533540
},
@@ -542,7 +549,8 @@ const appStateSlice = createSlice({
542549
[...state.rootComponents],
543550
state.projectType,
544551
state.HTMLTypes,
545-
state.tailwind
552+
state.tailwind,
553+
action.payload.contextParam
546554
);
547555
return { ...state, components };
548556
},
@@ -565,7 +573,8 @@ const appStateSlice = createSlice({
565573
[...state.rootComponents],
566574
state.projectType,
567575
state.HTMLTypes,
568-
state.tailwind
576+
state.tailwind,
577+
action.payload.contextParam
569578
);
570579
return { ...state, components };
571580
},
@@ -590,7 +599,8 @@ const appStateSlice = createSlice({
590599
[...state.rootComponents],
591600
state.projectType,
592601
state.HTMLTypes,
593-
state.tailwind
602+
state.tailwind,
603+
action.payload.contextParam
594604
);
595605
return { ...state, components };
596606
},
@@ -611,7 +621,8 @@ const appStateSlice = createSlice({
611621
[...state.rootComponents],
612622
state.projectType,
613623
state.HTMLTypes,
614-
state.tailwind
624+
state.tailwind,
625+
action.payload.contextParam
615626
);
616627
return { ...state, components };
617628
},
@@ -664,7 +675,8 @@ const appStateSlice = createSlice({
664675
rootComponents,
665676
state.projectType,
666677
state.HTMLTypes,
667-
state.tailwind
678+
state.tailwind,
679+
action.payload.contextParam
668680
);
669681
}
670682
const canvasFocus = { componentId: 1, childId: null };
@@ -698,7 +710,8 @@ const appStateSlice = createSlice({
698710
[...state.rootComponents],
699711
projectType,
700712
state.HTMLTypes,
701-
state.tailwind
713+
state.tailwind,
714+
action.payload.contextParam
702715
);
703716
});
704717
return { ...state, components, projectType };
@@ -756,7 +769,8 @@ const appStateSlice = createSlice({
756769
rootComponents,
757770
state.projectType,
758771
state.HTMLTypes,
759-
state.tailwind
772+
state.tailwind,
773+
action.payload.contextParam
760774
);
761775
});
762776
return {
@@ -808,7 +822,8 @@ const appStateSlice = createSlice({
808822
[...state.rootComponents],
809823
state.projectType,
810824
state.HTMLTypes,
811-
state.tailwind
825+
state.tailwind,
826+
action.payload.contextParam
812827
);
813828
return { ...state, components, canvasFocus, nextTopSeparatorId };
814829
},
@@ -857,7 +872,8 @@ const appStateSlice = createSlice({
857872
state.rootComponents,
858873
state.projectType,
859874
state.HTMLTypes,
860-
state.tailwind
875+
state.tailwind,
876+
action.payload.contextParam
861877
);
862878
});
863879
return {
@@ -885,7 +901,8 @@ const appStateSlice = createSlice({
885901
state.rootComponents,
886902
state.projectType,
887903
state.HTMLTypes,
888-
state.tailwind
904+
state.tailwind,
905+
action.payload.contextParam
889906

890907
);
891908
});
@@ -910,7 +927,8 @@ const appStateSlice = createSlice({
910927
[...state.rootComponents],
911928
state.projectType,
912929
state.HTMLTypes,
913-
state.tailwind
930+
state.tailwind,
931+
action.payload.contextParam
914932
);
915933
return { ...state, components };
916934
},
@@ -962,7 +980,8 @@ const appStateSlice = createSlice({
962980
[...state.rootComponents],
963981
state.projectType,
964982
state.HTMLTypes,
965-
state.tailwind
983+
state.tailwind,
984+
action.payload.contextParam
966985
);
967986
//update code preview for parent component (since we have added it to the children array)
968987
parent.code = generateCode(
@@ -971,7 +990,8 @@ const appStateSlice = createSlice({
971990
[...state.rootComponents],
972991
state.projectType,
973992
state.HTMLTypes,
974-
state.tailwind
993+
state.tailwind,
994+
action.payload.contextParam
975995
);
976996

977997
return { ...state, components };
@@ -1025,7 +1045,8 @@ const appStateSlice = createSlice({
10251045
[...state.rootComponents],
10261046
state.projectType,
10271047
state.HTMLTypes,
1028-
state.tailwind
1048+
state.tailwind,
1049+
action.payload.contextParam
10291050
);
10301051
};
10311052
//delete from the components passedInProps array
@@ -1048,7 +1069,8 @@ const appStateSlice = createSlice({
10481069
[...state.rootComponents],
10491070
state.projectType,
10501071
state.HTMLTypes,
1051-
state.tailwind
1072+
state.tailwind,
1073+
action.payload.contextParam
10521074
);
10531075
return;
10541076
}
@@ -1070,7 +1092,8 @@ const appStateSlice = createSlice({
10701092
[...state.rootComponents],
10711093
state.projectType,
10721094
state.HTMLTypes,
1073-
state.tailwind
1095+
state.tailwind,
1096+
action.payload.contextParam
10741097
);
10751098
};
10761099

@@ -1083,7 +1106,8 @@ const appStateSlice = createSlice({
10831106
[...state.rootComponents],
10841107
state.projectType,
10851108
state.HTMLTypes,
1086-
state.tailwind
1109+
state.tailwind,
1110+
action.payload.contextParam
10871111
);
10881112
return { ...state, components };
10891113
},
@@ -1186,7 +1210,8 @@ const appStateSlice = createSlice({
11861210
[...state.rootComponents],
11871211
state.projectType,
11881212
state.HTMLTypes,
1189-
state.tailwind
1213+
state.tailwind,
1214+
action.payload.contextParam
11901215
);
11911216
}
11921217

@@ -1197,7 +1222,8 @@ const appStateSlice = createSlice({
11971222
[...state.rootComponents],
11981223
state.projectType,
11991224
state.HTMLTypes,
1200-
state.tailwind
1225+
state.tailwind,
1226+
action.payload.contextParam
12011227
);
12021228
});
12031229
return { ...state, components };

0 commit comments

Comments
 (0)