From 421227adc2bda2620ccfb11ed40fd41061af89ea Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Thu, 20 Oct 2022 18:26:01 +0530 Subject: [PATCH] Revert "Fixed a Glitch" This reverts commit f6df56bca8bbaae994e0154e47df21b6cd2d37b8. --- .../Drawer/DrawerPanel/DesignColors.js | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/OnboardingSPA/components/Drawer/DrawerPanel/DesignColors.js b/src/OnboardingSPA/components/Drawer/DrawerPanel/DesignColors.js index 6143606c9..cbe82800e 100644 --- a/src/OnboardingSPA/components/Drawer/DrawerPanel/DesignColors.js +++ b/src/OnboardingSPA/components/Drawer/DrawerPanel/DesignColors.js @@ -147,16 +147,10 @@ const DesignColors = () => { } } - const colorPalettesMemo = React.useMemo( () => { - return getThemeColors().then((res) => { - setColorPalettes(res?.body); - return res?.body - }); - }, []); - const getColorStylesAndPatterns = async () => { + const colorPalettes = await getThemeColors(); const globalStyles = await getGlobalStyles(); - + setColorPalettes(colorPalettes?.body); let selectedGlobalStyle; if (currentData?.data?.theme?.variation) { selectedGlobalStyle = globalStyles.body.filter( @@ -224,29 +218,19 @@ const DesignColors = () => { setColorPickerCalledBy(''); } - async function getColorData() { - await colorPalettesMemo.then((res) => { - return res; - }); - } - function buildPalettes () { - let colorPalettesCopy = colorPalettes let paletteRenderedList = []; - for (const colorStyle in colorPalettesCopy) { - if (!colorPalettesCopy[colorStyle]?.tertiary) { - colorPalettesCopy = getColorData(); - } + for (const colorStyle in colorPalettes) { paletteRenderedList.push( -
handleClick(colorStyle)}>
+ style={{ backgroundColor: `${colorPalettes[colorStyle].tertiary}` }}/>
+ style={{ backgroundColor: `${colorPalettes[colorStyle].secondary}` }}/>
+ style={{ backgroundColor: `${colorPalettes[colorStyle].primary}` }} />
{colorStyle?.charAt(0).toUpperCase() + colorStyle?.slice(1) }