From 666c209e3438ee7b947dd9b59a556a92621ec3ee Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Thu, 25 Dec 2025 11:18:55 +0100 Subject: [PATCH] fix: shortened loading timeout period --- src/components/forms/bookform-delete/DeleteBook.tsx | 4 +--- .../forms/bookform-randomise/CreateUnreadBook.tsx | 2 +- .../bookform-randomise/CreateUnreadBookForm.tsx | 2 +- .../forms/bookform-randomise/DeleteBook.tsx | 2 +- .../forms/bookform-randomise/edit/EditForm.tsx | 2 +- .../forms/brotherform/EditCityAndCountry.tsx | 2 +- .../forms/brotherform/EditCityAndCountryButton.tsx | 2 +- src/components/forms/brotherform/EditGenre.tsx | 2 +- src/components/forms/brotherform/EditGenreButton.tsx | 2 +- src/components/forms/brotherform/EditUsername.tsx | 2 +- .../forms/brotherform/EditUsernameButton.tsx | 2 +- src/components/forms/brotherform/PictureUpload.tsx | 2 +- .../forms/brotherform/PictureUploadButton.tsx | 2 +- src/components/forms/commentform/CommentForm.tsx | 2 +- .../forms/commentform/EditCommentButton.tsx | 2 +- src/components/forms/commentform/EditCommentForm.tsx | 2 +- .../forms/ratingform/AnthologyRatingForm.tsx | 2 +- .../forms/ratingform/EditAnthologyRatingForm.tsx | 2 +- src/components/forms/ratingform/EditRatingForm.tsx | 2 +- src/components/forms/ratingform/RatingForm.tsx | 2 +- src/components/user/Login.tsx | 2 +- src/components/user/Login3D.tsx | 2 +- src/components/user/LoginForm.tsx | 12 +++++++++++- src/components/user/LoginForm3D.tsx | 9 ++++++++- src/components/user/Logout.tsx | 2 +- src/components/user/Logout3D.tsx | 2 +- src/hooks/crud-hooks/useForm.ts | 2 +- 27 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/components/forms/bookform-delete/DeleteBook.tsx b/src/components/forms/bookform-delete/DeleteBook.tsx index 852d58b..163009b 100644 --- a/src/components/forms/bookform-delete/DeleteBook.tsx +++ b/src/components/forms/bookform-delete/DeleteBook.tsx @@ -20,9 +20,7 @@ const DeleteBook: React.FC = ({ id }) => { handleSubmit() setTimeout(() => { resolve(null) - - // document.location.reload() - }, 3000) + }, 1250) }) return (
diff --git a/src/components/forms/bookform-randomise/CreateUnreadBook.tsx b/src/components/forms/bookform-randomise/CreateUnreadBook.tsx index a98d96a..352c47c 100644 --- a/src/components/forms/bookform-randomise/CreateUnreadBook.tsx +++ b/src/components/forms/bookform-randomise/CreateUnreadBook.tsx @@ -20,7 +20,7 @@ const CreateBook = () => { setConfirmLoading(true) setTimeout(() => { dispatch(setShowCreate()) - }, 4000) + }, 1250) setModalText() } const handleCancel = () => { diff --git a/src/components/forms/bookform-randomise/CreateUnreadBookForm.tsx b/src/components/forms/bookform-randomise/CreateUnreadBookForm.tsx index 3af3d42..5fb27d3 100644 --- a/src/components/forms/bookform-randomise/CreateUnreadBookForm.tsx +++ b/src/components/forms/bookform-randomise/CreateUnreadBookForm.tsx @@ -30,7 +30,7 @@ const CreateBook: React.FC = () => { const handleLoading = () => { enterLoading() - setTimeout(() => dispatch(setShowCreate()), 4000) + setTimeout(() => dispatch(setShowCreate()), 1250) } useEffect(() => { diff --git a/src/components/forms/bookform-randomise/DeleteBook.tsx b/src/components/forms/bookform-randomise/DeleteBook.tsx index cc701cf..c88af02 100644 --- a/src/components/forms/bookform-randomise/DeleteBook.tsx +++ b/src/components/forms/bookform-randomise/DeleteBook.tsx @@ -26,7 +26,7 @@ const DeleteBook: React.FC = ({ id }) => { setTimeout(() => { resolve(null) dispatch(setIsRefresh(false)) - }, 3000) + }, 1250) }) const popTheme = { diff --git a/src/components/forms/bookform-randomise/edit/EditForm.tsx b/src/components/forms/bookform-randomise/edit/EditForm.tsx index b825faa..10d4ed2 100644 --- a/src/components/forms/bookform-randomise/edit/EditForm.tsx +++ b/src/components/forms/bookform-randomise/edit/EditForm.tsx @@ -48,7 +48,7 @@ const EditForm: React.FC = ({ const handleForm = () => { if (inputError) return enterLoading() - setTimeout(() => dispatch(setShowEdit()), 4000) + setTimeout(() => dispatch(setShowEdit()), 1250) } const formData = useAppSelector((state) => state.bookFormData.formData) const dispatch = useAppDispatch() diff --git a/src/components/forms/brotherform/EditCityAndCountry.tsx b/src/components/forms/brotherform/EditCityAndCountry.tsx index e748234..b544565 100644 --- a/src/components/forms/brotherform/EditCityAndCountry.tsx +++ b/src/components/forms/brotherform/EditCityAndCountry.tsx @@ -62,7 +62,7 @@ const EditCityAndCountry: React.FC = ({ id, inCity, inCountry }) => { document.location.reload() return newLoadings }) - }, 4000) + }, 500) } return ( <> diff --git a/src/components/forms/brotherform/EditCityAndCountryButton.tsx b/src/components/forms/brotherform/EditCityAndCountryButton.tsx index 08e6488..9aace6b 100644 --- a/src/components/forms/brotherform/EditCityAndCountryButton.tsx +++ b/src/components/forms/brotherform/EditCityAndCountryButton.tsx @@ -33,7 +33,7 @@ const EditCityAndCountryButton: React.FC = ({ setConfirmLoading(true) setTimeout(() => { dispatch(setShowCountry()) - }, 4000) + }, 500) setModalText( ) diff --git a/src/components/forms/brotherform/EditGenre.tsx b/src/components/forms/brotherform/EditGenre.tsx index 61cbd25..e3c0f4d 100644 --- a/src/components/forms/brotherform/EditGenre.tsx +++ b/src/components/forms/brotherform/EditGenre.tsx @@ -61,7 +61,7 @@ const EditGenre: React.FC = ({ id, inGenre }) => { document.location.reload() return newLoadings }) - }, 4000) + }, 500) } return ( <> diff --git a/src/components/forms/brotherform/EditGenreButton.tsx b/src/components/forms/brotherform/EditGenreButton.tsx index eb38333..2ca3789 100644 --- a/src/components/forms/brotherform/EditGenreButton.tsx +++ b/src/components/forms/brotherform/EditGenreButton.tsx @@ -28,7 +28,7 @@ const EditGenreButton: React.FC = ({ id, inGenre }) => { setConfirmLoading(true) setTimeout(() => { dispatch(setShowGenre()) - }, 4000) + }, 500) setModalText() } const handleCancel = () => { diff --git a/src/components/forms/brotherform/EditUsername.tsx b/src/components/forms/brotherform/EditUsername.tsx index 8e4c056..497e79f 100644 --- a/src/components/forms/brotherform/EditUsername.tsx +++ b/src/components/forms/brotherform/EditUsername.tsx @@ -60,7 +60,7 @@ const EditUsername: React.FC = ({ id, inUsername }) => { document.location.reload() return newLoadings }) - }, 4000) + }, 500) } return ( <> diff --git a/src/components/forms/brotherform/EditUsernameButton.tsx b/src/components/forms/brotherform/EditUsernameButton.tsx index 80d20aa..f4ae154 100644 --- a/src/components/forms/brotherform/EditUsernameButton.tsx +++ b/src/components/forms/brotherform/EditUsernameButton.tsx @@ -28,7 +28,7 @@ const EditUsernameButton: React.FC = ({ id, inUsername }) => { setConfirmLoading(true) setTimeout(() => { dispatch(setShowUsername()) - }, 4000) + }, 500) setModalText() } const handleCancel = () => { diff --git a/src/components/forms/brotherform/PictureUpload.tsx b/src/components/forms/brotherform/PictureUpload.tsx index 164b42d..a276846 100644 --- a/src/components/forms/brotherform/PictureUpload.tsx +++ b/src/components/forms/brotherform/PictureUpload.tsx @@ -73,7 +73,7 @@ const PictureUpload: React.FC = ({ id, inImage }) => { document.location.reload() return newLoadings }) - }, 4000) + }, 500) } return ( diff --git a/src/components/forms/brotherform/PictureUploadButton.tsx b/src/components/forms/brotherform/PictureUploadButton.tsx index abf3c85..127038e 100644 --- a/src/components/forms/brotherform/PictureUploadButton.tsx +++ b/src/components/forms/brotherform/PictureUploadButton.tsx @@ -29,7 +29,7 @@ const PictureUploadButton: React.FC = ({ id, inImage }) => { setConfirmLoading(true) setTimeout(() => { dispatch(setShowImage()) - }, 4000) + }, 500) setModalText() } const handleCancel = () => { diff --git a/src/components/forms/commentform/CommentForm.tsx b/src/components/forms/commentform/CommentForm.tsx index cf14649..6bcfc94 100644 --- a/src/components/forms/commentform/CommentForm.tsx +++ b/src/components/forms/commentform/CommentForm.tsx @@ -32,7 +32,7 @@ const CommentForm = ({ id, handleCancel }: Props) => { enterLoading() setTimeout(() => { handleCancel() - }, 4000) + }, 1250) } return ( diff --git a/src/components/forms/commentform/EditCommentButton.tsx b/src/components/forms/commentform/EditCommentButton.tsx index bc3d4ed..f2f7eb6 100644 --- a/src/components/forms/commentform/EditCommentButton.tsx +++ b/src/components/forms/commentform/EditCommentButton.tsx @@ -28,7 +28,7 @@ const EditRatingButton = ({ setConfirmLoading(true) setTimeout(() => { setShowEditComment(false) - }, 4000) + }, 1250) } const handleCancel = () => { setShowEditComment(false) diff --git a/src/components/forms/commentform/EditCommentForm.tsx b/src/components/forms/commentform/EditCommentForm.tsx index 369567c..52bc6cd 100644 --- a/src/components/forms/commentform/EditCommentForm.tsx +++ b/src/components/forms/commentform/EditCommentForm.tsx @@ -33,7 +33,7 @@ const EditCommentForm: React.FC = ({ id, inComment, handleCancel }) => { enterLoading() setTimeout(() => { handleCancel() - }, 4000) + }, 1250) } return ( diff --git a/src/components/forms/ratingform/AnthologyRatingForm.tsx b/src/components/forms/ratingform/AnthologyRatingForm.tsx index 44f7bf9..09995c6 100644 --- a/src/components/forms/ratingform/AnthologyRatingForm.tsx +++ b/src/components/forms/ratingform/AnthologyRatingForm.tsx @@ -23,7 +23,7 @@ const AnthologyRatingForm: React.FC = ({ id, singleBook }) => { setTimeout(() => { setLoadings(false) document.location.reload() - }, 4000) + }, 1250) } const handleSubmit2 = async () => { diff --git a/src/components/forms/ratingform/EditAnthologyRatingForm.tsx b/src/components/forms/ratingform/EditAnthologyRatingForm.tsx index f3ed689..5e8134f 100644 --- a/src/components/forms/ratingform/EditAnthologyRatingForm.tsx +++ b/src/components/forms/ratingform/EditAnthologyRatingForm.tsx @@ -29,7 +29,7 @@ const EditAnthologyRatingForm: React.FC = ({ setTimeout(() => { setLoadings(false) document.location.reload() - }, 4000) + }, 1250) } const handleSubmit2 = async () => { diff --git a/src/components/forms/ratingform/EditRatingForm.tsx b/src/components/forms/ratingform/EditRatingForm.tsx index 07ac6eb..dba5f4d 100644 --- a/src/components/forms/ratingform/EditRatingForm.tsx +++ b/src/components/forms/ratingform/EditRatingForm.tsx @@ -42,7 +42,7 @@ const EditRatingForm: React.FC = ({ enterLoading() setTimeout(() => { handleCancel() - }, 4000) + }, 1250) } useEffect(() => { diff --git a/src/components/forms/ratingform/RatingForm.tsx b/src/components/forms/ratingform/RatingForm.tsx index 6b13a08..237139c 100644 --- a/src/components/forms/ratingform/RatingForm.tsx +++ b/src/components/forms/ratingform/RatingForm.tsx @@ -40,7 +40,7 @@ const RatingForm: React.FC = ({ enterLoading() setTimeout(() => { handleCancel() - }, 4000) + }, 1250) } useEffect(() => { diff --git a/src/components/user/Login.tsx b/src/components/user/Login.tsx index a0fa51f..e7058ce 100644 --- a/src/components/user/Login.tsx +++ b/src/components/user/Login.tsx @@ -20,7 +20,7 @@ const Login: React.FC = () => { setTimeout(() => { setLoginOpen(false) setConfirmLoading(false) - }, 2000) + }, 1000) setModalText() } const handleCancel = () => { diff --git a/src/components/user/Login3D.tsx b/src/components/user/Login3D.tsx index 05fd3a2..5e6ad98 100644 --- a/src/components/user/Login3D.tsx +++ b/src/components/user/Login3D.tsx @@ -20,7 +20,7 @@ const Login: React.FC = () => { setTimeout(() => { setLoginOpen(false) setConfirmLoading(false) - }, 2000) + }, 1000) setModalText() } const handleCancel = () => { diff --git a/src/components/user/LoginForm.tsx b/src/components/user/LoginForm.tsx index 64b0d6a..b543e21 100644 --- a/src/components/user/LoginForm.tsx +++ b/src/components/user/LoginForm.tsx @@ -41,7 +41,7 @@ const LoginForm: React.FC = ({ setLoginOpen }) => { login(data.token) setLoadings([false]) setLoginOpen(false) - }, 5000) + }, 1000) } } catch (err) { setError(err) @@ -53,6 +53,9 @@ const LoginForm: React.FC = ({ setLoginOpen }) => { components: { Input: { colorText: "black", + icons: { + color: "red", + }, }, }, } @@ -113,6 +116,13 @@ const LoginForm: React.FC = ({ setLoginOpen }) => { type="password" onChange={(e) => setPassword(e.target.value)} value={password} + styles={{ + suffix: { + background: "#095d09", + borderRadius: "20px", + padding: "0.25rem", + }, + }} /> diff --git a/src/components/user/LoginForm3D.tsx b/src/components/user/LoginForm3D.tsx index 2c1ca42..2312b47 100644 --- a/src/components/user/LoginForm3D.tsx +++ b/src/components/user/LoginForm3D.tsx @@ -37,7 +37,7 @@ const LoginForm3D: React.FC = ({ setLoginOpen }) => { localStorage.setItem("token", data.token) setLoadings([false]) setLoginOpen(false) - }, 5000) + }, 1000) } } catch (err) { setError(err) @@ -108,6 +108,13 @@ const LoginForm3D: React.FC = ({ setLoginOpen }) => { type="password" onChange={(e) => setPassword(e.target.value)} value={password} + styles={{ + suffix: { + background: "#095d09", + borderRadius: "20px", + padding: "0.25rem", + }, + }} /> diff --git a/src/components/user/Logout.tsx b/src/components/user/Logout.tsx index e853a82..ae25427 100644 --- a/src/components/user/Logout.tsx +++ b/src/components/user/Logout.tsx @@ -15,7 +15,7 @@ const Logout: React.FC = () => { localStorage.removeItem("username") setLoadings([false]) logout() - }, 3000) + }, 1000) } return (
diff --git a/src/components/user/Logout3D.tsx b/src/components/user/Logout3D.tsx index 8b0aa79..5d56b05 100644 --- a/src/components/user/Logout3D.tsx +++ b/src/components/user/Logout3D.tsx @@ -12,7 +12,7 @@ const Logout3D: React.FC = () => { localStorage.removeItem("username") localStorage.removeItem("token") setLoadings([false]) - }, 3000) + }, 1000) } return ( <> diff --git a/src/hooks/crud-hooks/useForm.ts b/src/hooks/crud-hooks/useForm.ts index 9edc3ca..77eb24d 100644 --- a/src/hooks/crud-hooks/useForm.ts +++ b/src/hooks/crud-hooks/useForm.ts @@ -60,7 +60,7 @@ const useForm = (url: string, reqType: string, customData?: object) => { setTimeout(() => { setLoadings(false) dispatch(setIsRefresh(false)) - }, 4000) + }, 1000) } return { handleSubmit, error, enterLoading, loadings, setError }