Part 1 of dialog OK need histogram
This commit is contained in:
parent
fc19abbdf4
commit
e30093cd57
1 changed files with 42 additions and 11 deletions
|
@ -3,6 +3,10 @@ import { Dialog, Transition } from '@headlessui/react'
|
||||||
import { XCircleIcon } from '@heroicons/react/outline'
|
import { XCircleIcon } from '@heroicons/react/outline'
|
||||||
import { trys, successRate, currentStreak, bestStreak } from '../../lib/stats'
|
import { trys, successRate, currentStreak, bestStreak } from '../../lib/stats'
|
||||||
|
|
||||||
|
//const boxItem = ( label: string, value: string ) => {
|
||||||
|
// return ()
|
||||||
|
// }
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
handleClose: () => void
|
handleClose: () => void
|
||||||
|
@ -63,23 +67,50 @@ export const StatsModal = ({ isOpen, handleClose, stats }: Props) => {
|
||||||
>
|
>
|
||||||
Statistics
|
Statistics
|
||||||
</Dialog.Title>
|
</Dialog.Title>
|
||||||
<div className="mt-2">
|
<div className="flex justify-center m-1">
|
||||||
<p>trys = {String(trys(stats))}</p>
|
<div className="items-center justify-center m-1 w-1/4 bg-blue-300">
|
||||||
<p>success rate = {String(successRate(stats))}%</p>
|
<div className="text-3xl font-bold">{String(trys(stats))} </div>
|
||||||
<p>Best streak is {String(bestStreak(stats))} currently {String(currentStreak(stats))}</p>
|
<div className="text-sm">Total trys</div>
|
||||||
|
</div>
|
||||||
|
<div className="items-center justify-center m-1 w-1/4 bg-blue-300">
|
||||||
|
<div className="text-3xl font-bold">{String(successRate(stats))}% </div>
|
||||||
|
<div className="text-sm">Success rate</div>
|
||||||
|
</div>
|
||||||
|
<div className="items-center justify-center m-1 w-1/4 bg-blue-300">
|
||||||
|
<div className="text-3xl font-bold">{String(currentStreak(stats))}</div>
|
||||||
|
<div className="text-sm">Current streak</div>
|
||||||
|
</div>
|
||||||
|
<div className="items-center justify-center m-1 w-1/4 bg-blue-300">
|
||||||
|
<div className="text-3xl font-bold">{String(bestStreak(stats))}</div>
|
||||||
|
<div className="text-sm">Best streak</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Dialog.Title
|
<Dialog.Title
|
||||||
as="h3"
|
as="h3"
|
||||||
className="text-lg leading-6 font-medium text-gray-900"
|
className="text-lg leading-6 font-medium text-gray-900"
|
||||||
>
|
>
|
||||||
Distribution
|
Guess Distribution
|
||||||
</Dialog.Title>
|
</Dialog.Title>
|
||||||
<p>1 {String(stats[0])}</p>
|
<div className="columns-1 justify-left m-2 bg-blue-300 text-sm">
|
||||||
<p>2 {String(stats[1])}</p>
|
<div className="flex justify-left m-1 bg-blue-200">
|
||||||
<p>3 {String(stats[2])}</p>
|
<div>1 {String(stats[0])}</div>
|
||||||
<p>4 {String(stats[3])}</p>
|
</div>
|
||||||
<p>5 {String(stats[4])}</p>
|
<div className="flex justify-left m-1 bg-blue-200">
|
||||||
<p>6 {String(stats[5])}</p>
|
<div>2 {String(stats[1])}</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-left m-1 bg-blue-200">
|
||||||
|
<div>3 {String(stats[2])}</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-left m-1 bg-blue-200">
|
||||||
|
<div>4 {String(stats[3])}</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-left m-1 bg-blue-200">
|
||||||
|
<div>5 {String(stats[4])}</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-left m-1 bg-blue-200">
|
||||||
|
<div>6 {String(stats[5])}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue