Skip to content

Commit

Permalink
fix: adding suggested edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Endless8 committed Nov 28, 2023
1 parent 856161a commit 37736d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/hooks/useValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,12 @@ const useValidation = (credentials, userSignup, clubSignup) => {
}
}

if (credentials.website) {
if (!urlRegex.test(credentials.website)) {
errors.push({
error: true,
message: "Please enter a valid website",
field: "website",
});
}
if (credentials.website && !urlRegex.test(credentials.website)) {
errors.push({
error: true,
message: "Please enter a valid website",
field: "website",
});
}
if (userSignup || clubSignup) {
if (!credentials.slug) {
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Auth/AuthSignup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ const AuthSignup = () => {
/>
{renderErrorMessage("email")}
</div>

<div className="auth_passworddiv">
<div className="authform_container">
<label htmlFor="password" className="auth_label">
Expand All @@ -261,10 +262,10 @@ const AuthSignup = () => {
id="password"
placeholder="StrongPassword123"
/>
{renderErrorMessage("password")}
<div onClick={passwordToggle} className="toggle-button">
{passwordType === "password" ? <FiEyeOff /> : <FiEye />}
</div>
{renderErrorMessage("password")}
</div>
<div className="authform_container">
<label htmlFor="confirmPassword" className="auth_label">
Expand All @@ -280,7 +281,6 @@ const AuthSignup = () => {
id="confirmPassword"
placeholder="StrongPassword123"
/>
{renderErrorMessage("confirmPassword")}
<div
onClick={confirmPasswordToggle}
className="toggle-button"
Expand All @@ -291,6 +291,7 @@ const AuthSignup = () => {
<FiEye />
)}
</div>
{renderErrorMessage("confirmPassword")}
</div>
</div>

Expand Down

0 comments on commit 37736d1

Please sign in to comment.