Skip to content

Commit 55639f5

Browse files
committed
fix: add classes for custom styling in LoginView
1 parent a386a8e commit 55639f5

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

adminforth/spa/src/views/LoginView.vue

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424
<!-- Main modal -->
2525
<div id="authentication-modal" tabindex="-1"
26-
class="overflow-y-auto flex flex-grow
26+
class="af-login-modal overflow-y-auto flex flex-grow
2727
overflow-x-hidden z-50 min-w-[350px] justify-center items-center md:inset-0 h-[calc(100%-1rem)] max-h-full">
2828
<div class="relative p-4 w-full max-h-full max-w-[400px]">
2929
<!-- Modal content -->
30-
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700 dark:shadow-black" >
30+
<div class="af-login-modal-content relative bg-white rounded-lg shadow dark:bg-gray-700 dark:shadow-black" >
3131
<!-- Modal header -->
32-
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
32+
<div class="af-login-modal-header flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
3333

3434
<div v-if="coreStore?.config?.loginPageInjections?.panelHeader.length > 0">
3535
<component
@@ -44,32 +44,36 @@
4444
</h3>
4545
</div>
4646
<!-- Modal body -->
47-
<div class="p-4 md:p-5">
47+
<div class="af-login-modal-body p-4 md:p-5">
4848
<form class="space-y-4" @submit.prevent>
4949
<div>
5050
<label for="username" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ $t('Your') }} {{ coreStore.config?.usernameFieldName?.toLowerCase() }}</label>
51-
<input
51+
<Input
5252
autocomplete="username"
5353
type="username"
5454
name="username"
5555
id="username"
5656
ref="usernameInput"
5757
oninput="setCustomValidity('')"
5858
@keydown.enter="passwordInput.focus()"
59-
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" placeholder="name@company.com" required />
59+
class="w-full"
60+
placeholder="name@company.com" required />
6061
</div>
61-
<div class="relative">
62+
<div class="">
6263
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ $t('Your password') }}</label>
63-
<input
64+
<Input
6465
ref="passwordInput"
6566
autocomplete="current-password"
6667
oninput="setCustomValidity('')"
6768
@keydown.enter="login"
68-
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" required />
69-
<button type="button" @click="showPw = !showPw" class="absolute top-12 right-3 -translate-y-1/2 text-gray-400 dark:text-gray-300">
70-
<IconEyeSolid class="w-5 h-5" v-if="!showPw" />
71-
<IconEyeSlashSolid class="w-5 h-5" v-else />
72-
</button>
69+
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="w-full" required>
70+
<template #rightIcon>
71+
<button type="button" @click="showPw = !showPw" class="text-gray-400 dark:text-gray-300">
72+
<IconEyeSolid class="w-5 h-5" v-if="!showPw" />
73+
<IconEyeSlashSolid class="w-5 h-5" v-else />
74+
</button>
75+
</template>
76+
</Input>
7377
</div>
7478

7579
<div v-if="coreStore.config.rememberMeDays"
@@ -88,7 +92,7 @@
8892
:meta="c.meta"
8993
/>
9094

91-
<div v-if="error" class="flex items-center p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400" role="alert">
95+
<div v-if="error" class="af-login-modal-error flex items-center p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400" role="alert">
9296
<svg class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
9397
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
9498
</svg>
@@ -130,7 +134,7 @@ import { useUserStore } from '@/stores/user';
130134
import { IconEyeSolid, IconEyeSlashSolid } from '@iconify-prerendered/vue-flowbite';
131135
import { callAdminForthApi, loadFile } from '@/utils';
132136
import { useRoute, useRouter } from 'vue-router';
133-
import { Button, Checkbox } from '@/afcl';
137+
import { Button, Checkbox, Input } from '@/afcl';
134138
import { useI18n } from 'vue-i18n';
135139
136140
const { t } = useI18n();

0 commit comments

Comments
 (0)