@@ -8,23 +8,20 @@ import { draggingUtils } from "layout";
8
8
import { isEmpty } from "lodash" ;
9
9
import { language } from "i18n" ;
10
10
import {
11
- ComListTitle ,
12
11
CompIconDiv ,
13
12
EmptyCompContent ,
14
13
RightPanelContentWrapper ,
15
14
} from "pages/editor/right/styledComponent" ;
16
15
import { tableDragClassName } from "pages/tutorials/tutorialsConstant" ;
17
16
import React , { useContext , useMemo } from "react" ;
18
17
import styled from "styled-components" ;
19
- import { labelCss } from "lowcoder-design" ;
18
+ import {
19
+ BaseSection ,
20
+ labelCss ,
21
+ } from "lowcoder-design" ;
20
22
import { TransparentImg } from "../../../util/commonUtils" ;
21
23
import { RightContext } from "./rightContext" ;
22
24
23
- const GrayLabel = ( props : { label : string } ) => {
24
- const { label } = props ;
25
- return < ComListTitle > { label } </ ComListTitle > ;
26
- } ;
27
-
28
25
const CompDiv = styled . div `
29
26
display: flex;
30
27
flex-direction: column;
@@ -80,12 +77,10 @@ const InsertContain = styled.div`
80
77
gap: 8px;
81
78
` ;
82
79
83
- const CategoryLabel = styled ( GrayLabel ) `
84
- margin: 0;
85
- ` ;
86
-
87
80
const SectionWrapper = styled . div `
88
- margin-bottom: 16px;
81
+ .section-header {
82
+ margin-left: 0;
83
+ }
89
84
` ;
90
85
91
86
export const UICompPanel = ( ) => {
@@ -122,26 +117,31 @@ export const UICompPanel = () => {
122
117
123
118
return (
124
119
< SectionWrapper key = { index } >
125
- < CategoryLabel label = { uiCompCategoryNames [ key as UICompCategory ] } />
126
- < InsertContain >
127
- { infos . map ( ( info ) => (
128
- < CompDiv key = { info [ 0 ] } className = { info [ 0 ] === "table" ? tableDragClassName : "" } >
129
- < HovDiv
130
- draggable
131
- onDragStart = { ( e ) => {
132
- e . dataTransfer . setData ( "compType" , info [ 0 ] ) ;
133
- e . dataTransfer . setDragImage ( TransparentImg , 0 , 0 ) ;
134
- draggingUtils . setData ( "compType" , info [ 0 ] ) ;
135
- onDrag ( info [ 0 ] ) ;
136
- } }
137
- >
138
- < IconContain Icon = { info [ 1 ] . icon } > </ IconContain >
139
- </ HovDiv >
140
- < CompNameLabel > { info [ 1 ] . name } </ CompNameLabel >
141
- { language !== "en" && < CompEnNameLabel > { info [ 1 ] . enName } </ CompEnNameLabel > }
142
- </ CompDiv >
143
- ) ) }
144
- </ InsertContain >
120
+ < BaseSection
121
+ noMargin
122
+ width = { 288 }
123
+ name = { uiCompCategoryNames [ key as UICompCategory ] }
124
+ >
125
+ < InsertContain >
126
+ { infos . map ( ( info ) => (
127
+ < CompDiv key = { info [ 0 ] } className = { info [ 0 ] === "table" ? tableDragClassName : "" } >
128
+ < HovDiv
129
+ draggable
130
+ onDragStart = { ( e ) => {
131
+ e . dataTransfer . setData ( "compType" , info [ 0 ] ) ;
132
+ e . dataTransfer . setDragImage ( TransparentImg , 0 , 0 ) ;
133
+ draggingUtils . setData ( "compType" , info [ 0 ] ) ;
134
+ onDrag ( info [ 0 ] ) ;
135
+ } }
136
+ >
137
+ < IconContain Icon = { info [ 1 ] . icon } > </ IconContain >
138
+ </ HovDiv >
139
+ < CompNameLabel > { info [ 1 ] . name } </ CompNameLabel >
140
+ { language !== "en" && < CompEnNameLabel > { info [ 1 ] . enName } </ CompEnNameLabel > }
141
+ </ CompDiv >
142
+ ) ) }
143
+ </ InsertContain >
144
+ </ BaseSection >
145
145
</ SectionWrapper >
146
146
) ;
147
147
} )
0 commit comments