@@ -58,17 +58,26 @@ function App() {
5858 if ( playerMove == null ) {
5959 return (
6060 < 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- ) ) }
61+ { MOVES . flatMap ( ( move , i ) => {
62+ const [ beatsA , beatsB ] = Object . keys ( MOVE_CONFIG [ move ] ) ;
63+
64+ return [
65+ < MoveButton
66+ key = { `button:${ move } ` }
67+ move = { move }
68+ onClick = { ( ) => handleMove ( move ) }
69+ transform = { `rotate(${
70+ i / MOVES . length
71+ } turn) translateY(-35vmin) rotate(${ - i / MOVES . length } turn)`}
72+ /> ,
73+
74+ < h1 className = { styles . moveInfo } key = { `moveInfo:${ move } ` } >
75+ < strong > { capitalize ( move ) } </ strong > beats{ " " }
76+ < strong > { beatsA } </ strong > and < strong > { beatsB } </ strong > .
77+ </ h1 > ,
78+ ] ;
79+ } ) }
80+ < h1 className = { styles . heading } > Make your move!</ h1 >
7281 </ div >
7382 ) ;
7483 }
@@ -104,7 +113,10 @@ function App() {
104113 } ) ( ) ;
105114
106115 return (
107- < div className = "App-container centered-container" style = { { gap : "4vmin" } } >
116+ < div
117+ className = { `${ styles . container } centered-container` }
118+ style = { { gap : "4vmin" } }
119+ >
108120 < div className = "centered-container" style = { { gap : "2vmin" } } >
109121 < div >
110122 You picked < strong > { playerMove } </ strong > , computer picked{ " " }
@@ -115,9 +127,7 @@ function App() {
115127 Wins: { wins } / Losses: { losses } / Draws: { draws }
116128 </ div >
117129 </ div >
118- < button className = "App-reset-button" onClick = { resetGame } >
119- Play again
120- </ button >
130+ < button onClick = { resetGame } > Play again</ button >
121131 </ div >
122132 ) ;
123133}
0 commit comments