feat(03-01): add loading spinners to Login, Register, and BudgetSetup submit buttons

- LoginPage: Spinner replaces button text during loading, min-w-[120px] prevents layout shift
- RegisterPage: Spinner replaces button text during loading, min-w-[120px] prevents layout shift
- BudgetSetup: Spinner replaces create button text during saving, min-w-[120px] prevents layout shift
- All buttons remain disabled during loading/saving to prevent double-submit
This commit is contained in:
2026-03-11 22:32:30 +01:00
parent c95c7f248e
commit 30ec2d5780
3 changed files with 9 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import { Button } from '@/components/ui/button'
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
import { Input } from '@/components/ui/input'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Spinner } from '@/components/ui/spinner'
import { palette } from '@/lib/palette'
import type { AuthContext } from '@/hooks/useAuth'
@@ -86,8 +87,8 @@ export function RegisterPage({ auth: { register }, onToggle }: Props) {
required
minLength={8}
/>
<Button type="submit" disabled={loading} className="w-full">
{t('auth.register')}
<Button type="submit" disabled={loading} className="w-full min-w-[120px]">
{loading ? <Spinner /> : t('auth.register')}
</Button>
</CardContent>
</form>