Timer dedup
This commit is contained in:
parent
93b430594c
commit
fad7653615
|
|
@ -8,6 +8,12 @@ import {logout} from '../api';
|
||||||
import {notify} from 'react-notify-toast';
|
import {notify} from 'react-notify-toast';
|
||||||
import {Timer} from './Timer';
|
import {Timer} from './Timer';
|
||||||
|
|
||||||
|
const TournamentTimer = ({timerEnd, className}) => (
|
||||||
|
<NavbarText className={className}>
|
||||||
|
<span className={'hide-below-340-w'}>Spielzeit: </span><Timer timerEnd={timerEnd}/>
|
||||||
|
</NavbarText>
|
||||||
|
);
|
||||||
|
|
||||||
export class TurniereNavigation extends React.Component {
|
export class TurniereNavigation extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -26,17 +32,13 @@ export class TurniereNavigation extends React.Component {
|
||||||
<Navbar color="light" light expand="lg" sticky="top">
|
<Navbar color="light" light expand="lg" sticky="top">
|
||||||
<NavbarBrand className={'hide-below-260-w'} href="/">turnie.re</NavbarBrand>
|
<NavbarBrand className={'hide-below-260-w'} href="/">turnie.re</NavbarBrand>
|
||||||
{tournament && tournament.timerEnd &&
|
{tournament && tournament.timerEnd &&
|
||||||
<NavbarText className="m-auto hide-above-992-w">
|
<TournamentTimer timerEnd={tournament.timerEnd} className="m-auto hide-above-992-w"/>
|
||||||
<span className={'hide-below-340-w'}>Spielzeit: </span><Timer timerEnd={tournament.timerEnd} />
|
|
||||||
</NavbarText>
|
|
||||||
}
|
}
|
||||||
<NavbarToggler onClick={this.toggle}/>
|
<NavbarToggler onClick={this.toggle}/>
|
||||||
<Collapse isOpen={!this.state.collapsed} navbar>
|
<Collapse isOpen={!this.state.collapsed} navbar>
|
||||||
<NavLinks/>
|
<NavLinks/>
|
||||||
{tournament && tournament.timerEnd &&
|
{tournament && tournament.timerEnd &&
|
||||||
<NavbarText className="m-auto hide-below-992-w">
|
<TournamentTimer timerEnd={tournament.timerEnd} className="m-auto hide-below-992-w"/>
|
||||||
<span className={'hide-below-340-w'}>Spielzeit: </span><Timer timerEnd={tournament.timerEnd} />
|
|
||||||
</NavbarText>
|
|
||||||
}
|
}
|
||||||
<div className="ms-auto">
|
<div className="ms-auto">
|
||||||
<LoginLogoutButtons/>
|
<LoginLogoutButtons/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue