import { Button, ButtonGroup, Collapse, Nav, Navbar, NavbarBrand, NavbarText, NavbarToggler, NavItem, NavLink } from 'reactstrap'; import {connect} from 'react-redux'; import React from 'react'; import {logout} from '../api'; import {notify} from 'react-notify-toast'; import {Timer} from './Timer'; const TournamentTimer = ({timerEnd, className}) => ( Spielzeit: ); export class TurniereNavigation extends React.Component { constructor(props) { super(props); this.toggle = this.toggle.bind(this); this.state = {collapsed: true}; } toggle() { this.setState({collapsed: !this.state.collapsed}); } render() { const {tournament} = this.props; return ( turnie.re {tournament && tournament.timerEnd && } {tournament && tournament.timerEnd && }
); } } function Navlink(props) { return ( {props.text} ); } class SmartNavLinks extends React.Component { render() { return (); } } class InvisibleLoginLogoutButtons extends React.Component { logout() { logout(() => notify.show('Du bist jetzt abgemeldet.', 'success', 2500)); } render() { const {isSignedIn, username} = this.props; if (isSignedIn) { return ( ); } else { return ( ); } } } const mapStateToUserinfo = state => { const {isSignedIn, username} = state.userinfo; return {isSignedIn, username}; }; const LoginLogoutButtons = connect(mapStateToUserinfo)(InvisibleLoginLogoutButtons); const NavLinks = connect(mapStateToUserinfo)(SmartNavLinks);