var React = require('react');
var Link = require('react-router').Link;

var Search = React.createClass({
    getInitialState: function() {
        return { showResults: false };
    },
    onClick: function() {
        this.setState({ showResults: true });
    },
    render: function() {
    	var loginButton;
		if (this.state.showResults) {
		  loginButton = <Results />;
		}
		console.log(this.state)
        return (
            <div>
                <input type="submit" value="Search" onClick={this.onClick} />
                { loginButton }
            </div>
        );
    }
});

var Results = React.createClass({
    render: function() {
        return (
            <div id="results" className="search-results">
                Some Results
            </div>
        );
    }
});

class LandingPage extends React.Component {
	render() {
		return (
			<Search />
		);
	}
}

module.exports = LandingPage;
