Skip to content

Commit 4f2f13c

Browse files
committed
Provide definition of word when found #11
1 parent 9c2ff8c commit 4f2f13c

File tree

7 files changed

+5630
-9222
lines changed

7 files changed

+5630
-9222
lines changed

src/App.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import {
2020
WORD_NOT_FOUND_MESSAGE,
2121
CORRECT_WORD_MESSAGE,
2222
} from './constants/strings'
23+
import {
24+
WORDS,
25+
WORDS_WITH_VOWELS,
26+
DEFINITIONS,
27+
PARTS_OF_SPEECH,
28+
} from './constants/wordlist'
2329
import {
2430
MAX_WORD_LENGTH,
2531
MAX_CHALLENGES,
@@ -31,6 +37,7 @@ import {
3137
isWordInWordList,
3238
isWinningWord,
3339
solution,
40+
solutionIndex,
3441
findFirstUnusedReveal,
3542
} from './lib/words'
3643
import { addStatsForCompletedGame, loadStats } from './lib/stats'
@@ -273,6 +280,10 @@ function App() {
273280
gameStats={stats}
274281
isGameLost={isGameLost}
275282
isGameWon={isGameWon}
283+
word={WORDS[solutionIndex]}
284+
wordwithvowels={WORDS_WITH_VOWELS[solutionIndex]}
285+
partofspeech={PARTS_OF_SPEECH[solutionIndex]}
286+
definition={DEFINITIONS[solutionIndex]}
276287
handleShare={() => {
277288
setSuccessAlert(GAME_COPIED_MESSAGE)
278289
return setTimeout(() => setSuccessAlert(''), ALERT_TIME_MS)

src/components/modals/AboutModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const AboutModal = ({ isOpen, handleClose }: Props) => {
99
return (
1010
<BaseModal title="ܒܘܕ ܕܐܗܐ ܛܐܠܬܐ" isOpen={isOpen} handleClose={handleClose}>
1111
<p className="text-2xl text-gray-500 dark:text-gray-300">
12-
ܡܡܠܠ - ܛܐܠܬܐ ܕܡܠ̈ܐ ܀
12+
ܡܡܠܠ ܀{' '}
1313
<a href="https://yonan.org/" className="underline font-bold">
1414
ܒܪܝܢܐ ܕܡܡܠܠ
1515
</a>{' '}

src/components/modals/StatsModal.tsx

+18-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ type Props = {
1616
isOpen: boolean
1717
handleClose: () => void
1818
guesses: string[]
19+
word: string
20+
wordwithvowels: string
21+
partofspeech: string
22+
definition: string
1923
gameStats: GameStats
2024
isGameLost: boolean
2125
isGameWon: boolean
@@ -27,6 +31,10 @@ export const StatsModal = ({
2731
isOpen,
2832
handleClose,
2933
guesses,
34+
word,
35+
wordwithvowels,
36+
partofspeech,
37+
definition,
3038
gameStats,
3139
isGameLost,
3240
isGameWon,
@@ -45,11 +53,16 @@ export const StatsModal = ({
4553
)
4654
}
4755
return (
48-
<BaseModal
49-
title={STATISTICS_TITLE}
50-
isOpen={isOpen}
51-
handleClose={handleClose}
52-
>
56+
<BaseModal title={wordwithvowels} isOpen={isOpen} handleClose={handleClose}>
57+
<div style={{ direction: 'rtl' }}>
58+
<h4 dir="ltr" className="text-lg leading-8 font-large dark:text-white">
59+
[{partofspeech}] {definition}
60+
</h4>
61+
</div>
62+
63+
<h4 className="text-4xl leading-15 font-large dark:text-white">
64+
{STATISTICS_TITLE}
65+
</h4>
5366
<StatBar gameStats={gameStats} />
5467
<h4 className="text-lg leading-6 font-medium text-gray-900 dark:text-gray-100">
5568
{GUESS_DISTRIBUTION_TEXT}

src/components/stats/StatBar.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { GameStats } from '../../lib/localStorage'
2+
23
import {
34
TOTAL_TRIES_TEXT,
45
SUCCESS_RATE_TEXT,

0 commit comments

Comments
 (0)