diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 90383a1..06ed6aa 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -19,6 +19,7 @@ }, "Login": { "Username": "Username", - "Password": "Password" + "Password": "Password", + "Label": "Login" } } diff --git a/public/locales/ro/translations.json b/public/locales/ro/translations.json index f44da64..644e73e 100644 --- a/public/locales/ro/translations.json +++ b/public/locales/ro/translations.json @@ -10,6 +10,7 @@ }, "Login": { "Username": "Utilizator", - "Password": "Parolă" + "Password": "Parolă", + "Label": "Autentificare" } } diff --git a/src/features/login/components/LoginComponent.js b/src/features/login/components/LoginComponent.js index 997f9f7..155fa24 100644 --- a/src/features/login/components/LoginComponent.js +++ b/src/features/login/components/LoginComponent.js @@ -1,12 +1,9 @@ -import React, { useContext } from "react"; +import React from "react"; +import PropTypes from "prop-types"; import { makeStyles } from "@material-ui/core/styles"; -import { TextField, InputAdornment } from "@material-ui/core"; +import { TextField, InputAdornment, Button } from "@material-ui/core"; import { AccountCircleOutlined } from "@material-ui/icons"; import PasswordField from "../../../components/common/inputs/PasswordField"; -import { - ApplicationStateContext, - ApplicationDispatchContext -} from "../../../state/ApplicationContexts"; import { useTranslation } from "react-i18next"; const useStyles = makeStyles(theme => ({ @@ -16,25 +13,18 @@ const useStyles = makeStyles(theme => ({ } })); -const LoginComponent = () => { +const LoginComponent = ({ credentials, onChange, onLogin }) => { const classes = useStyles(); const { t } = useTranslation(); - const state = useContext(ApplicationStateContext); - const dispatchActions = useContext(ApplicationDispatchContext); - - const handleChange = prop => event => { - dispatchActions.onCredentialsChange(prop, event.target.value); - }; - return (