Skip to content
Open
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
7 changes: 4 additions & 3 deletions resources/js/components/two-factor-setup-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import { OTP_MAX_LENGTH } from '@/hooks/use-two-factor-auth';
import { confirm } from '@/routes/two-factor';
import { Form } from '@inertiajs/react';
import { REGEXP_ONLY_DIGITS } from 'input-otp';
import { Check, Copy, Loader2, ScanLine } from 'lucide-react';
import { Check, Copy, ScanLine } from 'lucide-react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import AlertError from './alert-error';
import { Spinner } from './ui/spinner';

function GridScanIcon() {
return (
Expand Down Expand Up @@ -79,7 +80,7 @@ function TwoFactorSetupStep({
}}
/>
) : (
<Loader2 className="flex size-4 animate-spin" />
<Spinner />
)}
</div>
</div>
Expand All @@ -102,7 +103,7 @@ function TwoFactorSetupStep({
<div className="flex w-full items-stretch overflow-hidden rounded-xl border border-border">
{!manualSetupKey ? (
<div className="flex h-full w-full items-center justify-center bg-muted p-3">
<Loader2 className="size-4 animate-spin" />
<Spinner />
</div>
) : (
<>
Expand Down
16 changes: 16 additions & 0 deletions resources/js/components/ui/spinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Loader2Icon } from "lucide-react"

import { cn } from "@/lib/utils"

function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
return (
<Loader2Icon
role="status"
aria-label="Loading"
className={cn("size-4 animate-spin", className)}
{...props}
/>
)
}

export { Spinner }
6 changes: 2 additions & 4 deletions resources/js/pages/auth/confirm-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import InputError from '@/components/input-error';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import AuthLayout from '@/layouts/auth-layout';
import { store } from '@/routes/password/confirm';
import { Form, Head } from '@inertiajs/react';
import { LoaderCircle } from 'lucide-react';

export default function ConfirmPassword() {
return (
Expand Down Expand Up @@ -38,9 +38,7 @@ export default function ConfirmPassword() {
disabled={processing}
data-test="confirm-password-button"
>
{processing && (
<LoaderCircle className="h-4 w-4 animate-spin" />
)}
{processing && <Spinner />}
Confirm password
</Button>
</div>
Expand Down
6 changes: 2 additions & 4 deletions resources/js/pages/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import AuthLayout from '@/layouts/auth-layout';
import { register } from '@/routes';
import { request } from '@/routes/password';
import { Form, Head } from '@inertiajs/react';
import { LoaderCircle } from 'lucide-react';

interface LoginProps {
status?: string;
Expand Down Expand Up @@ -88,9 +88,7 @@ export default function Login({ status, canResetPassword }: LoginProps) {
disabled={processing}
data-test="login-button"
>
{processing && (
<LoaderCircle className="h-4 w-4 animate-spin" />
)}
{processing && <Spinner />}
Log in
</Button>
</div>
Expand Down
6 changes: 2 additions & 4 deletions resources/js/pages/auth/register.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import RegisteredUserController from '@/actions/App/Http/Controllers/Auth/RegisteredUserController';
import { login } from '@/routes';
import { Form, Head } from '@inertiajs/react';
import { LoaderCircle } from 'lucide-react';

import InputError from '@/components/input-error';
import TextLink from '@/components/text-link';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import AuthLayout from '@/layouts/auth-layout';

export default function Register() {
Expand Down Expand Up @@ -96,9 +96,7 @@ export default function Register() {
tabIndex={5}
data-test="register-user-button"
>
{processing && (
<LoaderCircle className="h-4 w-4 animate-spin" />
)}
{processing && <Spinner />}
Create account
</Button>
</div>
Expand Down
6 changes: 2 additions & 4 deletions resources/js/pages/auth/reset-password.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import NewPasswordController from '@/actions/App/Http/Controllers/Auth/NewPasswordController';
import { Form, Head } from '@inertiajs/react';
import { LoaderCircle } from 'lucide-react';

import InputError from '@/components/input-error';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Spinner } from '@/components/ui/spinner';
import AuthLayout from '@/layouts/auth-layout';

interface ResetPasswordProps {
Expand Down Expand Up @@ -83,9 +83,7 @@ export default function ResetPassword({ token, email }: ResetPasswordProps) {
disabled={processing}
data-test="reset-password-button"
>
{processing && (
<LoaderCircle className="h-4 w-4 animate-spin" />
)}
{processing && <Spinner />}
Reset password
</Button>
</div>
Expand Down
6 changes: 2 additions & 4 deletions resources/js/pages/auth/verify-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import EmailVerificationNotificationController from '@/actions/App/Http/Controllers/Auth/EmailVerificationNotificationController';
import { logout } from '@/routes';
import { Form, Head } from '@inertiajs/react';
import { LoaderCircle } from 'lucide-react';

import TextLink from '@/components/text-link';
import { Button } from '@/components/ui/button';
import { Spinner } from '@/components/ui/spinner';
import AuthLayout from '@/layouts/auth-layout';

export default function VerifyEmail({ status }: { status?: string }) {
Expand All @@ -30,9 +30,7 @@ export default function VerifyEmail({ status }: { status?: string }) {
{({ processing }) => (
<>
<Button disabled={processing} variant="secondary">
{processing && (
<LoaderCircle className="h-4 w-4 animate-spin" />
)}
{processing && <Spinner />}
Resend verification email
</Button>

Expand Down