File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -207,21 +207,20 @@ const Table = () => {
207
207
} ,
208
208
{
209
209
Header : ( ) => {
210
+ const randomQuestion = ( ) => {
211
+ const random = Math . floor ( Math . random ( ) * questions . length ) ;
212
+ const questionId = questions [ random ] . id ;
213
+ const questionSlug = questions [ questionId ] . url ;
214
+ window . open ( `${ questionSlug } ` , '_blank' ) ;
215
+ } ;
210
216
return (
211
217
< >
212
218
< div
213
219
style = { { whiteSpace : 'nowrap' , display : 'inline-block' } }
214
220
>
215
221
Questions{ ' ' }
216
222
< Button
217
- onClick = { ( ) => {
218
- const random = Math . floor (
219
- Math . random ( ) * questions . length ,
220
- ) ;
221
- const questionId = questions [ random ] . id ;
222
- const questionSlug = questions [ questionId ] . url ;
223
- window . open ( `${ questionSlug } ` , '_blank' ) ;
224
- } }
223
+ onClick = { randomQuestion }
225
224
color = "dark"
226
225
id = "random-question-button"
227
226
size = "sm"
You can’t perform that action at this time.
0 commit comments