-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5314a25
commit 51b8d2b
Showing
11 changed files
with
11,445 additions
and
7,090 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import React, { Fragment } from "react"; | ||
import spinner from "./spinner.gif"; | ||
|
||
export default () => { | ||
return ( | ||
<Fragment> | ||
<img | ||
className='pt-5' | ||
src={spinner} | ||
style={{ width: "200px", margin: "auto", display: "block" }} | ||
alt='Loading...' | ||
/> | ||
<div className='text-center text-light'> | ||
<span | ||
className='spinner-border mt-5' | ||
style={{ width: "200px", height: "200px" }} | ||
></span> | ||
</div> | ||
</Fragment> | ||
); | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default function ChangePasswordValidate(formData) { | ||
let errors = {}; | ||
const { password, password2 } = formData; | ||
|
||
if (!password) { | ||
errors.password = "Password is required"; | ||
} else if (password.length < 6) { | ||
errors.password = | ||
"Minimum length of the password must be equal or greater than 6 characters"; | ||
} else if (!password2) { | ||
errors.password2 = "Confirm Password is required"; | ||
} else if (password !== password2) { | ||
errors.password2 = "Password and Confirm Password does not match"; | ||
} | ||
return errors; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default function LoginValidate(formData) { | ||
let errors = {}; | ||
const { email, password } = formData; | ||
|
||
if (!email) { | ||
errors.email = "Email is required"; | ||
} else if (!/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]/.test(email)) { | ||
errors.email = "Invalid email"; | ||
} else if (!password) { | ||
errors.password = "Password is required"; | ||
} | ||
return errors; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export default function RegisterValidate(formData) { | ||
let errors = {}; | ||
const { name, email, password, password2, role } = formData; | ||
|
||
if (!name) { | ||
errors.name = "Name is required"; | ||
} else if (!email) { | ||
errors.email = "Email is required"; | ||
} else if (!/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]/.test(email)) { | ||
errors.email = "Invalid email"; | ||
} else if (!role) { | ||
errors.role = "Role is required"; | ||
} else if (!password) { | ||
errors.password = "Password is required"; | ||
} else if (password.length < 8) { | ||
errors.password = | ||
"Minimum length of the password must be equal or greater than 8 characters"; | ||
} else if (!password2) { | ||
errors.password2 = "Confirm Password is required"; | ||
} else if (password !== password2) { | ||
errors.password2 = "Password and Confirm Password does not match"; | ||
} | ||
return errors; | ||
} |