import React, { Component } from "react"; import { Button, Form, Grid, Header, Image, Message, Icon, Checkbox, Input, } from "semantic-ui-react"; export default class Login extends Component { constructor(props) { super(props); this.state = { user: "", password: "", fireRedirect: false, error: { state: false, message: "" }, }; } handleLogin = (e) => { e.preventDefault(); const params = { usernameOrEmail: this.state.user, password: this.state.password, }; this.props .auth({ user: this.state.user, params: params, }) .then((res) => { if (res.status === 200) { } else { this.setState({ error: { state: true, message: "Errore" } }); } }) .catch((err) => { console.log(err); }); }; onChangeHandler = (event) => { let nam = event.target.name; let val = event.target.value; this.setState({ [nam]: val }); }; toggle = () => this.setState((prevState) => ({ rememberme: !prevState.rememberme })); render() { return (
Log-in to SmartHut

Forgot Password?

New to us? Sign Up

); } }