forked from thesam73/wordle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InfoModal.tsx
83 lines (78 loc) · 2.35 KB
/
InfoModal.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
80
81
82
83
import { Cell } from '../grid/Cell'
import { BaseModal } from './BaseModal'
import i18n from '../../i18n'
type Props = {
isOpen: boolean
handleClose: () => void
}
export const InfoModal = ({ isOpen, handleClose }: Props) => {
let content = i18n.t("help.content").split('\n').filter(function(e){return e});
return (
<BaseModal title={i18n.t('help.title')} isOpen={isOpen} handleClose={handleClose}>
{/* <p className="text-sm text-gray-500 dark:text-gray-300">
Guess the word in 6 tries. After each guess, the color of the tiles will
change to show how close your guess was to the word.
</p> */}
{content.map(function(object, i){
return <p className="text-sm text-gray-500 dark:text-gray-300 text-left"
key={object}
dangerouslySetInnerHTML={{__html:object}}>
</p>
})}
<div className="flex mb-1 mt-4">
{i18n.t("help.exp1").split('').map(function(letter, i){
let cell;
if(i===0){
cell = <Cell value={letter} status="correct"
key={i}
/>
}else {
cell = <Cell value={letter}
key={i}
/>
}
return cell
})}
</div>
<p className="text-sm text-gray-500 dark:text-gray-300 text-left">
{i18n.t("help.exp1_desc")}
</p>
<div className="flex mb-1 mt-4">
{i18n.t("help.exp2").split('').map(function(letter, i){
let cell;
if(i===1){
cell = <Cell value={letter} status="present"
key={i}
/>
}else {
cell = <Cell value={letter}
key={i}
/>
}
return cell
})}
</div>
<p className="text-sm text-gray-500 dark:text-gray-300 text-left">
{i18n.t("help.exp2_desc")}
</p>
<div className="flex mb-1 mt-4">
{i18n.t("help.exp3").split('').map(function(letter, i){
let cell;
if(i===3){
cell = <Cell value={letter} status="absent"
key={i}
/>
}else {
cell = <Cell value={letter}
key={i}
/>
}
return cell
})}
</div>
<p className="text-sm text-gray-500 dark:text-gray-300 text-left">
{i18n.t("help.exp3_desc")}
</p>
</BaseModal>
)
}