Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

display forgot password link in the password input field label

Blue Mouse6c60d4778153
diff --git a/web/app/pages/Auth/Signin/Signin.tsx b/web/app/pages/Auth/Signin/Signin.tsx
index ddafd66f2..2538ae15f 100644
--- a/web/app/pages/Auth/Signin/Signin.tsx
+++ b/web/app/pages/Auth/Signin/Signin.tsx
@@ -414,6 +414,15 @@ const Signin = () => {
name='password'
type='password'
label={t('auth.common.password')}
+ labelCorner={
+ <Link
+ to={routes.reset_password}
+ className='text-sm font-medium text-gray-900 underline decoration-dashed hover:decoration-solid dark:text-gray-300'
+ tabIndex={-1}
+ >
+ {t('auth.signin.forgot')}
+ </Link>
+ }
hint={t('auth.common.hint', { amount: MIN_PASSWORD_CHARS })}
value={form.password}
onChange={handleInput}
@@ -437,12 +446,6 @@ const Signin = () => {
</span>
}
/>
- <Link
- to={routes.reset_password}
- className='text-sm font-medium text-gray-900 underline decoration-dashed hover:decoration-solid dark:text-gray-300'
- >
- {t('auth.signin.forgot')}
- </Link>
</div>
<Button className='mt-6 w-full justify-center' type='submit' loading={isLoading} primary giant>
diff --git a/web/app/ui/Input.tsx b/web/app/ui/Input.tsx
index f39b3745a..5958127c0 100644
--- a/web/app/ui/Input.tsx
+++ b/web/app/ui/Input.tsx
@@ -6,6 +6,7 @@ import React, { memo, useState } from 'react'
interface InputProps {
label?: React.ReactNode
+ labelCorner?: React.ReactNode
hint?: React.ReactNode
className?: string
error?: string | null | boolean
@@ -20,6 +21,7 @@ interface InputProps {
const Input = ({
label,
+ labelCorner,
hint,
className,
error,
@@ -56,7 +58,12 @@ const Input = ({
return (
<Field as='div' className={className}>
- {label ? <Label className='mb-1 flex text-sm font-medium text-gray-900 dark:text-gray-200'>{label}</Label> : null}
+ {label || labelCorner ? (
+ <div className='mb-1 flex items-center justify-between gap-x-2'>
+ {label ? <Label className='flex text-sm font-medium text-gray-900 dark:text-gray-200'>{label}</Label> : <span />}
+ {labelCorner ? <span className='text-sm'>{labelCorner}</span> : null}
+ </div>
+ ) : null}
{hint && hintPosition === 'top' ? (
<Description className='mt-1 text-sm whitespace-pre-line text-gray-500 dark:text-gray-300'>{hint}</Description>
) : null}