Final changes.
This commit is contained in:
parent
6cd421ba01
commit
34bbfb3d5d
@ -13,7 +13,7 @@ export default class SportInfoCard extends React.Component {
|
||||
<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>
|
||||
{this.props.sport.description}
|
||||
</Card.Text>
|
||||
</Card.Body>
|
||||
</Card>
|
||||
|
@ -4,6 +4,9 @@ import "../styles/Dashboard.css";
|
||||
import { apiClient } from "../utils/httpClients.js";
|
||||
import MatchInfoCardDisplay from "../components/MatchInfoCardDisplay";
|
||||
import SportInfoCardDisplay from "../components/SportInfoCardDisplay";
|
||||
import { globalContext } from "../context";
|
||||
import { needUser } from "../utils/routing";
|
||||
|
||||
export default class Dashboard extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@ -15,7 +18,10 @@ export default class Dashboard extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
static contextType = globalContext;
|
||||
|
||||
async componentDidMount() {
|
||||
await needUser(this.context.navigate);
|
||||
await this.latestMatches();
|
||||
await this.availableSports();
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const apiClient = axios.create({
|
||||
baseURL: process.env.REACT_APP_API_HOST + "/api/",
|
||||
baseURL: process.env.REACT_APP_API_HOST || "" + "/api/",
|
||||
timeout: 5000,
|
||||
withCredentials: process.env.NODE_ENV === "development",
|
||||
validateStatus: function (status) {
|
||||
return status === 401 || status == 200;
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user