Skip to content

Commit

Permalink
refactor(core): 🚑 linting issue
Browse files Browse the repository at this point in the history
linting issue resolved

ref: #31
  • Loading branch information
Edithmark42 committed Mar 9, 2024
1 parent 3aa4ce5 commit 2d212ac
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 38 deletions.
2 changes: 1 addition & 1 deletion app/components.registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import CreateTheme from "./components/ThemeViewer/CreateTheme";
export const ComponentsRegistry = {
BusinessEntityComp : { comp: BusinessEntityComp },
BusinessEntityManager : { comp: BusinessEntityManager },
CreateTheme : { comp: CreateTheme },
DataCreator : { comp: DataCreator },
DataViewer : { comp: DataViewer },
FormBuilder : { comp: FormBuilder },
Expand All @@ -25,5 +26,4 @@ export const ComponentsRegistry = {
RoutesManager : { comp: RoutesManager },
StatusChangeCommentHistory: { comp: StatusChangeCommentHistory },
StatusChangeForm : { comp: StatusChangeForm },
CreateTheme : {comp: CreateTheme},
};
5 changes: 2 additions & 3 deletions app/components/ThemeViewer/CreateTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import {
CoreH2,
BlankLayout,
CoreLayoutItem,
CoreBox,
CoreClasses,
CoreBox
} from "@wrappid/core";

import JsonEditor from "./JsonEditor";
import ThemesViewer from "./ThemesViewer";
function CreateTheme() {
const [currentState, setCurrentState] = React.useState("Presets");
Expand All @@ -25,6 +23,7 @@ function CreateTheme() {
id={BlankLayout.PLACEHOLDER.CONTENT}
>
<CoreH3>THEME VIEWER</CoreH3>

<CoreBox>
<CoreBox>
<CoreBox>
Expand Down
35 changes: 9 additions & 26 deletions app/components/ThemeViewer/ThemesViewer.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
import React from "react";
import { useDispatch } from "react-redux";

import {
CoreH1,
CoreBox,
setUserTheme,
CoreButton,
CoreGrid,
CoreClasses,
CoreTypographyBody1,
CoreThemeProvider,
CoreBox, setUserTheme, CoreButton, CoreGrid, CoreClasses, CoreTypographyBody1, CoreThemeProvider
} from "@wrappid/core";

// eslint-disable-next-line import/no-unresolved
import {
UPDATE_DEFAULT_THEME,
WrappidDataContext,
WrappidDispatchContext,
StylesProvider,
} from "@wrappid/styles";
import { WrappidDataContext, StylesProvider } from "@wrappid/styles";
import { useDispatch } from "react-redux";

function ThemesViewer() {
const storeDispatch = useDispatch();
Expand All @@ -32,23 +19,18 @@ function ThemesViewer() {
return (
<CoreGrid>
{Object.keys(themes).map((themeName, index) => {

return (
<CoreBox gridProps={{ gridSize: 3 }}>
<CoreBox key={index} gridProps={{ gridSize: 3 }}>
<CoreThemeProvider themeID={themeName}>
<StylesProvider themeID={themeName}>

<CoreGrid
styleClasses={[
CoreClasses.HEIGHT.VH_25,
CoreClasses.BORDER.BORDER,
CoreClasses.BORDER.BORDER_SUCCESS,
CoreClasses.DISPLAY.FLEX,
]}
styleClasses={[CoreClasses.HEIGHT.VH_25, CoreClasses.BORDER.BORDER, CoreClasses.BORDER.BORDER_SUCCESS, CoreClasses.DISPLAY.FLEX]}
>
{/* First Segment for PrimaryColor */}
<CoreBox
gridProps={{
gridSize: { xs: 6 },
gridSize : { xs: 6 },
styleClasses: [CoreClasses.BG.BG_PRIMARY],
}}
>
Expand All @@ -58,7 +40,7 @@ function ThemesViewer() {
{/* Second Segment for SecondaryColor */}
<CoreBox
gridProps={{
gridSize: { xs: 6 },
gridSize : { xs: 6 },
styleClasses: [CoreClasses.BG.BG_SECONDARY],
}}
>
Expand All @@ -72,6 +54,7 @@ function ThemesViewer() {
justifyContent="center"
>
<CoreTypographyBody1>test</CoreTypographyBody1>

<CoreButton
key={index}
OnClick={() => handleChangeTheme(themeName)}
Expand Down
16 changes: 8 additions & 8 deletions app/routes.registry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
export const RoutesRegistry = {
createTheme: {
BUSINESS_ENTITY : "business_entity",
FORMS : "forms",
HISTORY : "history/:model/:entityRef",
PAGE : "pages",
ROUTES : "routes",
STATUS_CHANGE_FORM: "status/:model/:id/:status",
TABLES : "tables",
createTheme : {
Page : { appComponent: "CreateTheme", layout: "BlankLayout" },
authRequired: false,
entityRef : "components",
Expand All @@ -11,11 +18,4 @@ export const RoutesRegistry = {
entityRef : "components",
url : "themes"
},
BUSINESS_ENTITY : "business_entity",
FORMS : "forms",
HISTORY : "history/:model/:entityRef",
PAGE : "pages",
ROUTES : "routes",
STATUS_CHANGE_FORM: "status/:model/:id/:status",
TABLES : "tables",
};

0 comments on commit 2d212ac

Please sign in to comment.