import React, { PropTypes, Component } from "react"; import { Link } from "react-router-dom"; import { Container, Header, Form, Grid, Segment, Input, Button, Message, Icon, Divider } from "semantic-ui-react"; // ---------------------------------------------------- const dividerStyle = { marginTop: "40px" }; const forgotStyle = { marginTop: "40px", textAlign: "right" }; // ---------------------------------------------------- class Login extends Component { constructor(props) { super(props); this._onLoginSubmit = this._onLoginSubmit.bind(this); this.handleInputChange = this.handleInputChange.bind(this); this.handleRegisterClick = this.handleRegisterClick.bind(this); } state = { loginMessage: "", email: "", password: "" }; handleRegisterClick = () => { this.props.changeUrl("/register"); }; handleInputChange = (e, { name, value }) => this.setState({ [name]: value }); _onLoginSubmit(event) { event.preventDefault(); const { email, password } = this.state; var success = {type: "path", nextPathname: "/" }; if (this.props.nextPathname) { success.nextPathname = this.props.nextPathname; } if (this.props.nextLocation) { success.type = "location"; switch(this.props.nextLocation) { case "admin": success.nextLocation = admin_server; break; case "frontend": success.nextLocation = frontend_server; break; } } // Passed in via react-redux. Returns a promise. this.props .manualLogin( { // this function is passed in via react-redux email, password }, success ) // holds the path to redirect to after login (if any) .then(loginMessage => { if (loginMessage) { // report to the user is there was a problem during login this.setState({ loginMessage }); } }); } render() { var loginMessage = ""; const { name, email } = this.state; if (this.state.loginMessage) { loginMessage = ( Problems... {this.state.loginMessage} ); } return (
{site_name}
Let's get this started!
{site_name} makes it easy to share recordings from{" "} Trunk Recorder .

Trunk Recorder makes it easy to record the radio systems used by your local police and fire department. Trunk Recorder is sort of like an awesome version of those Scanners from Radio Shack... 10-4!

This site is a work in progress. I plan on adding more features over time, but right now it can:

  • 3 day archive
  • Filter by talkgroup

All of this goodness is free! In the future, I might offer paid accounts with additional features and a longer archive period, but I will always try to have a free version.

{" "} - Luke{" "} admin@email.com {" "}

Need an account?
{loginMessage}
Forgot Password
); } } export default Login;