Skip to content

Commit e1a49c4

Browse files
added grid too shapes comp and lables to shapes lists
1 parent acda8fe commit e1a49c4

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

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

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ const StyledSearchIcon = styled(SearchIcon)`
7474
const IconListWrapper = styled.div`
7575
padding-left: 10px;
7676
padding-right: 4px;
77+
.gtujLP {
78+
overflow: hidden;
79+
}
80+
.iconsDiv div {
81+
float: left;
82+
}
7783
`;
7884
const IconList = styled(List)`
7985
scrollbar-gutter: stable;
@@ -278,14 +284,10 @@ function getIconKey(value?: string) {
278284
}
279285

280286
export function useShape(value?: string) {
281-
console.log("icon value ", value);
282287
const key = getIconKey(value);
283-
console.log("icon key ", key);
284-
285288
const [icon, setIcon] = useState<Icon | undefined>(undefined);
286289
useEffect(() => {
287290
let allshapes = getAllIcons();
288-
console.log("all shapes ", allshapes);
289291
setIcon(allshapes[key]);
290292
}, [key]);
291293
return icon;
@@ -379,28 +381,36 @@ const IconPopup = (props: {
379381
<StyledCloseIcon onClick={props.onClose} />
380382
</TitleDiv>
381383
{/* <SearchDiv>
382-
<TacoInput
384+
<TacoInput
383385
style={{ width: "100%", paddingLeft: "40px" }}
384386
value={searchText}
385387
onChange={(e) => setSearchText(e.target.value)}
386388
placeholder={trans("shapeSelect.searchPlaceholder")}
387389
/>
388390
<StyledSearchIcon />
389391
</SearchDiv> */}
390-
<IconListWrapper>
392+
<IconListWrapper style={{ display: "flex", flexWrap: "wrap" }}>
391393
<>
392394
{Object.keys(shapes).map((shapeType: string, _i: number) => {
393395
return shapes[shapeType as keyof typeof shapes].map(
394396
(Shape: any, index: any) => {
395397
return (
396-
<Shape
397-
size={48}
398+
<div
399+
style={{ paddingLeft: "10px" }}
398400
key={index}
399401
onClick={() => {
400-
console.log("Shape ", index, shapeType);
401402
onChangeIcon(index + "_" + shapeType);
402403
}}
403-
/>
404+
>
405+
<Shape
406+
size={24}
407+
key={index}
408+
onClick={() => {
409+
onChangeIcon(index + "_" + shapeType);
410+
}}
411+
/>
412+
<p>{shapeType}</p>
413+
</div>
404414
);
405415
}
406416
);

client/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7398,13 +7398,13 @@ __metadata:
73987398
languageName: node
73997399
linkType: hard
74007400

7401-
"coolshapes-react@npm:^0.1.1-beta.0":
7402-
version: 0.1.1-beta.0
7403-
resolution: "coolshapes-react@npm:0.1.1-beta.0"
7401+
"coolshapes-react@file:/Users/la/Desktop/coolshapes-react::locator=lowcoder%40workspace%3Apackages%2Flowcoder":
7402+
version: 1.0.1
7403+
resolution: "coolshapes-react@file:/Users/la/Desktop/coolshapes-react#/Users/la/Desktop/coolshapes-react::hash=163e05&locator=lowcoder%40workspace%3Apackages%2Flowcoder"
74047404
peerDependencies:
74057405
react: ">=16.8"
74067406
react-dom: ">=16.8"
7407-
checksum: c3edd7e43ef84f5c34faebc0d97316a2a4177c143d0eb23f9f62022a9fc19451a7d8f2af2730ae7852bba524bb08204ac22871fad2f85305072b048acbad7b78
7407+
checksum: 858b8476d410d3faae4cb26aab768d7a9d370befd51f54004540b84a08f27f5f11aa6ff4b76dca9f4dee82edfcd030d528819fabdbc82d2a6b0462b6f2d94ff3
74087408
languageName: node
74097409
linkType: hard
74107410

@@ -13659,7 +13659,7 @@ __metadata:
1365913659
buffer: ^6.0.3
1366013660
clsx: ^2.0.0
1366113661
cnchar: ^3.2.4
13662-
coolshapes-react: ^0.1.1-beta.0
13662+
coolshapes-react: /Users/la/Desktop/coolshapes-react
1366313663
copy-to-clipboard: ^3.3.3
1366413664
core-js: ^3.25.2
1366513665
dotenv: ^16.0.3

0 commit comments

Comments
 (0)