'use strict'; import React from 'react'; import Button from 'react-bootstrap/lib/Button'; import ButtonGroup from 'react-bootstrap/lib/ButtonGroup'; import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'; import PrizeActions from '../actions/prize_actions'; import PrizeStore from '../stores/prize_store'; import { getLangText } from '../../../../../utils/lang_utils'; let Landing = React.createClass({ propTypes: { // Provided from PrizeApp currentUser: React.PropTypes.object, whitelabel: React.PropTypes.object, // Provided from router location: React.PropTypes.object }, getInitialState() { return PrizeStore.getState(); }, componentDidMount() { PrizeStore.listen(this.onChange); PrizeActions.fetchPrize(); }, componentWillUnmount() { PrizeStore.unlisten(this.onChange); }, onChange(state) { this.setState(state); }, getButtons() { if (this.state.prize && this.state.prize.active) { return ( ); } else { return ( ); } }, getTitle() { const { prize } = this.state; return (

{getLangText(prize && prize.active ? 'This is the submission page for Sluice_screens ↄc Prize 2015.' : 'Submissions for Sluice_screens ↄc Prize 2015 are now closed.')}

); }, render() { return (

{getLangText('Sluice_screens ↄc Prize 2015')}

{this.getTitle()} {this.getButtons()}
); } }); export default Landing;