import React, { useEffect } from 'react' import { FormattedMessage, useIntl } from 'react-intl' import { Link as RouterLink } from 'react-router-dom' import Header from '../layout/header' import Footer from '../layout/footer' import SubmitButton from '../form/submit-button' import Input from '../form/input' import GlobalError from '../form/global-error' import FormContainer from '../layout/form-container' import Typography from '@material-ui/core/Typography' import FormControl from '@material-ui/core/FormControl' import Link from '@material-ui/core/Link' type ConfigStatusProps = { enabled?: boolean } const ConfigStatusMessage = ({ enabled = false }: ConfigStatusProps): React.ReactElement => { let result if (enabled === true) { result = (

{' '} here

) } return result || null } const LoginError = () => { // @Todo: This must be reviewed to be based on navigation state. // Login error example: http://localhost:8080/c/login?login.error=2 const errorCode = new URLSearchParams(window.location.search).get('login_error') const intl = useIntl() let msg: null | string = null if (errorCode) { switch (errorCode) { case '3': msg = intl.formatMessage({ id: 'login.userinactive', defaultMessage: "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!.", }) break default: msg = intl.formatMessage({ id: 'login.error', defaultMessage: 'The email address or password you entered is not valid.', }) } } return msg ? : null } const LoginPage = (): React.ReactElement => { const intl = useIntl() useEffect(() => { document.title = 'Login | WiseMapping' }) return (
) } export default LoginPage