@@ -57,18 +57,30 @@ function App() {
5757
5858 if ( playerMove == null ) {
5959 return (
60- < div className = { `${ styles . container } centered-container` } >
61- < h1 > Make your move!</ h1 >
62- { MOVES . map ( ( move , i ) => (
63- < MoveButton
64- key = { move }
65- move = { move }
66- onClick = { ( ) => handleMove ( move ) }
67- transform = { `rotate(${
68- i / MOVES . length
69- } turn) translateY(-35vmin) rotate(${ - i / MOVES . length } turn)`}
70- />
71- ) ) }
60+ < div
61+ className = { `${ styles . container } centered-container` }
62+ style = { { gap : "2vmin" } }
63+ >
64+ { MOVES . flatMap ( ( move , i ) => {
65+ const [ beatsA , beatsB ] = Object . keys ( MOVE_CONFIG [ move ] ) ;
66+
67+ return [
68+ < MoveButton
69+ key = { `button:${ move } ` }
70+ move = { move }
71+ onClick = { ( ) => handleMove ( move ) }
72+ transform = { `rotate(${
73+ i / MOVES . length
74+ } turn) translateY(-35vmin) rotate(${ - i / MOVES . length } turn)`}
75+ /> ,
76+
77+ < h1 className = { styles . moveInfo } key = { `moveInfo:${ move } ` } >
78+ < strong > { capitalize ( move ) } </ strong > beats{ " " }
79+ < strong > { beatsA } </ strong > and < strong > { beatsB } </ strong > .
80+ </ h1 > ,
81+ ] ;
82+ } ) }
83+ < h1 className = { styles . heading } > Make your move!</ h1 >
7284 </ div >
7385 ) ;
7486 }
@@ -104,7 +116,10 @@ function App() {
104116 } ) ( ) ;
105117
106118 return (
107- < div className = "App-container centered-container" style = { { gap : "4vmin" } } >
119+ < div
120+ className = { `${ styles . container } centered-container` }
121+ style = { { gap : "4vmin" } }
122+ >
108123 < div className = "centered-container" style = { { gap : "2vmin" } } >
109124 < div >
110125 You picked < strong > { playerMove } </ strong > , computer picked{ " " }
@@ -115,9 +130,7 @@ function App() {
115130 Wins: { wins } / Losses: { losses } / Draws: { draws }
116131 </ div >
117132 </ div >
118- < button className = "App-reset-button" onClick = { resetGame } >
119- Play again
120- </ button >
133+ < button onClick = { resetGame } > Play again</ button >
121134 </ div >
122135 ) ;
123136}
0 commit comments