import React from "react"; import { Button, Card } from "react-bootstrap"; import propTypes from "prop-types"; import { grammaticalListString } from "../utils/strings"; export default class GameInfoCard extends React.Component { constructor(props) { super(props); } getParticipants() { let participants = []; this.props.match.registeredUsers.array.forEach(user => { participants.push(user.firstName); }); return participants; } render() { return ( {this.props.match.sport} {this.props.match.sport} Join {grammaticalListString(this.getParticipants(), 4)} to play a few matches of {this.props.match.sport} at {this.props.match.location} on {this.props.match.dateTime.toLocaleDateString("en-US")}! ); } } GameInfoCard.propTypes = { match: propTypes.object, };