1
- import {
2
- Box ,
3
- Flex ,
4
- List ,
5
- ListItem ,
6
- useColorModeValue ,
7
- VisuallyHidden ,
8
- } from "@chakra-ui/react"
1
+ import type { ImageProps } from "next/image"
2
+ import { VisuallyHidden } from "@radix-ui/react-visually-hidden"
9
3
10
- import { ButtonLink } from "@/components/Buttons"
11
- import { Image , type ImageProps } from "@/components/Image"
12
- import OldHeading from "@/components/OldHeading"
4
+ import { ButtonLink } from "./ui/buttons/Button"
5
+ import { Flex } from "./ui/flex"
6
+ import { List , ListItem } from "./ui/list"
7
+ import { TwImage } from "./Image"
13
8
14
9
type Content = {
15
10
title : string
@@ -27,85 +22,49 @@ export type ProductListProps = {
27
22
}
28
23
29
24
const ProductList = ( { actionLabel, content, category } : ProductListProps ) => {
30
- const shadow = useColorModeValue ( "tableBox.light" , "tableBox.dark" )
31
-
32
25
const CATEGORY_NAME = "category-name"
33
26
34
27
return (
35
- < Box boxSize = "full" >
36
- < OldHeading
37
- as = "h3"
28
+ < div className = "w-full" >
29
+ < h3
38
30
id = { CATEGORY_NAME }
39
- fontSize = "2xl"
40
- borderBottom = "2px solid"
41
- borderColor = "border"
42
- paddingBottom = { 4 }
43
- marginBottom = { 0 }
31
+ className = "mb-0 mt-10 border-b-2 border-border pb-4 text-2xl"
44
32
>
45
33
{ category }
46
- </ OldHeading >
47
- < Flex
48
- as = { List }
49
- aria-labelledby = { CATEGORY_NAME }
50
- m = { 0 }
51
- flexDirection = "column"
52
- height = "inherit"
53
- >
34
+ </ h3 >
35
+ < List aria-labelledby = { CATEGORY_NAME } className = "m-0" >
54
36
{ content . map ( ( { title, description, link, image, alt, id } , idx ) => (
55
- < Flex
56
- as = { ListItem }
57
- key = { id || idx }
58
- color = "text"
59
- marginBottom = "px"
60
- marginTop = { 8 }
61
- height = "inherit"
62
- >
63
- < Box width = "5rem" >
37
+ < ListItem key = { id || idx } color = "text" className = "mb-0 mt-8 flex" >
38
+ < div className = "w-20" >
64
39
{ image && (
65
- < Image
40
+ < TwImage
66
41
src = { image }
67
42
alt = { alt }
68
43
width = { 66 }
69
- boxShadow = { shadow }
70
- borderRadius = "sm"
44
+ className = "rounded-sm shadow-lg dark:shadow-body-light"
71
45
/>
72
46
) }
73
- </ Box >
74
- < Flex
75
- justifyContent = "space-between"
76
- flexDir = { { base : "column" , sm : "row" } }
77
- paddingBottom = { 4 }
78
- width = "full"
79
- ms = { { base : 4 , sm : 6 } }
80
- borderBottom = "1px solid"
81
- borderColor = "border"
82
- >
83
- < Box flex = { 1 } >
84
- < Box > { title } </ Box >
85
- < Box fontSize = "sm" marginBottom = { 0 } opacity = "0.6" >
86
- { description }
87
- </ Box >
88
- </ Box >
47
+ </ div >
48
+ < Flex className = "ms-4 w-full flex-col justify-between border-b pb-4 sm:ms-6 sm:flex-row" >
49
+ < div className = "flex-1" >
50
+ < div > { title } </ div >
51
+ < div className = "mb-0 text-sm opacity-60" > { description } </ div >
52
+ </ div >
89
53
{ link && (
90
54
< ButtonLink
91
55
variant = "outline"
92
56
href = { link }
93
- alignSelf = "center"
94
- ms = { { base : 0 , sm : 8 } }
95
- paddingY = { 1 }
96
- paddingX = { 6 }
97
- borderRadius = "sm"
98
- marginTop = { { base : 4 , sm : 0 } }
57
+ className = "ms-0 mt-4 min-h-fit gap-0 self-center rounded-sm px-6 py-1 sm:ms-8 sm:mt-0"
99
58
>
100
59
{ actionLabel }
101
60
< VisuallyHidden > to { title } website</ VisuallyHidden >
102
61
</ ButtonLink >
103
62
) }
104
63
</ Flex >
105
- </ Flex >
64
+ </ ListItem >
106
65
) ) }
107
- </ Flex >
108
- </ Box >
66
+ </ List >
67
+ </ div >
109
68
)
110
69
}
111
70
0 commit comments