Skip to content

Commit 405537d

Browse files
fixed iconButton comp
1 parent f381f79 commit 405537d

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

client/packages/lowcoder/src/comps/comps/meetingComp/videobuttonCompConstants.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1+
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl";
2+
import { ButtonStyle } from "@lowcoder-ee/comps/controls/styleControlConstants";
3+
import { migrateOldData } from "@lowcoder-ee/comps/generators/simpleGenerators";
4+
import { refMethods } from "@lowcoder-ee/comps/generators/withMethodExposing";
5+
import { blurMethod, clickMethod, focusWithOptions } from "@lowcoder-ee/comps/utils/methodUtils";
16
import { default as Button } from "antd/es/button";
2-
import {
3-
styleControl,
4-
ButtonStyleType,
5-
ButtonStyle,
6-
migrateOldData,
7-
refMethods,
8-
blurMethod,
9-
clickMethod,
10-
focusWithOptions,
11-
genActiveColor,
12-
genHoverColor,
13-
} from "lowcoder-sdk";
7+
import { genActiveColor, genHoverColor } from "components/colorSelect/colorUtils";
148
import styled, { css } from "styled-components";
159
// import { genActiveColor, genHoverColor } from "lowcoder-design";
1610

1711
export function getButtonStyle(buttonStyle: any) {
18-
const hoverColor = genHoverColor(buttonStyle.background);
19-
const activeColor = genActiveColor(buttonStyle.background);
12+
const hoverColor = buttonStyle.background && genHoverColor(buttonStyle.background);
13+
const activeColor = buttonStyle.background && genActiveColor(buttonStyle.background);
2014
return css`
2115
&&& {
2216
border-radius: ${buttonStyle.radius};

client/packages/lowcoder/src/pages/ComponentDoc/examples/ButtonComp/IconButton.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IconComp } from "comps/comps/iconComp";
1+
import { ControlButton } from "comps/comps/meetingComp/controlButton";
22
import { trans } from "i18n";
33
import Example from "../../common/Example";
44
import ExampleGroup from "../../common/ExampleGroup";
@@ -16,19 +16,19 @@ export default function IconButtonExample() {
1616
prefixIcon: "/icon:solid/align-justify",
1717
iconSize: "30px",
1818
}}
19-
compFactory={IconComp}
19+
compFactory={ControlButton}
2020
/>
2121
<Example
2222
title={trans("componentDoc.loading")}
2323
width={120}
2424
config={{ type: "default", text: trans("componentDoc.submit"), loading: true }}
25-
compFactory={IconComp}
25+
compFactory={ControlButton}
2626
/>
2727
<Example
2828
title={trans("componentDoc.disabled")}
2929
width={120}
3030
config={{ type: "default", text: trans("componentDoc.submit"), disabled: true }}
31-
compFactory={IconComp}
31+
compFactory={ControlButton}
3232
/>
3333
</ExampleGroup>
3434

@@ -39,23 +39,23 @@ export default function IconButtonExample() {
3939
config={{
4040
style: { backgroundColor: "#CD574C", borderColor: "#AC3A32", color: "#E0ECF6" },
4141
}}
42-
compFactory={IconComp}
42+
compFactory={ControlButton}
4343
/>
4444
<Example
4545
title={trans("componentDoc.warning")}
4646
width={120}
4747
config={{
4848
style: { backgroundColor: "#F4A125", borderColor: "#DA7D16", color: "#000000" },
4949
}}
50-
compFactory={IconComp}
50+
compFactory={ControlButton}
5151
/>
5252
<Example
5353
title={trans("componentDoc.success")}
5454
width={120}
5555
config={{
5656
style: { backgroundColor: "#5E8D6E", borderColor: "#40694E", color: "#E0ECF6" },
5757
}}
58-
compFactory={IconComp}
58+
compFactory={ControlButton}
5959
/>
6060
</ExampleGroup>
6161
</>

0 commit comments

Comments
 (0)