import { Dynamic } from 'solid-js/web' import { Component, createEffect, createMemo } from 'solid-js' import { t } from '../../../utils/intl' import { hideModal } from '../../../stores/ui' import { handleClientRouteLinkClick, useRouter } from '../../../stores/router' import { clsx } from 'clsx' import styles from './AuthModal.module.scss' import { LoginForm } from './LoginForm' import { RegisterForm } from './RegisterForm' import { ForgotPasswordForm } from './ForgotPasswordForm' import { EmailConfirm } from './EmailConfirm' import type { AuthModalMode, AuthModalSearchParams } from './types' const AUTH_MODAL_MODES: Record = { login: LoginForm, register: RegisterForm, 'forgot-password': ForgotPasswordForm, 'confirm-email': EmailConfirm } export const AuthModal = () => { let rootRef: HTMLDivElement const { searchParams } = useRouter() const mode = createMemo(() => { return AUTH_MODAL_MODES[searchParams().mode] ? searchParams().mode : 'login' }) createEffect((oldMode) => { if (oldMode !== mode()) { rootRef?.querySelector('input')?.focus() } }, null) return (

{t('Discours')}

{t(`Join the global community of authors!`)}

{t( 'Get to know the most intelligent people of our time, edit and discuss the articles, share your expertise, rate and decide what to publish in the magazine' )} .  {t('New stories every day and even more!')}

{t('By signing up you agree with our')}{' '} { hideModal() handleClientRouteLinkClick(event) }} > {t('terms of use')} , {t('personal data usage and email notifications')}.

) }