Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/forms/bookform-delete/DeleteBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const DeleteBook: React.FC<Props> = ({ id }) => {
handleSubmit()
setTimeout(() => {
resolve(null)

// document.location.reload()
}, 3000)
}, 1250)
})
return (
<div className="m-5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const CreateBook = () => {
setConfirmLoading(true)
setTimeout(() => {
dispatch(setShowCreate())
}, 4000)
}, 1250)
setModalText(<CreateBookForm />)
}
const handleCancel = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CreateBook: React.FC = () => {

const handleLoading = () => {
enterLoading()
setTimeout(() => dispatch(setShowCreate()), 4000)
setTimeout(() => dispatch(setShowCreate()), 1250)
}

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/bookform-randomise/DeleteBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DeleteBook: React.FC<Props> = ({ id }) => {
setTimeout(() => {
resolve(null)
dispatch(setIsRefresh(false))
}, 3000)
}, 1250)
})

const popTheme = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/bookform-randomise/edit/EditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EditForm: React.FC<Props> = ({
const handleForm = () => {
if (inputError) return
enterLoading()
setTimeout(() => dispatch(setShowEdit()), 4000)
setTimeout(() => dispatch(setShowEdit()), 1250)
}
const formData = useAppSelector((state) => state.bookFormData.formData)
const dispatch = useAppDispatch()
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/EditCityAndCountry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const EditCityAndCountry: React.FC<props> = ({ id, inCity, inCountry }) => {
document.location.reload()
return newLoadings
})
}, 4000)
}, 500)
}
return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EditCityAndCountryButton: React.FC<Props> = ({
setConfirmLoading(true)
setTimeout(() => {
dispatch(setShowCountry())
}, 4000)
}, 500)
setModalText(
<EditCityAndCountry id={id} inCountry={inCountry} inCity={inCity} />
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/EditGenre.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const EditGenre: React.FC<props> = ({ id, inGenre }) => {
document.location.reload()
return newLoadings
})
}, 4000)
}, 500)
}
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/EditGenreButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EditGenreButton: React.FC<Props> = ({ id, inGenre }) => {
setConfirmLoading(true)
setTimeout(() => {
dispatch(setShowGenre())
}, 4000)
}, 500)
setModalText(<EditGenre id={id} inGenre={inGenre} />)
}
const handleCancel = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/EditUsername.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const EditUsername: React.FC<props> = ({ id, inUsername }) => {
document.location.reload()
return newLoadings
})
}, 4000)
}, 500)
}
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/EditUsernameButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EditUsernameButton: React.FC<Props> = ({ id, inUsername }) => {
setConfirmLoading(true)
setTimeout(() => {
dispatch(setShowUsername())
}, 4000)
}, 500)
setModalText(<EditUsername id={id} inUsername={inUsername} />)
}
const handleCancel = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/PictureUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const PictureUpload: React.FC<props> = ({ id, inImage }) => {
document.location.reload()
return newLoadings
})
}, 4000)
}, 500)
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/brotherform/PictureUploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PictureUploadButton: React.FC<Props> = ({ id, inImage }) => {
setConfirmLoading(true)
setTimeout(() => {
dispatch(setShowImage())
}, 4000)
}, 500)
setModalText(<PictureUpload id={id} inImage={inImage} />)
}
const handleCancel = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/commentform/CommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const CommentForm = ({ id, handleCancel }: Props) => {
enterLoading()
setTimeout(() => {
handleCancel()
}, 4000)
}, 1250)
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/commentform/EditCommentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EditRatingButton = ({
setConfirmLoading(true)
setTimeout(() => {
setShowEditComment(false)
}, 4000)
}, 1250)
}
const handleCancel = () => {
setShowEditComment(false)
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/commentform/EditCommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EditCommentForm: React.FC<Props> = ({ id, inComment, handleCancel }) => {
enterLoading()
setTimeout(() => {
handleCancel()
}, 4000)
}, 1250)
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ratingform/AnthologyRatingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const AnthologyRatingForm: React.FC<Props> = ({ id, singleBook }) => {
setTimeout(() => {
setLoadings(false)
document.location.reload()
}, 4000)
}, 1250)
}

const handleSubmit2 = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const EditAnthologyRatingForm: React.FC<Props> = ({
setTimeout(() => {
setLoadings(false)
document.location.reload()
}, 4000)
}, 1250)
}

const handleSubmit2 = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ratingform/EditRatingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const EditRatingForm: React.FC<Props> = ({
enterLoading()
setTimeout(() => {
handleCancel()
}, 4000)
}, 1250)
}

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ratingform/RatingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const RatingForm: React.FC<Props> = ({
enterLoading()
setTimeout(() => {
handleCancel()
}, 4000)
}, 1250)
}

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/user/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Login: React.FC = () => {
setTimeout(() => {
setLoginOpen(false)
setConfirmLoading(false)
}, 2000)
}, 1000)
setModalText(<LoginForm setLoginOpen={setLoginOpen} />)
}
const handleCancel = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/user/Login3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Login: React.FC = () => {
setTimeout(() => {
setLoginOpen(false)
setConfirmLoading(false)
}, 2000)
}, 1000)
setModalText(<LoginForm3D setLoginOpen={setLoginOpen} />)
}
const handleCancel = () => {
Expand Down
12 changes: 11 additions & 1 deletion src/components/user/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const LoginForm: React.FC<Login> = ({ setLoginOpen }) => {
login(data.token)
setLoadings([false])
setLoginOpen(false)
}, 5000)
}, 1000)
}
} catch (err) {
setError(err)
Expand All @@ -53,6 +53,9 @@ const LoginForm: React.FC<Login> = ({ setLoginOpen }) => {
components: {
Input: {
colorText: "black",
icons: {
color: "red",
},
},
},
}
Expand Down Expand Up @@ -113,6 +116,13 @@ const LoginForm: React.FC<Login> = ({ setLoginOpen }) => {
type="password"
onChange={(e) => setPassword(e.target.value)}
value={password}
styles={{
suffix: {
background: "#095d09",
borderRadius: "20px",
padding: "0.25rem",
},
}}
/>
</Form.Item>
</ConfigProvider>
Expand Down
9 changes: 8 additions & 1 deletion src/components/user/LoginForm3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const LoginForm3D: React.FC<Login> = ({ setLoginOpen }) => {
localStorage.setItem("token", data.token)
setLoadings([false])
setLoginOpen(false)
}, 5000)
}, 1000)
}
} catch (err) {
setError(err)
Expand Down Expand Up @@ -108,6 +108,13 @@ const LoginForm3D: React.FC<Login> = ({ setLoginOpen }) => {
type="password"
onChange={(e) => setPassword(e.target.value)}
value={password}
styles={{
suffix: {
background: "#095d09",
borderRadius: "20px",
padding: "0.25rem",
},
}}
/>
</Form.Item>
</ConfigProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/components/user/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Logout: React.FC = () => {
localStorage.removeItem("username")
setLoadings([false])
logout()
}, 3000)
}, 1000)
}
return (
<div className="flex items-center m-5">
Expand Down
2 changes: 1 addition & 1 deletion src/components/user/Logout3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Logout3D: React.FC = () => {
localStorage.removeItem("username")
localStorage.removeItem("token")
setLoadings([false])
}, 3000)
}, 1000)
}
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/crud-hooks/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Loading