Skip to content

Commit 397aa02

Browse files
committed
fixes comma issue in classname and remove extra usesSelectors
1 parent 1dec398 commit 397aa02

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

app/src/components/StateManagement/StateManagement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useSelector } from 'react-redux';
1010

1111
import CreateContainer from './CreateTab/CreateContainer';
1212
import DisplayContainer from './DisplayTab/DisplayContainer';
13-
import { useSelector } from 'react-redux'
13+
1414

1515

1616
const useStyles = makeStyles({

app/src/components/main/Canvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import StateContext from '../../context/context';
55
import { Component, DragItem } from '../../interfaces/Interfaces';
66
import { combineStyles } from '../../helperFunctions/combineStyles';
77
import renderChildren from '../../helperFunctions/renderChildren';
8-
import { useSelector } from 'react-redux'
8+
99
// Caret start
1010
import Arrow from './Arrow';
1111
import { getRowsStateFromCache } from '@mui/x-data-grid/hooks/features/rows/gridRowsUtils';

app/src/helperFunctions/generateCode.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -158,45 +158,45 @@ const generateUnformattedCode = (
158158
let { height, alignItems, backgroundColor, display, flexDirection, width, justifyContent } = childElement.style;
159159
let w, h, items, bg, d, flexDir, justCon, cssClasses;
160160
if (childElement.style.alignItems) {
161-
if (alignItems === "center") items = "items-center, ";
162-
else if (alignItems === "flex-start") items = "items-start, ";
163-
else if (alignItems === "flex-end") items = "items-end, ";
164-
else if (alignItems === "stretch") items = "items-stretch, ";
161+
if (alignItems === "center") items = "items-center ";
162+
else if (alignItems === "flex-start") items = "items-start ";
163+
else if (alignItems === "flex-end") items = "items-end ";
164+
else if (alignItems === "stretch") items = "items-stretch ";
165165
}
166166
if (childElement.style.backgroundColor) {
167-
bg = `bg-[${backgroundColor}], `
167+
bg = `bg-[${backgroundColor}] `
168168
}
169169
if (childElement.style.display) {
170-
if (display === "flex") d = "flex, "
171-
else if (display === "inline-block") d = "inline-block, "
172-
else if (display === "block") d = "block, "
173-
else if (display === "none") d = "hidden, "
170+
if (display === "flex") d = "flex "
171+
else if (display === "inline-block") d = "inline-block "
172+
else if (display === "block") d = "block "
173+
else if (display === "none") d = "hidden "
174174
}
175175
if (childElement.style.flexDirection) {
176-
if (flexDirection === "column") flexDir = "flex-col, "
176+
if (flexDirection === "column") flexDir = "flex-col "
177177
}
178178
if (childElement.style.height) {
179-
if (height === "100%") h = "h-full, "
180-
else if (height === "50%") h = "h-1/2, "
181-
else if (height === "25%") h = "h-1/4, "
182-
else if (height === "auto") h = "auto, "
179+
if (height === "100%") h = "h-full "
180+
else if (height === "50%") h = "h-1/2 "
181+
else if (height === "25%") h = "h-1/4 "
182+
else if (height === "auto") h = "auto "
183183
}
184184
if (childElement.style.justifyContent) {
185-
if (justifyContent === "center") justCon = "justify-center, "
186-
else if (justifyContent === "flex-start") justCon = "justify-start, "
187-
else if (justifyContent === "space-between") justCon = "justify-between, "
188-
else if (justifyContent === "space-around") justCon = "justify-around, "
189-
else if (justifyContent === "flex-end") justCon = "justify-end, "
190-
else if (justifyContent === "space-evenly") justCon = "justify-evenly, "
185+
if (justifyContent === "center") justCon = "justify-center "
186+
else if (justifyContent === "flex-start") justCon = "justify-start "
187+
else if (justifyContent === "space-between") justCon = "justify-between "
188+
else if (justifyContent === "space-around") justCon = "justify-around "
189+
else if (justifyContent === "flex-end") justCon = "justify-end "
190+
else if (justifyContent === "space-evenly") justCon = "justify-evenly "
191191
}
192192
if (childElement.style.width) {
193-
if (width === "100%") w = "w-full, "
194-
else if (width === "50%") w = "w-1/2, "
195-
else if (width === "25%") w = "w-1/4, "
196-
else if (width === "auto") w = "w-auto, "
193+
if (width === "100%") w = "w-full "
194+
else if (width === "50%") w = "w-1/2 "
195+
else if (width === "25%") w = "w-1/4 "
196+
else if (width === "auto") w = "w-auto "
197197
}
198198
if (childElement.attributes && childElement.attributes.cssClasses) {
199-
cssClasses = `${childElement.attributes.cssClasses}, `
199+
cssClasses = `${childElement.attributes.cssClasses} `
200200
}
201201
customizationDetails += ' ' + `className = "${cssClasses ? cssClasses : ''} ${w ? w : ''}${h ? h : ''}${justCon ? justCon : ''}${flexDir ? flexDir : ''}${d ? d : ''}${bg ? bg : ''}${items ? items : ''}"`;
202202
}

0 commit comments

Comments
 (0)