feat: add loading overlay to between navigations and to auth form events

This commit is contained in:
Mahyar Khanbolooki
2025-07-03 18:51:33 +03:30
parent 5ccbb9c467
commit a5d2e9cf72
4 changed files with 67 additions and 2 deletions
@@ -1,14 +1,16 @@
import LoadingOverlay from '@/components/loading/LoadingOverlay';
import React from 'react'
type Props = {
isPending: boolean
} & Omit<React.FormHTMLAttributes<HTMLFormElement>, "id">;
function AuthFormWrapper({ children, ...restProps }: Props) {
function AuthFormWrapper({ children, isPending, ...restProps }: Props) {
return (
<form {...restProps} className='p-6 lg:py-[75px] w-full flex items-center justify-center py-4 lg:items-center lg:px-10 px-4 drop-shadow-black h-full'>
<div className='h-full w-full px-4 sm:px-6 lg:p-0 flex flex-col max-h-[812px] max-w-[1200px] bg-container rounded-container overflow-clip lg:flex-row justify-between'>
<div className='relative h-full w-full px-4 sm:px-6 lg:p-0 flex flex-col max-h-[812px] max-w-[1200px] bg-container rounded-container overflow-clip lg:flex-row justify-between'>
{children}
<LoadingOverlay visible={isPending} />
</div>
</form>
)