import React from 'react';
import {connect} from 'react-redux';
import {
Button,
ButtonGroup,
Col,
Container,
ListGroup,
ListGroupItem,
Row
} from 'reactstrap';
class PrivateTournamentInformationView extends React.Component {
render() {
const {tournament, isSignedIn, username, currentpage} = this.props;
return (
{tournament.description}
{tournament.isPublic ? 'Das Turnier ist öffentlich.' : 'Das Turnier ist privat.'}
Turnier-Code: {tournament.code}
von {tournament.owner_username}
);
}
}
function mapStateToPrivateTournamentInformationViewProps(state) {
const {isSignedIn, username} = state.userinfo;
return {isSignedIn, username};
}
export const TournamentInformationView = connect(
mapStateToPrivateTournamentInformationViewProps
)(PrivateTournamentInformationView);
function ButtonsBadge(props) {
const {id, ownerName, isSignedIn, username, currentpage} = props;
switch (currentpage) {
case 'statistics':
return (
);
case 'tournament':
return (
);
case 'edit':
return (
);
default: return null;
}
}
function TournamentButton(props) {
const {id} = props;
return ;
}
function EditButton(props) {
const {id, ownerName, isSignedIn, username} = props;
if (isSignedIn && ownerName === username) {
return (
);
} else {
return null;
}
}
function StatisticsButton(props) {
const {id} = props;
return ;
}