import Head from 'next/head' import '../static/everypage.css' import {Footer, TurniereNavigation} from "../js/CommonComponents"; import React from "react"; import {Card, CardBody, Container} from "reactstrap"; import {getRequest} from "../js/api"; export default () => (
Öffentliche Turniere: turnie.re
) class TournamentList extends React.Component { constructor(props) { super(props); this.state = { error: null, isLoaded: false, items: [] }; } componentDidMount() { getRequest('/tournaments?type=public',{}) .then( response => { console.log('response:'); console.log(response); this.setState({ isLoaded: true, items: response.data }); }, error => { this.setState({ isLoaded: true, error }); } ) } render() { return (

Öffentliche Turniere

{this.state.items.map(item => ( //The code should be item.code but the api just supports it this way by now ))}
); } } function TournamentListEntry(props) { return ( {props.name} ); }