diff --git a/components/LoginModal/index.tsx b/components/LoginModal/index.tsx index fac799ec..141cec85 100644 --- a/components/LoginModal/index.tsx +++ b/components/LoginModal/index.tsx @@ -171,6 +171,15 @@ const LoginModal = (props: Props) => { }) } + function onEscapeKeyDown(event: KeyboardEvent) { + setOpen(false) + } + + function onOpenAutoFocus(event: Event) { + event.preventDefault() + if (emailInput.current) emailInput.current.focus() + } + return ( @@ -178,7 +187,11 @@ const LoginModal = (props: Props) => { {t('menu.login')} - +

{t('modals.login.title')}

diff --git a/components/SignupModal/index.tsx b/components/SignupModal/index.tsx index d8909927..0ea8948d 100644 --- a/components/SignupModal/index.tsx +++ b/components/SignupModal/index.tsx @@ -263,6 +263,15 @@ const SignupModal = (props: Props) => { }) } + function onEscapeKeyDown(event: KeyboardEvent) { + setOpen(false) + } + + function onOpenAutoFocus(event: Event) { + event.preventDefault() + if (usernameInput.current) usernameInput.current.focus() + } + return ( @@ -270,7 +279,11 @@ const SignupModal = (props: Props) => { {t('menu.signup')} - +

{t('modals.signup.title')}