Skip to content

Commit 34d90cf

Browse files
Theme: moved defaultTheme to separate constant file
1 parent 66046ec commit 34d90cf

File tree

7 files changed

+54
-29
lines changed

7 files changed

+54
-29
lines changed

client/packages/lowcoder-design/src/components/colorSelect/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const ColorSelect = (props: ColorSelectProps) => {
2929
dispatch && dispatch(changeValueAction(toHex(rgbaColor), true));
3030
changeColor && changeColor(toHex(rgbaColor));
3131
}, 200),
32-
[dispatch]
32+
[dispatch,changeColor]
3333
);
3434
return (
3535
<Popover

client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import { ExternalEditorContext } from "util/context/ExternalEditorContext";
6060
import { selectCompModifierKeyPressed } from "util/keyUtils";
6161
import { defaultLayout, GridItemComp, GridItemDataType } from "../gridItemComp";
6262
import { ThemeContext } from "comps/utils/themeContext";
63-
import { defaultTheme } from "comps/controls/styleControlConstants";
63+
import { defaultTheme } from "@lowcoder-ee/constants/themeConstants";
6464

6565
const childrenMap = {
6666
layout: valueComp<Layout>({}),

client/packages/lowcoder/src/comps/comps/containerComp/flowContainerView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { CompSelectionWrapper } from "layout/compSelectionWrapper";
66
import { useContext } from "react";
77
import { EditorContext } from "comps/editorState";
88
import { ThemeContext } from "comps/utils/themeContext";
9-
import { defaultTheme } from "comps/controls/styleControlConstants";
109
import styled from "styled-components";
10+
import { defaultTheme } from "@lowcoder-ee/constants/themeConstants";
1111

1212
const FlowContainerWrapper = styled.div<{ $bgColor: string; $maxWidth?: number; $minHeight: string }>`
1313
background-color: ${(props) => props.$bgColor};

client/packages/lowcoder/src/comps/comps/gridLayoutComp/canvasView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import { ExternalEditorContext } from "util/context/ExternalEditorContext";
1515
import { AppTypeEnum } from "constants/applicationConstants";
1616
import { EditorContainerPadding, TopHeaderHeight } from "constants/style";
1717
import { ThemeContext } from "comps/utils/themeContext";
18-
import { defaultTheme } from "comps/controls/styleControlConstants";
1918
import { checkIsMobile } from "util/commonUtils";
2019
import { CanvasContainerID } from "constants/domLocators";
2120
import { CNRootContainer } from "constants/styleSelectors";
2221
import { ScrollBar } from "lowcoder-design";
22+
import { defaultTheme } from "@lowcoder-ee/constants/themeConstants";
2323

2424
// min-height: 100vh;
2525

client/packages/lowcoder/src/comps/comps/moduleContainerComp/moduleContainerComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { defaultTheme } from "comps/controls/styleControlConstants";
21
import { ThemeContext } from "comps/utils/themeContext";
32
import { BorderColor } from "constants/style";
43
import { HintPlaceHolder } from "lowcoder-design";
@@ -13,6 +12,7 @@ import {
1312
gridItemCompToGridItems,
1413
InnerGrid,
1514
} from "../containerComp/containerView";
15+
import { defaultTheme } from "@lowcoder-ee/constants/themeConstants";
1616

1717
const StyledInnerGrid = styled(InnerGrid)<ContainerBaseProps & { $bordered: boolean }>`
1818
border: ${(props) => (!props.$bordered ? "0px" : `1px solid ${BorderColor}`)};

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {ThemeDetail} from "api/commonSettingApi";
22
import {darkenColor, isDarkColor, lightenColor, toHex} from "lowcoder-design";
33
import {trans} from "i18n";
44
import {StyleConfigType} from "./styleControl";
5+
import { defaultTheme } from "@lowcoder-ee/constants/themeConstants";
56

67
type SupportPlatform = "pc" | "mobile";
78

@@ -225,30 +226,6 @@ export type SingleColorConfig =
225226
| BoxShadowColorConfig
226227
| AnimationIterationCountConfig;
227228

228-
export const defaultTheme: ThemeDetail = {
229-
primary: "#3377FF",
230-
textDark: "#222222",
231-
textLight: "#FFFFFF",
232-
canvas: "#F5F5F6",
233-
primarySurface: "#FFFFFF",
234-
borderColor: "#D7D9E0",
235-
borderRadius: "4px",
236-
borderWidth: "1px",
237-
borderStyle: "solid",
238-
margin: "3px",
239-
padding: "3px",
240-
gridColumns: "24",
241-
textSize: "14px",
242-
animation: "",
243-
animationDelay: "",
244-
animationDuration: "",
245-
opacity: "1",
246-
boxShadow: "",
247-
boxShadowColor: "",
248-
animationIterationCount: "",
249-
components: {},
250-
};
251-
252229
export const SURFACE_COLOR = "#FFFFFF";
253230
const SECOND_SURFACE_COLOR = "#D7D9E0";
254231
const ERROR_COLOR = "#F5222D";
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { ThemeDetail } from "@lowcoder-ee/api/commonSettingApi";
2+
3+
const text = {
4+
style: {
5+
borderWidth: 0,
6+
}
7+
};
8+
9+
const input = {
10+
style: {
11+
borderWidth: '0px',
12+
background: 'transparent',
13+
},
14+
labelStyle: {
15+
borderWidth: '0px',
16+
},
17+
inputFieldStyle: {
18+
borderWidth: '1px',
19+
border: '#D7D9E0'
20+
}
21+
};
22+
23+
export const defaultTheme: ThemeDetail = {
24+
primary: "#3377FF",
25+
textDark: "#222222",
26+
textLight: "#FFFFFF",
27+
canvas: "#F5F5F6",
28+
primarySurface: "#FFFFFF",
29+
border: "#D7D9E0",
30+
radius: "4px",
31+
borderWidth: "1px",
32+
borderStyle: "solid",
33+
margin: "3px",
34+
padding: "3px",
35+
gridColumns: "24",
36+
textSize: "14px",
37+
animation: "",
38+
animationDelay: "",
39+
animationDuration: "",
40+
opacity: "1",
41+
boxShadow: "",
42+
boxShadowColor: "",
43+
animationIterationCount: "",
44+
components: {
45+
text,
46+
input,
47+
},
48+
};

0 commit comments

Comments
 (0)