File tree Expand file tree Collapse file tree 1 file changed +23
-11
lines changed Expand file tree Collapse file tree 1 file changed +23
-11
lines changed Original file line number Diff line number Diff line change 11import { useState } from "react" ;
2- import { Code , Input , Text } from "@stellar/design-system" ;
2+ import { Button , Code , Input , Text } from "@stellar/design-system" ;
33import { useWallet } from "../hooks/useWallet" ;
44import game from "../contracts/guess_the_number" ;
5+ import { Box } from "../components/layout/Box" ;
56
67export const GuessTheNumber = ( ) => {
78 const [ guessedIt , setGuessedIt ] = useState < boolean > ( ) ;
@@ -40,16 +41,27 @@ export const GuessTheNumber = () => {
4041 </ Text >
4142 </ >
4243 ) : (
43- < Input
44- label = "Guess a number from 1 to 10!"
45- id = "guess"
46- fieldSize = "lg"
47- error = { guessedIt === false && "Wrong! Guess again." }
48- onChange = { ( e ) => {
49- setGuessedIt ( undefined ) ;
50- setTheGuess ( Number ( e . target . value ) ) ;
51- } }
52- />
44+ < Box gap = "sm" direction = "row" align = "end" justify = "end" wrap = "wrap" >
45+ < Input
46+ label = "Guess a number from 1 to 10!"
47+ id = "guess"
48+ fieldSize = "lg"
49+ error = { guessedIt === false && "Wrong! Guess again." }
50+ onChange = { ( e ) => {
51+ setGuessedIt ( undefined ) ;
52+ setTheGuess ( Number ( e . target . value ) ) ;
53+ } }
54+ />
55+ < Button
56+ type = "submit"
57+ disabled = { ! theGuess }
58+ style = { { marginTop : 8 } }
59+ variant = "primary"
60+ size = "md"
61+ >
62+ Submit Guess
63+ </ Button >
64+ </ Box >
5365 ) }
5466 < Text as = "p" size = "lg" >
5567 { /* Not sure the SDS way to add consistent spacing at the end */ }
You can’t perform that action at this time.
0 commit comments