web client v0.5
//notifications //delete restaurant //change picture //redesigned data store
This commit is contained in:
@@ -8,15 +8,13 @@ import ButtonSecondary from "../Input/ButtonSecondary";
|
||||
import IconButton from "@material-ui/core/IconButton";
|
||||
import TextField from "@material-ui/core/TextField";
|
||||
import CloseIcon from "@material-ui/icons/Close";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { useDispatch } from "react-redux";
|
||||
import Link from "@material-ui/core/Link";
|
||||
import validator from "validator";
|
||||
import InputAdornment from "@material-ui/core/InputAdornment";
|
||||
import AccountCircle from "@material-ui/icons/AccountCircle";
|
||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||
import { remindPassword } from "../../actions";
|
||||
import { remindPassword, notification } from "../../actions";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { setReminderResult } from "../../actions/toggles";
|
||||
|
||||
export default function ForgotPassword(props) {
|
||||
const initialData = {
|
||||
@@ -24,12 +22,6 @@ export default function ForgotPassword(props) {
|
||||
emailError: false,
|
||||
};
|
||||
const [data, setData] = useState(initialData);
|
||||
const reminderResult = useSelector(
|
||||
(state) => state.data.dialogs.reminderResult
|
||||
);
|
||||
const reminderCircle = useSelector(
|
||||
(state) => state.data.dialogs.reminderCircularProgress
|
||||
);
|
||||
const dispatch = useDispatch();
|
||||
const history = useHistory();
|
||||
|
||||
@@ -82,7 +74,7 @@ export default function ForgotPassword(props) {
|
||||
if (validateLogin()) {
|
||||
dispatch(remindPassword(data.email));
|
||||
} else {
|
||||
dispatch(setReminderResult("Podaj poprawne dane."));
|
||||
dispatch(notification("Podaj poprawne dane.", "error"));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -129,10 +121,6 @@ export default function ForgotPassword(props) {
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<p>
|
||||
{reminderResult}
|
||||
<span>{reminderCircle && <CircularProgress />}</span>
|
||||
</p>
|
||||
<div className="login-dialog-buttons">
|
||||
<ButtonSecondary
|
||||
onClick={() => handleRemind()}
|
||||
|
||||
Reference in New Issue
Block a user