Created
October 4, 2019 06:43
-
-
Save kianaditya/b0fa70b48804e0ac31407f8fc89c1a05 to your computer and use it in GitHub Desktop.
refactors file using map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const GameInformation = () => { | |
return ( | |
<div className="game-header"> | |
<h1>Rock, Paper, Scissors</h1> | |
<h3>Welcome, the rules are simple:</h3> | |
<ul> | |
{[["ROCK", "SCISSORS"], ["PAPER", "ROCK"], ["SCISSORS", "PAPER"]].map( | |
array => { | |
return ( | |
<li> | |
<span style={{ fontWeight: "700" }}>{array[0]}</span> | |
<span style={{ padding: "0.4rem" }}>beats</span> | |
<span style={{ fontWeight: "700" }}>{array[1]}</span> | |
</li> | |
); | |
} | |
)} | |
</ul> | |
</div> | |
); | |
}; | |
export default GameInformation; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment