forgot password

This commit is contained in:
pawan-dot 2022-07-25 17:47:31 +05:30
parent b8f51b41bd
commit 1d5ae904f9
10 changed files with 129 additions and 11 deletions

View File

@ -107,6 +107,11 @@ const AddEvent = () => {
placeholder="Title (maximum 50 characters)" />
</CInputGroup>
{title ? <><span className="charLeft mt-4 fst-italic">
{50 - title.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
@ -119,6 +124,11 @@ const AddEvent = () => {
value={description}
placeholder="Description (maximum 250 characters)" />
</CInputGroup>
{description ? <><span className="charLeft mt-4 fst-italic">
{250 - description.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
{/* Date* */}

View File

@ -127,6 +127,11 @@ const EditEvent = () => {
value={title}
placeholder="Title (maximum 50 characters)" />
</CInputGroup>
{title ? <><span className="charLeft mt-4 fst-italic">
{50 - title.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilAudioDescription} />
@ -138,6 +143,11 @@ const EditEvent = () => {
value={description}
placeholder="Description (maximum 250 characters)" />
</CInputGroup>
{description ? <><span className="charLeft mt-4 fst-italic">
{250 - description.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
{/* Date* */}

View File

@ -101,9 +101,15 @@ const AddFaqs = () => {
value={topic}
placeholder="Topic ( maximum 50 character )" />
</CInputGroup>
{topic ? <><span className="charLeft mb-3 fst-italic">
{50 - topic.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<label htmlFor="exampleFormControlTextarea1" className="form-label">Description*</label>
<label htmlFor="exampleFormControlTextarea1" className="form-label fw-bold">Description*</label>
<textarea
className="h-50 w-100"
maxlength='500'
@ -113,7 +119,11 @@ const AddFaqs = () => {
rows="5"
placeholder="Description ( maximum 500 character )">ewf3g</textarea>
</CInputGroup>
{description ? <><span className="charLeft fst-italic mb-3">
{500 - description.length} characters left
</span></> : <></>
}
{/* <CInputGroup className="mb-3">

View File

@ -113,9 +113,14 @@ const EditFaqs = () => {
value={topic}
placeholder="Topic ( maximum 50 character )" />
</CInputGroup>
{topic ? <><span className="charLeft mb-3 fst-italic">
{50 - topic.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3 d-flex">
<label htmlFor="exampleFormControlTextarea1" className="form-label">Description*</label>
<label htmlFor="exampleFormControlTextarea1" className="form-label fw-bold">Description*</label>
<textarea
className="h-50 w-100"
maxlength='500'
@ -125,7 +130,11 @@ const EditFaqs = () => {
rows="5"
placeholder="Description ( maximum 500 character )">ewf3g</textarea>
</CInputGroup>
{description ? <><span className="charLeft fst-italic mb-3">
{500 - description.length} characters left
</span></> : <></>
}
{/* <CInputGroup className="mb-3">

View File

@ -134,7 +134,13 @@ const AddOffer = () => {
onChange={(e) => setTitle(e.target.value)}
value={title}
placeholder="Title (maximum 50 characters)" />
</CInputGroup>
{title ? <><span className="charLeft mt-4 fst-italic">
{50 - title.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
@ -147,6 +153,11 @@ const AddOffer = () => {
value={description}
placeholder="Description (maximum 250 characters)" />
</CInputGroup>
{description ? <><span className="charLeft mt-4 fst-italic">
{250 - description.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilBell} />

View File

@ -144,7 +144,11 @@ const EditOffer = () => {
value={title}
placeholder="Title (maximum 50 characters)" />
</CInputGroup>
{title ? <><span className="charLeft mt-4 fst-italic">
{50 - title.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilAudioDescription} />
@ -156,6 +160,11 @@ const EditOffer = () => {
value={description}
placeholder="Description (maximum 250 characters)" />
</CInputGroup>
{description ? <><span className="charLeft mt-4 fst-italic">
{250 - description.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilBell} />

View File

@ -123,6 +123,11 @@ const AddRequirement = () => {
value={title}
placeholder="Title (maximum 50 characters)" />
</CInputGroup>
{title ? <><span className="charLeft mt-4 fst-italic">
{50 - title.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilObjectGroup} />
@ -145,7 +150,11 @@ const AddRequirement = () => {
value={description}
placeholder="Description (maximum 250 characters)" />
</CInputGroup>
{description ? <><span className="charLeft mt-4 fst-italic">
{250 - description.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">

View File

@ -138,6 +138,11 @@ const EditRequirement = () => {
value={title}
placeholder="Title (maximum 50 characters)" />
</CInputGroup>
{title ? <><i className="charLeft mt-4 fst-italic">
{50 - title.length} characters left
</i></> : <></>
}
<CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilObjectGroup} />
@ -160,7 +165,11 @@ const EditRequirement = () => {
value={description}
placeholder="Description (maximum 250 characters)" />
</CInputGroup>
{description ? <><span className="charLeft mt-4 fst-italic">
{250 - description.length} characters left
</span></> : <></>
}
<CInputGroup className="mb-3">

View File

@ -104,11 +104,11 @@ const Login = () => {
</Link>
<br />
{/* <CButton color="link" className="px-0">
<CButton color="link" className="px-0">
<Link to="/forgot">
Forgot password?
Forgot password.?
</Link>
</CButton> */}
</CButton>
</CForm>

View File

@ -1,5 +1,9 @@
import React from 'react';
import React, { useState } from 'react'
import axios from 'axios';
import ClipLoader from "react-spinners/ClipLoader";
import {
CButton,
CCard,
CCardBody,
@ -13,9 +17,41 @@ import {
} from '@coreui/react'
import CIcon from '@coreui/icons-react'
import { cilEnvelopeLetter, cilEnvelopeOpen, cilLockLocked, cilUser } from '@coreui/icons'
import { Link } from 'react-router-dom';
import { Link, useHistory } from 'react-router-dom';
import swal from 'sweetalert';
const ForgotPassword = () => {
const history = useHistory()
const [loading, setLoading] = useState(false);
const [email, setEmail] = useState()
// console.log(email)
const handleSubmit = async () => {
if (email) {
try {
setLoading(true)
const res = await axios.post(`/api/v1/user/password/forgot`, { email: email })
//console.log(res);
if (res.data.success === true) {
setLoading(false)
// alert("Email Send Successfully! please check your mail for reset password")
swal("success!", "Email Send Successfully! please check your Email for new password", "success");
history.push("/");
}
} catch (e) {
alert("You are not a User")
setLoading(false)
}
} else {
alert("please fill Email field..")
setLoading(false)
}
}
return <div className="bg-light min-vh-100 d-flex flex-row align-items-center">
<CContainer>
<CRow className="justify-content-center">
@ -24,7 +60,7 @@ const ForgotPassword = () => {
<CCardBody className="p-4">
<CForm>
<h1>Forgot Password?</h1>
<p className="text-medium-emphasis"> Enter your email Below we will send you a link to reset your password</p>
<p className="text-medium-emphasis"> Enter your email Below, we will send you password in your Email</p>
{/* <CInputGroup className="mb-3">
<CInputGroupText>
<CIcon icon={cilUser} />
@ -37,15 +73,20 @@ const ForgotPassword = () => {
<CIcon icon={cilEnvelopeOpen} />
</CInputGroupText>
<CFormInput
type="password"
type="email"
placeholder="Email"
autoComplete="email"
// value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</CInputGroup>
<CButton color="dark">Send</CButton>
<CButton color="primary" disabled={!email} onClick={() => handleSubmit()}>
<ClipLoader loading={loading} size={18} />
{!loading && "Send"}
</CButton>
<Link to='/'>
<CButton color="dark" className='ms-2'>Back to Login</CButton>
<CButton color="secondary" className='ms-2'>Back to Login</CButton>
</Link>
</CForm>
</CCardBody>