@@ -69,6 +69,26 @@ export function GymPopup({ hasRaid, hasHatched, raidIconUrl, ...gym }) {
6969 )
7070 }
7171
72+ const formatTime = ( timestamp ) => {
73+ const locale = localStorage . getItem ( 'i18nextLng' ) || 'en'
74+ return new Date ( timestamp ) . toLocaleTimeString ( locale , {
75+ hour : '2-digit' ,
76+ minute : '2-digit' ,
77+ } )
78+ }
79+
80+ const now = Date . now ( )
81+
82+ const filteredRsvps =
83+ gym . rsvps ?. filter ( ( entry ) => {
84+ const ets = entry . timeslot
85+ return (
86+ ets > now &&
87+ ets / 1000 > gym . raid_spawn_timestamp &&
88+ ets / 1000 < gym . raid_end_timestamp
89+ )
90+ } ) || [ ]
91+
7292 return (
7393 < ErrorBoundary noRefresh style = { { } } variant = "h5" >
7494 < Grid
@@ -121,6 +141,49 @@ export function GymPopup({ hasRaid, hasHatched, raidIconUrl, ...gym }) {
121141 { Boolean (
122142 gym . raid_pokemon_id && gym . raid_battle_timestamp >= ts ,
123143 ) && < Timer start { ...gym } hasHatched = { hasHatched } /> }
144+ { filteredRsvps ?. length > 0 && (
145+ < Grid xs = { 12 } >
146+ < Grid
147+ container
148+ direction = "column"
149+ alignItems = "center"
150+ style = { { margin : '2px 0' } }
151+ >
152+ < small
153+ style = { {
154+ fontWeight : 'bold' ,
155+ fontSize : '0.9rem' ,
156+ marginBottom : 4 ,
157+ } }
158+ >
159+ RSVP (Going / Maybe)
160+ </ small >
161+ < Grid container justifyContent = "center" spacing = { 1 } >
162+ { filteredRsvps . slice ( 0 , 3 ) . map ( ( entry ) => (
163+ < Grid
164+ key = { entry . timeslot }
165+ xs = "auto"
166+ style = { {
167+ display : 'flex' ,
168+ flexDirection : 'column' ,
169+ alignItems : 'center' ,
170+ borderRadius : '6px' ,
171+ paddingTop : '4px' ,
172+ fontSize : '0.80rem' ,
173+ minWidth : 50 ,
174+ textAlign : 'center' ,
175+ } }
176+ >
177+ < div > { formatTime ( entry . timeslot ) } </ div >
178+ < div style = { { fontSize : '0.75rem' , opacity : 0.8 } } >
179+ { entry . going_count } / { entry . maybe_count }
180+ </ div >
181+ </ Grid >
182+ ) ) }
183+ </ Grid >
184+ </ Grid >
185+ </ Grid >
186+ ) }
124187 < Timer { ...gym } hasHatched = { hasHatched } />
125188 </ Grid >
126189 </ Collapse >
0 commit comments