This commit is contained in:
Untone 2024-02-17 16:25:25 +03:00
parent 748bd206d1
commit 20e4e985f5
3 changed files with 16 additions and 9 deletions

View File

@ -152,9 +152,10 @@ export const RegisterForm = () => {
...prev,
email: (
<>
{t('This email is registered')}. {t('You can')}{' '}
{t('This email is registered')}
{'. '}
<span class="link" onClick={() => changeSearchParams({ mode: 'send-reset-link' })}>
{t('Set the new password').toLocaleLowerCase()}
{t('Set the new password')}
</span>
</>
),
@ -196,7 +197,7 @@ export const RegisterForm = () => {
disabled={Boolean(emailStatus())}
placeholder={t('Full name')}
autocomplete="one-time-code"
onInput={(event) => handleNameInput(event.currentTarget.value)}
onChange={(event) => handleNameInput(event.currentTarget.value)}
/>
<label for="name">{t('Full name')}</label>
<Show when={validationErrors().fullName && !emailStatus()}>
@ -227,8 +228,8 @@ export const RegisterForm = () => {
<PasswordField
disableAutocomplete={true}
disabled={Boolean(emailStatus())}
errorMessage={(err) => setPasswordError(err)}
onInput={(value) => setPassword(value)}
errorMessage={(err) => !emailStatus() && setPasswordError(err)}
onInput={(value) => setPassword(emailStatus() ? '' : value)}
/>
<div>

View File

@ -1,7 +1,7 @@
import type { AuthModalSearchParams } from './types'
import { clsx } from 'clsx'
import { JSX, Show, createSignal } from 'solid-js'
import { JSX, Show, createSignal, onMount } from 'solid-js'
import { useLocalize } from '../../../context/localize'
import { useSession } from '../../../context/session'
@ -72,6 +72,12 @@ export const SendResetLinkForm = () => {
}
}
onMount(() => {
if (email()) {
console.info('[SendResetLinkForm] email detected')
}
})
return (
<form
onSubmit={handleSubmit}
@ -94,7 +100,7 @@ export const SendResetLinkForm = () => {
type="email"
value={email()}
placeholder={t('Email')}
onInput={(event) => handleEmailInput(event.currentTarget.value)}
onChange={(event) => handleEmailInput(event.currentTarget.value)}
/>
<label for="email">{t('Email')}</label>

View File

@ -12,8 +12,8 @@ import { addArticles } from '../stores/zine/articles'
import { slugify } from '../utils/slugify'
import { useLocalize } from './localize'
import { useSnackbar } from './snackbar'
import { useSession } from './session'
import { useSnackbar } from './snackbar'
type WordCounter = {
characters: number
@ -134,7 +134,7 @@ export const EditorProvider = (props: { children: JSX.Element }) => {
lead: formToUpdate.lead,
description: formToUpdate.description,
cover: formToUpdate.coverImageUrl,
media: formToUpdate.media
media: formToUpdate.media,
},
publish,
})