Added cards and scroll styling
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import propTypes from "prop-types";
|
||||
import MatchInfoCard from "./MatchInfoCard";
|
||||
|
||||
import "../styles/MatchInfoCardDisplay.css";
|
||||
export default class MatchInfoCardDisplay extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
26
sports-matcher/client/src/components/SportInfoCard.js
Normal file
26
sports-matcher/client/src/components/SportInfoCard.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import { Card } from "react-bootstrap";
|
||||
import propTypes from "prop-types";
|
||||
export default class SportInfoCard extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card style={{ width: "20rem" }}>
|
||||
<Card.Body>
|
||||
<Card.Title>{this.props.sport.name}</Card.Title>
|
||||
<Card.Subtitle className="mb-2 text-muted">{this.props.sport.minPlayers.toString()}</Card.Subtitle>
|
||||
<Card.Text>
|
||||
<p>{this.props.sport.description}</p>
|
||||
</Card.Text>
|
||||
</Card.Body>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SportInfoCard.propTypes = {
|
||||
sport: propTypes.object,
|
||||
};
|
24
sports-matcher/client/src/components/SportInfoCardDisplay.js
Normal file
24
sports-matcher/client/src/components/SportInfoCardDisplay.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import propTypes from "prop-types";
|
||||
import SportInfoCard from "./SportInfoCard";
|
||||
import "../styles/MatchInfoCardDisplay.css";
|
||||
export default class SportInfoCardDisplay extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
render() {
|
||||
let sports = null;
|
||||
if(this.props.recommendedsports && this.props.recommendedsports.length > 0) {
|
||||
sports = this.props.recommendedsports.map((sport) => <SportInfoCard key={sport._id} sport={sport}></SportInfoCard>);
|
||||
}
|
||||
return (
|
||||
<div className="horizontal-scroller">
|
||||
{sports}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SportInfoCardDisplay.propTypes = {
|
||||
recommendedsports: propTypes.array,
|
||||
};
|
Reference in New Issue
Block a user