Open saurabswaarm opened 1 year ago
const {value} = event.target
will be enough. Avoid unnecessary destructuring arguments.
running validation twice, you only need to run it once. Just directly access it from the state error object and remove line 45 to 52.
if (errorUserData.emaiId === "" && errorUserData.userName === "" && errorUserData.password === "") {
localStorage.setItem("registered_user", JSON.stringify(userData));
navigate("/");
//localstorageCheck
}
We need a way to disable submit, please use a global isValid state object to disable submitting.
Avoid redundant classes, col-xs-12 and col-md-6 should suffice.
changing this to height 100% will be better
height 100% does not match the given image for desired output width 100% works here
We need a way to disable submit, please use a global isValid state object to disable submitting.
error handling is done and error is displayed on invalid entries
There is code repetition happening for validation. Validation code is being called twice. Your code can be shortened a lot.
If you want to use width:100%, use object-fit property as well.
https://github.com/Mrsandesh399/sundaytech_assignment/blob/12afddbe20b486f5e29923549fbb65a1685a3f73/src/Component/Login/index.jsx#L54
Avoid redundant classes, col-xs-12 and col-md-6 should suffice.
https://github.com/Mrsandesh399/sundaytech_assignment/blob/12afddbe20b486f5e29923549fbb65a1685a3f73/src/Component/Login/loginStyles.css#L8
changing this to height 100% will be better