1
1
import { useState } from "react"
2
2
import sortBy from "lodash/sortBy"
3
3
import { FaChevronRight } from "react-icons/fa6"
4
- import {
5
- Box ,
6
- Flex ,
7
- Icon ,
8
- LinkBox ,
9
- LinkOverlay ,
10
- List ,
11
- ListItem ,
12
- useToken ,
13
- VisuallyHidden ,
14
- } from "@chakra-ui/react"
15
4
16
5
import Emoji from "@/components/Emoji"
17
6
import InfoBanner from "@/components/InfoBanner"
18
- import Input from "@/components/Input"
19
- import InlineLink , { BaseLink } from "@/components/Link"
20
- import Text from "@/components/OldText"
21
7
import Translation from "@/components/Translation"
22
8
9
+ import { cn } from "@/lib/utils/cn"
23
10
import { trackCustomEvent } from "@/lib/utils/matomo"
24
11
25
12
import meetups from "@/data/community-meetups.json"
26
13
14
+ import Input from "../../tailwind/ui/Input"
15
+
16
+ import { Flex } from "./ui/flex"
17
+ import InlineLink , { BaseLink } from "./ui/Link"
18
+
27
19
export interface Meetup {
28
20
title : string
29
21
emoji : string
@@ -59,89 +51,55 @@ const MeetupList = () => {
59
51
} )
60
52
}
61
53
62
- const primaryBaseColor = useToken ( "colors" , "primary.base" )
63
-
64
54
return (
65
- < Box >
55
+ < div >
66
56
< Input
67
- mb = { 6 }
57
+ className = "mb-6 w-full"
68
58
onChange = { handleSearch }
69
59
placeholder = { "Search by meetup title or location" }
70
60
aria-describedby = "input-instruction"
71
61
/>
72
62
{ /* hidden for attachment to input only */ }
73
- < VisuallyHidden hidden id = "input-instruction" >
63
+ < span id = "input-instruction" className = "sr-only ">
74
64
results update as you type
75
- </ VisuallyHidden >
76
-
77
- < List
78
- m = { 0 }
79
- border = { "2px solid" }
80
- borderColor = { "offBackground" }
65
+ </ span >
66
+ < ul
67
+ className = "m-0 border-2 border-body-light"
81
68
aria-label = "Event meetup results"
82
69
>
83
70
{ filteredMeetups . map ( ( meetup , idx ) => (
84
- < LinkBox
85
- as = { ListItem }
71
+ < BaseLink
72
+ href = { meetup . link }
73
+ hideArrow
74
+ className = { cn (
75
+ "group mb-[0.25px] flex w-full justify-between p-4 text-current no-underline" ,
76
+ "hover:bg-background-highlight hover:text-current hover:no-underline hover:shadow-[0_0_1px] hover:shadow-primary" ,
77
+ "border-b-2 border-body-light"
78
+ ) }
86
79
key = { idx }
87
- display = "flex"
88
- justifyContent = "space-between"
89
- mb = { 0.25 }
90
- p = { 4 }
91
- w = "100%"
92
- _hover = { {
93
- textDecoration : "none" ,
94
- borderRadius : "base" ,
95
- boxShadow : `0 0 1px ${ primaryBaseColor } ` ,
96
- bg : "tableBackgroundHover" ,
97
- } }
98
- borderBottom = { "2px solid" }
99
- borderColor = { "offBackground" }
100
80
>
101
- < Flex flex = "1 1 75%" me = { 4 } >
102
- < Box me = { 4 } opacity = "0.4" >
103
- { idx + 1 }
104
- </ Box >
105
- < Box >
106
- < LinkOverlay
107
- as = { BaseLink }
108
- href = { meetup . link }
109
- textDecor = "none"
110
- color = "text"
111
- hideArrow
112
- isExternal
113
- >
81
+ < Flex className = "me-4 flex-[1_1_75%]" >
82
+ < div className = "me-4 opacity-40" > { idx + 1 } </ div >
83
+ < div >
84
+ < p className = "no-underline group-hover:text-primary-hover group-hover:underline" >
114
85
{ meetup . title }
115
- </ LinkOverlay >
116
- </ Box >
86
+ </ p >
87
+ </ div >
117
88
</ Flex >
118
- < Flex
119
- textAlign = "end"
120
- alignContent = "flex-start"
121
- flex = "1 1 25%"
122
- me = { 4 }
123
- flexWrap = "wrap"
124
- >
89
+ < Flex className = "me-4 flex-[1_1_25%] flex-wrap content-start items-center text-end" >
125
90
< Emoji
126
91
text = { meetup . emoji }
127
92
className = "me-2 text-md leading-none"
128
93
/>
129
- < Text mb = { 0 } opacity = { "0.6" } >
130
- { meetup . location }
131
- </ Text >
94
+ < p className = "mb-0 opacity-60" > { meetup . location } </ p >
132
95
</ Flex >
133
- < Flex alignItems = { "center" } >
134
- < Icon
135
- as = { FaChevronRight }
136
- width = { { base : "14px" , xl : "18px" } }
137
- height = { { base : "14px" , xl : "18px" } }
138
- color = { "text" }
139
- />
96
+ < Flex className = "items-center" >
97
+ < FaChevronRight className = "h-[14px] w-[14px] xl:h-[18px] xl:w-[18px]" />
140
98
</ Flex >
141
- </ LinkBox >
99
+ </ BaseLink >
142
100
) ) }
143
- </ List >
144
- < Box aria-live = "assertive" aria-atomic >
101
+ </ ul >
102
+ < div aria-live = "assertive" aria-atomic >
145
103
{ ! filteredMeetups . length && (
146
104
< InfoBanner emoji = ":information_source:" >
147
105
< Translation id = "page-community:page-community-meetuplist-no-meetups" /> { " " }
@@ -150,8 +108,8 @@ const MeetupList = () => {
150
108
</ InlineLink >
151
109
</ InfoBanner >
152
110
) }
153
- </ Box >
154
- </ Box >
111
+ </ div >
112
+ </ div >
155
113
)
156
114
}
157
115
0 commit comments