Skip to content

Commit 57dc62c

Browse files
authored
Merge pull request #11001 from ethereum/icon-story-grid
Display icons in a grid
2 parents 69b754e + 9c4ebab commit 57dc62c

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/components/icons/Icons.stories.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { Box, Center, StackDivider, VStack } from "@chakra-ui/react"
1+
import {
2+
Box,
3+
Center,
4+
Flex,
5+
SimpleGrid,
6+
StackDivider,
7+
VStack,
8+
} from "@chakra-ui/react"
29
import { Meta, StoryObj } from "@storybook/react"
310
import * as React from "react"
411
import { EthHomeIcon } from "./EthHomeIcon"
@@ -180,30 +187,24 @@ iconsDefinitions.sort((a, b) =>
180187
(a?.displayName || "") > (b?.displayName || "") ? 1 : -1
181188
)
182189
const items = iconsDefinitions.map((IconDef) => (
183-
<Box
190+
<Flex
184191
key={IconDef.displayName}
192+
direction="column"
193+
gap={4}
194+
p={4}
185195
border="1px"
186196
borderStyle="solid"
187-
borderColor="border"
188-
p={1}
197+
borderColor="background.highlight"
189198
>
190199
<Center>
191-
<IconDef />
200+
<IconDef w="50px" h="50px" />
192201
</Center>
193202
<Center>{IconDef.displayName}</Center>
194-
</Box>
203+
</Flex>
195204
))
196205

197206
export const Icons: StoryObj<typeof VStack> = {
198207
render: () => {
199-
return (
200-
<VStack
201-
divider={<StackDivider borderColor="gray.200" />}
202-
spacing={4}
203-
align="stretch"
204-
>
205-
{items}
206-
</VStack>
207-
)
208+
return <SimpleGrid columns={[2, 2, 3, 5]}>{items}</SimpleGrid>
208209
},
209210
}

0 commit comments

Comments
 (0)