Skip to content

Commit 203948e

Browse files
MadinventorZerojonocrbuddhajjigaexkevinparkwilliamdyoon
committed
Added Caret Comments
Co-authored-by: jonocr <[email protected]> Co-authored-by: buddhajjigae <[email protected]> Co-authored-by: xkevinpark <[email protected]> Co-authored-by: williamdyoon <[email protected]>
1 parent ef34850 commit 203948e

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

app/src/components/main/DemoRender.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// 100% Caret
12
import React, {
23
useState, useCallback, useContext, useEffect,
34
} from 'react';

app/src/containers/MainContainer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import DemoRender from '../components/main/DemoRender';
99

1010
const MainContainer = () => {
1111
const { style } = useContext(styleContext);
12+
// Caret Start
1213
const [state, dispatch] = useContext(StateContext);
1314
const componentsToRender = [];
1415
useEffect(() => {
@@ -31,11 +32,13 @@ const MainContainer = () => {
3132
}
3233
}
3334
}, [state.components]);
35+
// Caret End
3436

3537
return (
3638
<div className="main-container" style={style} >
3739
<div className="main">
3840
<CanvasContainer />
41+
{/* Caret Component Render */}
3942
{console.log('Completed Components to Render', componentsToRender)}
4043
<DemoRender demo={componentsToRender}/>
4144
</div>

app/src/containers/RightContainer.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
3838
const [flexJustify, setFlexJustify] = useState('');
3939
const [flexAlign, setFlexAlign] = useState('');
4040
const [BGColor, setBGColor] = useState('');
41+
// Caret
4142
const [compText, setCompText] = useState('');
4243
const [compWidth, setCompWidth] = useState('');
4344
const [compHeight, setCompHeight] = useState('');
@@ -48,6 +49,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
4849
const [modal, setModal] = useState(null);
4950

5051
const resetFields = () => {
52+
// Caret Start
5153
const childrenArray = state.components[0].children;
5254
let attributes;
5355
for (const element of childrenArray) {
@@ -57,6 +59,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
5759
}
5860
}
5961
console.log('Attributes: ', configTarget.child);
62+
// Caret End
6063
const style = configTarget.child
6164
? configTarget.child.style
6265
: configTarget.style;
@@ -101,7 +104,8 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
101104
case 'bgcolor':
102105
setBGColor(inputVal);
103106
break;
104-
case 'compText':
107+
// Caret
108+
case 'compText':
105109
setCompText(inputVal);
106110
break;
107111
}
@@ -202,6 +206,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
202206
if (compHeight !== '') styleObj.height = compHeight;
203207
if (BGColor !== '') styleObj.backgroundColor = BGColor;
204208

209+
// Caret
205210
const attributesObj: any = {};
206211
if (compText !== '') attributesObj.compText = compText;
207212

@@ -210,6 +215,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
210215
payload: { style: styleObj },
211216
});
212217

218+
// Caret
213219
dispatch({
214220
type: 'UPDATE ATTRIBUTES',
215221
payload: { attributes: attributesObj },
@@ -517,6 +523,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
517523
</FormControl>
518524
</div>
519525
</div>
526+
{/* Caret Start */}
520527
<div className={classes.configRow}>
521528
<div className={isThemeLight ? `${classes.configType} ${classes.lightThemeFontColor}` : `${classes.configType} ${classes.darkThemeFontColor}`}>
522529
<h3>Text:</h3>
@@ -535,6 +542,7 @@ const RightContainer = ({ isThemeLight }): JSX.Element => {
535542
</FormControl>
536543
</div>
537544
</div>
545+
{/* Caret End */}
538546
<div className={classes.buttonRow}>
539547
<Button
540548
color="primary"

app/src/interfaces/Interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface Component {
2828
id: number;
2929
name: string;
3030
style: object;
31+
// Caret
3132
attributes?: object;
3233
code: string;
3334
children: ChildElement[];

app/src/reducers/componentReducer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ const reducer = (state: State, action: Action) => {
207207
name: action.payload.componentName,
208208
nextChildId: 1,
209209
style: {},
210+
// Caret
210211
attributes: {},
211212
code: '',
212213
children: [],
@@ -289,6 +290,7 @@ const reducer = (state: State, action: Action) => {
289290
name: newName,
290291
childId: state.nextChildId,
291292
style: {},
293+
// Caret
292294
attributes: {},
293295
children: componentChildren,
294296

@@ -299,6 +301,7 @@ const reducer = (state: State, action: Action) => {
299301
name: 'separator',
300302
childId: state.nextTopSeparatorId,
301303
style: separator.style,
304+
// Caret
302305
attributes: {},
303306
children: []
304307
};
@@ -428,6 +431,7 @@ const reducer = (state: State, action: Action) => {
428431

429432
return { ...state, components };
430433
}
434+
// Caret
431435
case 'UPDATE ATTRIBUTES': {
432436
const { attributes } = action.payload;
433437
const components = [...state.components];

0 commit comments

Comments
 (0)