Skip to content

Instantly share code, notes, and snippets.

@syamjayaraj
Created January 25, 2021 06:25
Show Gist options
  • Save syamjayaraj/6470a73c473b1dfbf9b0363e6ecb6c0b to your computer and use it in GitHub Desktop.
Save syamjayaraj/6470a73c473b1dfbf9b0363e6ecb6c0b to your computer and use it in GitHub Desktop.
import React from "react";
import { Card, Button } from "react-bootstrap";
function VotingCard(props) {
let { team, incrementVoteCount } = props;
return (
<Card style={{ width: "18rem" }}>
<Card.Img variant="top" src={`/assets/images/${team.logo}`} />
<Card.Body>
<Card.Title>{team.name}</Card.Title>
<Button variant="success" onClick={() => incrementVoteCount(team._id)}>
Vote
</Button>
</Card.Body>
<Card.Footer>Vote count: {team.votes}</Card.Footer>
</Card>
);
}
export default VotingCard;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment