login btn alignment adjusted
This commit is contained in:
@@ -3,11 +3,37 @@ import LoginImg from '../../assets/bg/login.svg'
|
||||
|
||||
import { Link, useNavigate } from 'react-router-dom'
|
||||
import siteLinks from '../../links/siteLinks'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
|
||||
export default function Forgetpwd2() {
|
||||
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [email, setEmail] = useState('')
|
||||
|
||||
const handleChange = ({target:{value}}) => {
|
||||
setEmail(value)
|
||||
}
|
||||
|
||||
const forgetPwd = useMutation({
|
||||
mutationFn: (email) => {
|
||||
// if(!email.username || !email.password){
|
||||
// throw new Error('Please provide all email marked *')
|
||||
// }
|
||||
// return loginUser('panel/auth/login', {email})
|
||||
throw new Error('Unable to complete, try again later!')
|
||||
},
|
||||
onError: (error) => {
|
||||
console.log(error)
|
||||
},
|
||||
onSuccess: (res) => {
|
||||
// const {token} = res?.data?.data
|
||||
// if(token){
|
||||
// navigate('/dash') // later add redux to dispatch state
|
||||
// }
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<div className="app">
|
||||
<div className="app-wrap">
|
||||
@@ -25,11 +51,18 @@ export default function Forgetpwd2() {
|
||||
<div className="col-12">
|
||||
<div className="form-group">
|
||||
<label className="control-label">Email*</label>
|
||||
<input type="text" className="form-control" placeholder="Email" />
|
||||
<input name='email' type="text" onChange={handleChange} value={email} className="form-control" placeholder="Email" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-12 mt-3">
|
||||
<button type='button' onClick={()=>{navigate(siteLinks.dash)}} className="btn btn-primary text-uppercase">Send</button>
|
||||
{forgetPwd.error &&
|
||||
<>
|
||||
<div className="col-12 mt-3">
|
||||
<p className='text-danger'>{forgetPwd.error.message}</p>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
<div className="col-12 mt-3 text-end">
|
||||
<button type='button' onClick={()=>{forgetPwd.mutate(email)}} className="btn btn-primary text-uppercase">Send</button>
|
||||
</div>
|
||||
<div className="col-12 mt-3">
|
||||
<p>Go <Link to={siteLinks.home}> Back</Link></p>
|
||||
|
||||
@@ -89,7 +89,7 @@ export default function Login() {
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
<div className="col-12 mt-3">
|
||||
<div className="col-12 mt-3 text-end">
|
||||
<button type='button' onClick={()=>{login.mutate(fields)}} className="btn btn-primary text-uppercase">{login.isPending ? 'loading...' : 'Sign In'}</button>
|
||||
</div>
|
||||
<div className="col-12 mt-3">
|
||||
|
||||
@@ -60,7 +60,7 @@ export default function Signup2() {
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 mt-3">
|
||||
<div class="col-12 mt-3 text-end">
|
||||
<button type='button' onClick={()=>navigate(siteLinks.dash)} class="btn btn-primary text-uppercase">Sign up</button>
|
||||
</div>
|
||||
<div class="col-12 mt-3">
|
||||
|
||||
Reference in New Issue
Block a user