@@ -67,27 +67,29 @@ export function AboutPage(): JSXElement {
6767 query = { typingStats }
6868 errorMessage = "Failed to get global typing stats"
6969 >
70- { ( data ) => (
71- < div class = "grid grid-cols-1 gap-4 sm:grid-cols-3" >
72- < For
73- each = {
74- [
75- [ "total tests started" , data ?. testsStarted ] ,
76- [ "total typing time" , data ?. timeTyping ] ,
77- [ "total tests completed" , data ?. testsCompleted ] ,
78- ] as const
79- }
80- >
81- { ( [ title , data ] ) => (
82- < div class = "text-center" >
83- < div class = "text-sub" > { title } </ div >
84- < div class = "text-5xl" > { data ?. text ?? "-" } </ div >
85- < div class = "text-xl" > { data ?. subText ?? "-" } </ div >
86- </ div >
87- ) }
88- </ For >
89- </ div >
90- ) }
70+ { ( data ) => {
71+ return (
72+ < div class = "grid grid-cols-1 gap-4 sm:grid-cols-3" >
73+ < For
74+ each = {
75+ [
76+ [ "total tests started" , ( ) => data ( ) ?. testsStarted ] ,
77+ [ "total typing time" , ( ) => data ( ) ?. timeTyping ] ,
78+ [ "total tests completed" , ( ) => data ( ) ?. testsCompleted ] ,
79+ ] as const
80+ }
81+ >
82+ { ( [ title , stat ] ) => (
83+ < div class = "text-center" >
84+ < div class = "text-sub" > { title } </ div >
85+ < div class = "text-5xl" > { stat ( ) ?. text ?? "-" } </ div >
86+ < div class = "text-xl" > { stat ( ) ?. subText ?? "-" } </ div >
87+ </ div >
88+ ) }
89+ </ For >
90+ </ div >
91+ ) ;
92+ } }
9193 </ AsyncContent >
9294 </ section >
9395 < section class = "h-48 w-full" >
@@ -101,12 +103,12 @@ export function AboutPage(): JSXElement {
101103 < ChartJs
102104 type = "bar"
103105 data = { {
104- labels : data ?. labels ?? [ ] ,
106+ labels : data ( ) ?. labels ?? [ ] ,
105107 datasets : [
106108 {
107109 yAxisID : "count" ,
108110 label : "Users" ,
109- data : data ?. data ?? [ ] ,
111+ data : data ( ) ?. data ?? [ ] ,
110112 minBarLength : 2 ,
111113 backgroundColor : getTheme ( ) . main ,
112114 borderColor : getTheme ( ) . main ,
@@ -169,7 +171,7 @@ export function AboutPage(): JSXElement {
169171 />
170172 < div class = "text-right text-xs text-sub" >
171173 distribution of time 60 leaderboard results (wpm) < br />
172- { numberOfHistogramRecords ( data ?. data ) } total results
174+ { numberOfHistogramRecords ( data ( ) ?. data ) } total results
173175 </ div >
174176 </ >
175177 ) }
@@ -413,7 +415,7 @@ export function AboutPage(): JSXElement {
413415 "grid-template-columns" : "repeat(auto-fill, minmax(13em, 1fr))" ,
414416 } }
415417 >
416- < For each = { data } > { ( name ) => < div > { name } </ div > } </ For >
418+ < For each = { data ( ) } > { ( name ) => < div > { name } </ div > } </ For >
417419 </ div >
418420 ) }
419421 </ AsyncContent >
@@ -436,7 +438,7 @@ export function AboutPage(): JSXElement {
436438 "grid-template-columns" : "repeat(auto-fill, minmax(13em, 1fr))" ,
437439 } }
438440 >
439- < For each = { data } > { ( name ) => < div > { name } </ div > } </ For >
441+ < For each = { data ( ) } > { ( name ) => < div > { name } </ div > } </ For >
440442 </ div >
441443 ) }
442444 </ AsyncContent >
0 commit comments