refac
This commit is contained in:
1 parent
db934a3b4f
commit
ba067258de
39 files changed
+1540
-1442
No files matched your search
@@ -10,6 +10,10 @@
|
||||
let currentPassword = '';
|
||||
let newPassword = '';
|
||||
let newPasswordConfirm = '';
|
||||
const inputClass =
|
||||
'h-7 w-full rounded-lg border border-gray-100/50 bg-gray-50/40 px-2 text-xs text-gray-700 outline-hidden transition-colors placeholder:text-gray-300 focus:border-blue-400 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-gray-300 dark:placeholder:text-gray-700 dark:focus:border-blue-500';
|
||||
const actionButtonClass =
|
||||
'text-xs text-gray-500 transition-colors hover:text-gray-900 dark:text-gray-500 dark:hover:text-white';
|
||||
|
||||
const updatePasswordHandler = async () => {
|
||||
if (newPassword === newPasswordConfirm) {
|
||||
@@ -43,25 +47,30 @@
|
||||
updatePasswordHandler();
|
||||
}}
|
||||
>
|
||||
<div class="flex justify-between items-center text-sm">
|
||||
<div class="text-xs text-gray-400 dark:text-gray-600">{$i18n.t('Change Password')}</div>
|
||||
<div class="flex items-center justify-between gap-2.5">
|
||||
<div class="text-xs text-gray-600 dark:text-gray-400">{$i18n.t('Change Password')}</div>
|
||||
<button
|
||||
class="text-xs font-normal text-gray-500 transition-colors hover:text-gray-700 dark:hover:text-gray-300"
|
||||
class={actionButtonClass}
|
||||
type="button"
|
||||
on:click={() => {
|
||||
show = !show;
|
||||
}}>{show ? $i18n.t('Hide') : $i18n.t('Show')}</button
|
||||
>
|
||||
</div>
|
||||
<p class="-mt-1 text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{$i18n.t('Update the password used for email and password sign-in.')}
|
||||
</p>
|
||||
|
||||
{#if show}
|
||||
<div class=" py-2.5 space-y-1.5">
|
||||
<div class="py-2.5 space-y-2.5">
|
||||
<div class="flex flex-col w-full">
|
||||
<div class=" mb-1 text-xs text-gray-500">{$i18n.t('Current Password')}</div>
|
||||
<div class="mb-1 text-xs text-gray-600 dark:text-gray-400">
|
||||
{$i18n.t('Current Password')}
|
||||
</div>
|
||||
|
||||
<div class="flex-1">
|
||||
<SensitiveInput
|
||||
class="w-full bg-transparent text-sm dark:text-gray-300 outline-hidden placeholder:opacity-30"
|
||||
class={inputClass}
|
||||
type="password"
|
||||
bind:value={currentPassword}
|
||||
placeholder={$i18n.t('Enter your current password')}
|
||||
@@ -72,11 +81,13 @@
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col w-full">
|
||||
<div class=" mb-1 text-xs text-gray-500">{$i18n.t('New Password')}</div>
|
||||
<div class="mb-1 text-xs text-gray-600 dark:text-gray-400">
|
||||
{$i18n.t('New Password')}
|
||||
</div>
|
||||
|
||||
<div class="flex-1">
|
||||
<SensitiveInput
|
||||
class="w-full bg-transparent text-sm dark:text-gray-300 outline-hidden placeholder:opacity-30"
|
||||
class={inputClass}
|
||||
type="password"
|
||||
bind:value={newPassword}
|
||||
placeholder={$i18n.t('Enter your new password')}
|
||||
@@ -87,11 +98,13 @@
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col w-full">
|
||||
<div class=" mb-1 text-xs text-gray-500">{$i18n.t('Confirm Password')}</div>
|
||||
<div class="mb-1 text-xs text-gray-600 dark:text-gray-400">
|
||||
{$i18n.t('Confirm Password')}
|
||||
</div>
|
||||
|
||||
<div class="flex-1">
|
||||
<SensitiveInput
|
||||
class="w-full bg-transparent text-sm dark:text-gray-300 outline-hidden placeholder:opacity-30"
|
||||
class={inputClass}
|
||||
type="password"
|
||||
bind:value={newPasswordConfirm}
|
||||
placeholder={$i18n.t('Confirm your new password')}
|
||||
|
||||
Reference in new issue
Block a user