Skip to content

Commit fee40ab

Browse files
committed
adds further functionality to the tailwind code generator
1 parent 63c49c2 commit fee40ab

File tree

3 files changed

+134
-136
lines changed

3 files changed

+134
-136
lines changed

app/src/containers/AppContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const AppContainer = (props) => {
5353

5454
return (
5555
<StyledEngineProvider injectFirst>
56-
// Mui theme provider provides themed styling to all MUI components in app
5756
<ThemeProvider theme={isThemeLight ? lightTheme : darkTheme}>
5857
<styleContext.Provider value={{ style, setStyle, isThemeLight }}>
5958
<div>

app/src/containers/CustomizationPanel.tsx

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,10 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
305305
payload: { event: selectedEvent }
306306
});
307307
};
308-
const handleTailwind = (): Object => {
308+
309+
310+
const handleSave = (): Object => {
309311
console.log('stateusedobj',stateUsedObj)
310-
dispatch({ type: 'CHANGE TAILWIND', payload: true });
311312
dispatch({
312313
type: 'UPDATE STATE USED',
313314
payload: {stateUsedObj: stateUsedObj}
@@ -347,55 +348,60 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
347348
type: 'UPDATE EVENTS',
348349
payload: { events: eventsObj }
349350
});
350-
351351
return styleObj;
352+
};
353+
const handleTailwind = (): Object => {
354+
console.log('stateusedobj',stateUsedObj)
355+
dispatch({ type: 'CHANGE TAILWIND', payload: true });
352356

353357

354-
}
358+
handleSave()
359+
360+
// dispatch({
361+
// type: 'UPDATE STATE USED',
362+
// payload: {stateUsedObj: stateUsedObj}
363+
// })
355364

356-
const handleSave = (): Object => {
357-
console.log('stateusedobj',stateUsedObj)
358-
dispatch({
359-
type: 'UPDATE STATE USED',
360-
payload: {stateUsedObj: stateUsedObj}
361-
})
362365

366+
// dispatch({
367+
// type: 'UPDATE USE CONTEXT',
368+
// payload: { useContextObj: useContextObj}
369+
// })
363370

364-
dispatch({
365-
type: 'UPDATE USE CONTEXT',
366-
payload: { useContextObj: useContextObj}
367-
})
371+
// const styleObj: any = {};
372+
// if (displayMode !== '') styleObj.display = displayMode;
373+
// if (flexDir !== '') styleObj.flexDirection = flexDir;
374+
// if (flexJustify !== '') styleObj.justifyContent = flexJustify;
375+
// if (flexAlign !== '') styleObj.alignItems = flexAlign;
376+
// if (compWidth !== '') styleObj.width = compWidth;
377+
// if (compHeight !== '') styleObj.height = compHeight;
378+
// if (BGColor !== '') styleObj.backgroundColor = BGColor;
379+
// dispatch({
380+
// type: 'UPDATE CSS',
381+
// payload: { style: styleObj }
382+
// });
368383

369-
const styleObj: any = {};
370-
if (displayMode !== '') styleObj.display = displayMode;
371-
if (flexDir !== '') styleObj.flexDirection = flexDir;
372-
if (flexJustify !== '') styleObj.justifyContent = flexJustify;
373-
if (flexAlign !== '') styleObj.alignItems = flexAlign;
374-
if (compWidth !== '') styleObj.width = compWidth;
375-
if (compHeight !== '') styleObj.height = compHeight;
376-
if (BGColor !== '') styleObj.backgroundColor = BGColor;
377-
dispatch({
378-
type: 'UPDATE CSS',
379-
payload: { style: styleObj }
380-
});
384+
// const attributesObj: any = {};
385+
// if (compText !== '') attributesObj.compText = compText;
386+
// if (compLink !== '') attributesObj.compLink = compLink;
387+
// if (cssClasses !== '') attributesObj.cssClasses = cssClasses;
388+
// dispatch({
389+
// type: 'UPDATE ATTRIBUTES',
390+
// payload: { attributes: attributesObj }
391+
// });
381392

382-
const attributesObj: any = {};
383-
if (compText !== '') attributesObj.compText = compText;
384-
if (compLink !== '') attributesObj.compLink = compLink;
385-
if (cssClasses !== '') attributesObj.cssClasses = cssClasses;
386-
dispatch({
387-
type: 'UPDATE ATTRIBUTES',
388-
payload: { attributes: attributesObj }
389-
});
393+
// const eventsObj: any = {};
394+
// if (eventAll[0] !== '') eventsObj[eventAll[0]] = eventAll[1];
395+
// dispatch({
396+
// type: 'UPDATE EVENTS',
397+
// payload: { events: eventsObj }
398+
// });
399+
400+
// return styleObj;
401+
402+
403+
}
390404

391-
const eventsObj: any = {};
392-
if (eventAll[0] !== '') eventsObj[eventAll[0]] = eventAll[1];
393-
dispatch({
394-
type: 'UPDATE EVENTS',
395-
payload: { events: eventsObj }
396-
});
397-
return styleObj;
398-
};
399405
// UNDO/REDO functionality--onClick these functions will be invoked.
400406
const handleUndo = () => {
401407
dispatch({ type: 'UNDO', payload: {} });

0 commit comments

Comments
 (0)