Skip to content

Commit 658bd02

Browse files
committed
cleanup + refactor
1 parent 7275d8a commit 658bd02

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

client/src/App.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function Square( { letter, colors, onSquareClick } ) {
3535
return <button key={letter} className={`square ${color}`} onClick={onSquareClick}>{letter}</ button>;
3636
}
3737

38-
function Letters( { attempt, success, revealed } ) {
38+
function Word( { attempt, success, revealed } ) {
3939
let color = "";
4040
let success_animation = "";
4141
const indices: number[] = [0, 1, 2, 3, 4];
@@ -50,12 +50,14 @@ function Letters( { attempt, success, revealed } ) {
5050
}
5151

5252
return <>
53-
<div>
54-
{
55-
indices.map((name, index) =>
56-
<button key={index} className={`square word ${color} ${success_animation}`}>{attempt.length > index ? attempt[index]: ''}</button>
57-
)
58-
}
53+
<div id="word-container">
54+
<div>
55+
{
56+
indices.map((name, index) =>
57+
<button key={index} className={`square word ${color} ${success_animation}`}>{attempt.length > index ? attempt[index]: ''}</button>
58+
)
59+
}
60+
</div>
5961
</div>
6062
</>
6163
}
@@ -94,14 +96,6 @@ function Definition( { term }) {
9496
</>
9597
}
9698

97-
function Word({ attempt, success, revealed }) {
98-
return <>
99-
<div id="word-container">
100-
<Letters attempt={ attempt } success={ success } revealed={ revealed } />
101-
</ div>
102-
</>
103-
}
104-
10599
function Status( { status } ) {
106100
return <>
107101
<div id="status">{ status }</div>

0 commit comments

Comments
 (0)