@@ -7,8 +7,11 @@ import {
7
7
Input ,
8
8
LinkBox ,
9
9
LinkOverlay ,
10
+ List ,
11
+ ListItem ,
10
12
Text ,
11
- useColorMode ,
13
+ useColorModeValue ,
14
+ VisuallyHidden ,
12
15
} from "@chakra-ui/react"
13
16
14
17
// Components
@@ -53,7 +56,11 @@ export interface IProps {}
53
56
const MeetupList : React . FC < IProps > = ( ) => {
54
57
const [ searchField , setSearchField ] = useState < string > ( "" )
55
58
const filteredMeetups = filterMeetups ( searchField )
56
- const { colorMode } = useColorMode ( )
59
+ const listBoxShadow = useColorModeValue ( "tableBox.light" , "tableBox.dark" )
60
+ const listItemBoxShadow = useColorModeValue (
61
+ "tableItemBox.light" ,
62
+ "tableItemBox.dark"
63
+ )
57
64
58
65
const handleSearch = ( event : React . ChangeEvent < HTMLInputElement > ) : void => {
59
66
setSearchField ( event . target . value )
@@ -82,70 +89,72 @@ const MeetupList: React.FC<IProps> = () => {
82
89
w = "100%"
83
90
_focus = { { outline : "auto 1px" } }
84
91
_placeholder = { { color : "text200" } }
92
+ aria-describedby = "input-instruction"
85
93
/>
86
- < Box
87
- boxShadow = { colorMode === "dark" ? "tableBox.dark" : "tableBox.light" }
88
- >
89
- { filteredMeetups . length ? (
90
- filteredMeetups . map ( ( meetup , idx ) => (
91
- < LinkBox
92
- key = { idx }
93
- display = "flex"
94
- justifyContent = "space-between"
95
- boxShadow = {
96
- colorMode === "dark"
97
- ? "tableItemBox.dark"
98
- : "tableItemBox.light"
99
- }
100
- mb = { 0.25 }
101
- p = { 4 }
102
- w = "100%"
103
- _hover = { {
104
- textDecoration : "none" ,
105
- borderRadius : "base" ,
106
- boxShadow : "0 0 1px primary" ,
107
- bg : "tableBackgroundHover" ,
108
- } }
94
+ { /* hidden for attachment to input only */ }
95
+ < VisuallyHidden hidden id = "input-instruction" >
96
+ results update as you type
97
+ </ VisuallyHidden >
98
+
99
+ < List m = { 0 } boxShadow = { listBoxShadow } aria-label = "Event meetup results" >
100
+ { filteredMeetups . map ( ( meetup , idx ) => (
101
+ < LinkBox
102
+ as = { ListItem }
103
+ key = { idx }
104
+ display = "flex"
105
+ justifyContent = "space-between"
106
+ boxShadow = { listItemBoxShadow }
107
+ mb = { 0.25 }
108
+ p = { 4 }
109
+ w = "100%"
110
+ _hover = { {
111
+ textDecoration : "none" ,
112
+ borderRadius : "base" ,
113
+ boxShadow : "0 0 1px primary" ,
114
+ bg : "tableBackgroundHover" ,
115
+ } }
116
+ >
117
+ < Flex flex = "1 1 75%" mr = { 4 } >
118
+ < Box mr = { 4 } opacity = "0.4" >
119
+ { idx + 1 }
120
+ </ Box >
121
+ < Box >
122
+ < LinkOverlay
123
+ as = { Link }
124
+ href = { meetup . link }
125
+ textDecor = "none"
126
+ color = "text"
127
+ hideArrow
128
+ >
129
+ { meetup . title }
130
+ </ LinkOverlay >
131
+ </ Box >
132
+ </ Flex >
133
+ < Flex
134
+ textAlign = "right"
135
+ alignContent = "flex-start"
136
+ flex = "1 1 25%"
137
+ mr = { 4 }
138
+ flexWrap = "wrap"
109
139
>
110
- < Flex flex = "1 1 75%" mr = { 4 } >
111
- < Box mr = { 4 } opacity = "0.4" >
112
- { idx + 1 }
113
- </ Box >
114
- < Box >
115
- < LinkOverlay
116
- as = { Link }
117
- href = { meetup . link }
118
- textDecor = "none"
119
- color = "text"
120
- hideArrow
121
- >
122
- { meetup . title }
123
- </ LinkOverlay >
124
- </ Box >
125
- </ Flex >
126
- < Flex
127
- textAlign = "right"
128
- alignContent = "flex-start"
129
- flex = "1 1 25%"
130
- mr = { 4 }
131
- flexWrap = "wrap"
132
- >
133
- < Emoji text = { meetup . emoji } boxSize = { 4 } mr = { 2 } />
134
- < Text mb = { 0 } opacity = { "0.6" } >
135
- { meetup . location }
136
- </ Text >
137
- </ Flex >
138
- < Box
139
- as = "span"
140
- _after = { {
141
- content : '"↗"' ,
142
- ml : 0.5 ,
143
- mr : 1.5 ,
144
- } }
145
- > </ Box >
146
- </ LinkBox >
147
- ) )
148
- ) : (
140
+ < Emoji text = { meetup . emoji } boxSize = { 4 } mr = { 2 } />
141
+ < Text mb = { 0 } opacity = { "0.6" } >
142
+ { meetup . location }
143
+ </ Text >
144
+ </ Flex >
145
+ < Box
146
+ as = "span"
147
+ _after = { {
148
+ content : '"↗"' ,
149
+ ml : 0.5 ,
150
+ mr : 1.5 ,
151
+ } }
152
+ > </ Box >
153
+ </ LinkBox >
154
+ ) ) }
155
+ </ List >
156
+ < Box aria-live = "assertive" aria-atomic >
157
+ { ! filteredMeetups . length && (
149
158
< InfoBanner emoji = ":information_source:" >
150
159
< Translation id = "page-community-meetuplist-no-meetups" /> { " " }
151
160
< Link to = "https://github.com/ethereum/ethereum-org-website/blob/dev/src/data/community-meetups.json" >
0 commit comments