Skip to content

Commit

Permalink
Increased form error message timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Nov 1, 2023
1 parent fdc1266 commit b46cdb3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/public/components/get-code.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigurationContext } from "../context/configuration.js";
import { getPlaceholder, useTitle } from "../utils/utils.js";
import { errorTextTimeout, getPlaceholder, useTitle } from "../utils/utils.js";

export default function GetCode() {
const submitButtonText = "Get Code";
Expand All @@ -21,7 +21,7 @@ export default function GetCode() {
setTimeout(() => {
setButtonText(submitButtonText);
setHasError(false);
}, 2000);
}, errorTextTimeout);
};

function getCode(event) {
Expand Down
4 changes: 2 additions & 2 deletions src/public/components/login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigurationContext } from "../context/configuration.js";
import { ThemeContext } from "../context/theme.js";
import { prepareAuthorizationParams, getPlaceholder, isEmail, useTitle, uuidv4 } from "../utils/utils.js";
import { prepareAuthorizationParams, getPlaceholder, isEmail, useTitle, uuidv4, errorTextTimeout } from "../utils/utils.js";

export default function Login() {
const submitButtonText = "Login";
Expand Down Expand Up @@ -41,7 +41,7 @@ export default function Login() {
setTimeout(() => {
setButtonText(submitButtonText);
setHasError(false);
}, 2000);
}, errorTextTimeout);
};

function onFieldError({ response, buttonText }) {
Expand Down
4 changes: 2 additions & 2 deletions src/public/components/reset-password.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigurationContext } from "../context/configuration.js";
import { getPlaceholder, useTitle } from "../utils/utils.js";
import { errorTextTimeout, getPlaceholder, useTitle } from "../utils/utils.js";

export default function ResetPassword() {
const submitButtonText = "Change Password";
Expand All @@ -21,7 +21,7 @@ export default function ResetPassword() {
setTimeout(() => {
setButtonText(submitButtonText);
setHasError(false);
}, 2000);
}, errorTextTimeout);
};

function resetPassword(event) {
Expand Down
4 changes: 2 additions & 2 deletions src/public/components/signup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigurationContext } from "../context/configuration.js";
import { ThemeContext } from "../context/theme.js";
import { countryCodes } from "../utils/country-codes.js";
import { getPlaceholder, useTitle } from "../utils/utils.js";
import { errorTextTimeout, getPlaceholder, useTitle } from "../utils/utils.js";

export default function SignUp() {
const submitButtonText = "Create Account";
Expand Down Expand Up @@ -29,7 +29,7 @@ export default function SignUp() {
setTimeout(() => {
setButtonText(submitButtonText);
setHasError(false);
}, 2000);
}, errorTextTimeout);
};

function onFieldError({ response }) {
Expand Down
4 changes: 2 additions & 2 deletions src/public/components/verify-account.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigurationContext } from "../context/configuration.js";
import { getPlaceholder, useTitle } from "../utils/utils.js";
import { errorTextTimeout, getPlaceholder, useTitle } from "../utils/utils.js";

export default function VerifyAccount() {
const submitButtonText = "Verify";
Expand All @@ -21,7 +21,7 @@ export default function VerifyAccount() {
setTimeout(() => {
setButtonText(submitButtonText);
setHasError(false);
}, 2000);
}, errorTextTimeout);
};

function verifyAccount(event) {
Expand Down
2 changes: 2 additions & 0 deletions src/public/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,5 @@ export function prepareAuthorizationParams(configuration) {
}
return params;
}

export const errorTextTimeout = 6000;

0 comments on commit b46cdb3

Please sign in to comment.