// eslint-disable-next-line
import React from "react";
import { connect } from "react-redux";
import { Redirect } from "react-router-dom";
import { styled } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Paper from '@material-ui/core/Paper';
import Typography from '@material-ui/core/Typography';
import { AuthenticationService } from "api";
import { LoginForm } from "forms";
import { RouteEnum } from "types";
import { /* ServerDispatch, */ ServerSelectors } from "store";
import "./Login.css";
import logo from "images/logo.png";
const Login = ({ state, description }: LoginProps) => {
const isConnected = AuthenticationService.isConnected(state);
const showDescription = () => {
return !isConnected && description?.length;
}
const createAccount = () => {
console.log('Login.createAccount->openForgotPasswordDialog');
};
return (
{ isConnected &&
}
COCKATRICE
Login
A cross-platform virtual tabletop for multiplayer card games.
{
showDescription() && (
{description}
)
}
Not registered yet?
Cockatrice is an open source project @{ new Date().getUTCFullYear() }
description
);
}
const ThemedLoginContent = styled('div')(({ theme }) => ({
backgroundColor: theme.palette.background.paper
}));
const ThemedLoginDescription = styled('div')(({ theme }) => ({
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastText,
}));
const ThemedLoginHeader = styled('div')(({ theme }) => ({
color: theme.palette.success.light
}));
interface LoginProps {
state: number;
description: string;
}
const mapStateToProps = state => ({
state: ServerSelectors.getState(state),
description: ServerSelectors.getDescription(state),
});
export default connect(mapStateToProps)(Login);