-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMigrateStatsModal.tsx
79 lines (73 loc) · 2.68 KB
/
MigrateStatsModal.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { BaseModal } from './BaseModal'
import { useState } from 'react'
import { GameStats, StoredGameState } from '../../lib/localStorage'
import { EmigratePanel } from '../stats/EmigratePanel'
import { ImmigratePanel } from '../stats/ImmigratePanel'
type Props = {
isOpen: boolean
handleClose: () => void
}
export type MigrationStats = {
statistics: GameStats
gameState: StoredGameState | null
}
export const MigrateStatsModal = ({ isOpen, handleClose }: Props) => {
const [isEmigrateVisible, setIsEmigrateVisible] = useState(true)
return (
<BaseModal
title="Transfira suas estatísticas"
isOpen={isOpen}
handleClose={handleClose}
>
<p className="mt-4 mb-4 text-sm text-gray-500 dark:text-gray-300">
Copie o código de migração do seu antigo aparelho e cole no seu novo
dispositivo.
</p>
<div className="w-full columns-3 gap-0">
<div className="flex items-center mb-4">
<p className="flex mb-0 text-sm font-medium text-gray-900 dark:text-gray-300">
Este é meu:
</p>
</div>
<div className="flex items-center mb-4">
<input
checked={isEmigrateVisible}
onChange={() => setIsEmigrateVisible(true)}
id="emigrate-radio-button"
radioGroup="migrate-radio-buttons"
type="radio"
value=""
name="emigrate-radio-button"
className="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
/>
<label
htmlFor="emigrate-radio-button"
className="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300"
>
aparelho antigo
</label>
</div>
<div className="flex items-center">
<input
checked={!isEmigrateVisible}
onChange={() => setIsEmigrateVisible(false)}
id="immigrate-radio-button"
radioGroup="migrate-radio-buttons"
type="radio"
value=""
name="immigrate-radio-button"
className="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:border-gray-600"
/>
<label
htmlFor="immigrate-radio-button"
className="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300"
>
novo aparelho
</label>
</div>
</div>
{isEmigrateVisible && <EmigratePanel />}
{!isEmigrateVisible && <ImmigratePanel />}
</BaseModal>
)
}