Skip to content

Commit 4317f62

Browse files
Refactor to use new shadcn-vue Spinner component (#221)
* use shadcn-vue spinner component * remove unused import --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 7be0237 commit 4317f62

File tree

9 files changed

+34
-30
lines changed

9 files changed

+34
-30
lines changed

resources/js/components/TwoFactorSetupModal.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import AlertError from '@/components/AlertError.vue';
33
import InputError from '@/components/InputError.vue';
44
import { Button } from '@/components/ui/button';
5+
import { Spinner } from '@/components/ui/spinner';
56
import {
67
Dialog,
78
DialogContent,
@@ -18,7 +19,7 @@ import { useTwoFactorAuth } from '@/composables/useTwoFactorAuth';
1819
import { confirm } from '@/routes/two-factor';
1920
import { Form } from '@inertiajs/vue3';
2021
import { useClipboard } from '@vueuse/core';
21-
import { Check, Copy, Loader2, ScanLine } from 'lucide-vue-next';
22+
import { Check, Copy, ScanLine } from 'lucide-vue-next';
2223
import { computed, nextTick, ref, useTemplateRef, watch } from 'vue';
2324
2425
interface Props {
@@ -163,7 +164,7 @@ watch(
163164
v-if="!qrCodeSvg"
164165
class="absolute inset-0 z-10 flex aspect-square h-auto w-full animate-pulse items-center justify-center bg-background"
165166
>
166-
<Loader2 class="size-6 animate-spin" />
167+
<Spinner class="size-6" />
167168
</div>
168169
<div
169170
v-else
@@ -204,7 +205,7 @@ watch(
204205
v-if="!manualSetupKey"
205206
class="flex h-full w-full items-center justify-center bg-muted p-3"
206207
>
207-
<Loader2 class="size-4 animate-spin" />
208+
<Spinner />
208209
</div>
209210
<template v-else>
210211
<input
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script setup lang="ts">
2+
import type { HTMLAttributes } from "vue"
3+
import { Loader2Icon } from "lucide-vue-next"
4+
import { cn } from "@/lib/utils"
5+
6+
const props = defineProps<{
7+
class?: HTMLAttributes["class"]
8+
}>()
9+
</script>
10+
11+
<template>
12+
<Loader2Icon
13+
role="status"
14+
aria-label="Loading"
15+
:class="cn('size-4 animate-spin', props.class)"
16+
/>
17+
</template>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Spinner } from "./Spinner.vue"

resources/js/pages/auth/ConfirmPassword.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import InputError from '@/components/InputError.vue';
33
import { Button } from '@/components/ui/button';
44
import { Input } from '@/components/ui/input';
55
import { Label } from '@/components/ui/label';
6+
import { Spinner } from '@/components/ui/spinner';
67
import AuthLayout from '@/layouts/AuthLayout.vue';
78
import { store } from '@/routes/password/confirm';
89
import { Form, Head } from '@inertiajs/vue3';
9-
import { LoaderCircle } from 'lucide-vue-next';
1010
</script>
1111

1212
<template>
@@ -43,10 +43,7 @@ import { LoaderCircle } from 'lucide-vue-next';
4343
:disabled="processing"
4444
data-test="confirm-password-button"
4545
>
46-
<LoaderCircle
47-
v-if="processing"
48-
class="h-4 w-4 animate-spin"
49-
/>
46+
<Spinner v-if="processing" />
5047
Confirm Password
5148
</Button>
5249
</div>

resources/js/pages/auth/ForgotPassword.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import TextLink from '@/components/TextLink.vue';
44
import { Button } from '@/components/ui/button';
55
import { Input } from '@/components/ui/input';
66
import { Label } from '@/components/ui/label';
7+
import { Spinner } from '@/components/ui/spinner';
78
import AuthLayout from '@/layouts/AuthLayout.vue';
89
import { login } from '@/routes';
910
import { email } from '@/routes/password';
1011
import { Form, Head } from '@inertiajs/vue3';
11-
import { LoaderCircle } from 'lucide-vue-next';
1212
1313
defineProps<{
1414
status?: string;
@@ -50,10 +50,7 @@ defineProps<{
5050
:disabled="processing"
5151
data-test="email-password-reset-link-button"
5252
>
53-
<LoaderCircle
54-
v-if="processing"
55-
class="h-4 w-4 animate-spin"
56-
/>
53+
<Spinner v-if="processing" />
5754
Email password reset link
5855
</Button>
5956
</div>

resources/js/pages/auth/Login.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Button } from '@/components/ui/button';
55
import { Checkbox } from '@/components/ui/checkbox';
66
import { Input } from '@/components/ui/input';
77
import { Label } from '@/components/ui/label';
8+
import { Spinner } from '@/components/ui/spinner';
89
import AuthBase from '@/layouts/AuthLayout.vue';
910
import { register } from '@/routes';
1011
import { store } from '@/routes/login';
1112
import { request } from '@/routes/password';
1213
import { Form, Head } from '@inertiajs/vue3';
13-
import { LoaderCircle } from 'lucide-vue-next';
1414
1515
defineProps<{
1616
status?: string;
@@ -93,10 +93,7 @@ defineProps<{
9393
:disabled="processing"
9494
data-test="login-button"
9595
>
96-
<LoaderCircle
97-
v-if="processing"
98-
class="h-4 w-4 animate-spin"
99-
/>
96+
<Spinner v-if="processing" />
10097
Log in
10198
</Button>
10299
</div>

resources/js/pages/auth/Register.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import TextLink from '@/components/TextLink.vue';
44
import { Button } from '@/components/ui/button';
55
import { Input } from '@/components/ui/input';
66
import { Label } from '@/components/ui/label';
7+
import { Spinner } from '@/components/ui/spinner';
78
import AuthBase from '@/layouts/AuthLayout.vue';
89
import { login } from '@/routes';
910
import { store } from '@/routes/register';
1011
import { Form, Head } from '@inertiajs/vue3';
11-
import { LoaderCircle } from 'lucide-vue-next';
1212
</script>
1313

1414
<template>
@@ -89,10 +89,7 @@ import { LoaderCircle } from 'lucide-vue-next';
8989
:disabled="processing"
9090
data-test="register-user-button"
9191
>
92-
<LoaderCircle
93-
v-if="processing"
94-
class="h-4 w-4 animate-spin"
95-
/>
92+
<Spinner v-if="processing" />
9693
Create account
9794
</Button>
9895
</div>

resources/js/pages/auth/ResetPassword.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import InputError from '@/components/InputError.vue';
33
import { Button } from '@/components/ui/button';
44
import { Input } from '@/components/ui/input';
55
import { Label } from '@/components/ui/label';
6+
import { Spinner } from '@/components/ui/spinner';
67
import AuthLayout from '@/layouts/AuthLayout.vue';
78
import { update } from '@/routes/password';
89
import { Form, Head } from '@inertiajs/vue3';
9-
import { LoaderCircle } from 'lucide-vue-next';
1010
import { ref } from 'vue';
1111
1212
const props = defineProps<{
@@ -80,10 +80,7 @@ const inputEmail = ref(props.email);
8080
:disabled="processing"
8181
data-test="reset-password-button"
8282
>
83-
<LoaderCircle
84-
v-if="processing"
85-
class="h-4 w-4 animate-spin"
86-
/>
83+
<Spinner v-if="processing" />
8784
Reset password
8885
</Button>
8986
</div>

resources/js/pages/auth/VerifyEmail.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script setup lang="ts">
22
import TextLink from '@/components/TextLink.vue';
33
import { Button } from '@/components/ui/button';
4+
import { Spinner } from '@/components/ui/spinner';
45
import AuthLayout from '@/layouts/AuthLayout.vue';
56
import { logout } from '@/routes';
67
import { send } from '@/routes/verification';
78
import { Form, Head } from '@inertiajs/vue3';
8-
import { LoaderCircle } from 'lucide-vue-next';
99
1010
defineProps<{
1111
status?: string;
@@ -33,7 +33,7 @@ defineProps<{
3333
v-slot="{ processing }"
3434
>
3535
<Button :disabled="processing" variant="secondary">
36-
<LoaderCircle v-if="processing" class="h-4 w-4 animate-spin" />
36+
<Spinner v-if="processing" />
3737
Resend verification email
3838
</Button>
3939

0 commit comments

Comments
 (0)