Created
February 28, 2020 15:26
-
-
Save ashour/bdec53d7b3ff51005da0dafd95ab278c to your computer and use it in GitHub Desktop.
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"; | |
import { useIntl, FormattedMessage } from "react-intl"; | |
import games from "../data"; | |
import "./GameIndex.css"; | |
import Voting from "../components/Voting"; | |
function GameIndex(props) { | |
const intl = useIntl(); | |
return ( | |
<div className="columns" style={{ flexWrap: "wrap" }}> | |
{games[intl.locale].map(game => ( | |
<div className="column is-one-third" key={game.id}> | |
<div className="card"> | |
<div className="card-image"> | |
<figure className="image GameIndex__ImageContainer"> | |
<img src={game.imageUrl} className="GameIndex__Image" /> | |
</figure> | |
<div className="card-content"> | |
<h3 className="title is-6" style={{ marginBottom: "0.5rem" }}> | |
{game.title} | |
</h3> | |
<p style={{ marginBottom: "0.5rem" }}> | |
<small> | |
<FormattedMessage | |
id="games.addedOn" | |
values={{ addedOn: new Date(game.addedOn) }} | |
/> | |
</small> | |
</p> | |
<Voting initialVoteCount={game.initialVoteCount} /> | |
</div> | |
</div> | |
</div> | |
</div> | |
))} | |
</div> | |
); | |
} | |
export default GameIndex; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment