Skip to content

Commit 99ce13d

Browse files
committed
[Feat]: #1289 add close icon customization
1 parent 0e5aa97 commit 99ce13d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import styled from "styled-components";
2424
import { useUserViewMode } from "util/hooks";
2525
import { isNumeric } from "util/stringUtils";
2626
import { NameConfig, withExposingConfigs } from "../generators/withExposing";
27+
import { IconControl } from "comps/controls/iconControl";
28+
import { hasIcon } from "comps/utils";
2729
import { title } from "process";
2830
import { SliderControl } from "../controls/sliderControl";
2931
import clsx from "clsx";
@@ -122,6 +124,7 @@ const childrenMap = {
122124
showMask: withDefault(BoolControl, true),
123125
toggleClose:withDefault(BoolControl,true),
124126
escapeClosable: withDefault(BoolControl, true),
127+
closeIcon: withDefault(IconControl, ""),
125128
};
126129

127130
type ChildrenType = NewChildren<RecordConstructorToComp<typeof childrenMap>> & {
@@ -138,6 +141,9 @@ const DrawerPropertyView = React.memo((props: {
138141
{props.children.title.getView() && props.children.titleAlign.propertyView({ label: trans("drawer.titleAlign"), radioButton: true })}
139142
{props.children.closePosition.propertyView({ label: trans("drawer.closePosition"), radioButton: true })}
140143
{props.children.placement.propertyView({ label: trans("drawer.placement"), radioButton: true })}
144+
{props.children.toggleClose.getView() && props.children.closeIcon.propertyView({
145+
label: trans("drawer.closeIcon"),
146+
})}
141147
{["top", "bottom"].includes(props.children.placement.getView())
142148
? props.children.autoHeight.getPropertyView()
143149
: props.children.width.propertyView({
@@ -262,7 +268,7 @@ const DrawerView = React.memo((
262268
$closePosition={props.closePosition}
263269
onClick={onClose}
264270
>
265-
<CloseOutlined />
271+
{hasIcon(props.closeIcon) ? props.closeIcon : <CloseOutlined />}
266272
</ButtonStyle>
267273
)}
268274
<InnerGrid

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,9 @@ export const en = {
23632363
"openDrawerDesc": "Open Drawer",
23642364
"closeDrawerDesc": "Close Drawer",
23652365
"width": "Drawer Width",
2366-
"height": "Drawer Height"
2366+
"height": "Drawer Height",
2367+
"closeIcon": "Close Icon",
2368+
23672369
},
23682370
"meeting": {
23692371
"logLevel": "Agora SDK Log Level",

0 commit comments

Comments
 (0)