mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 13:52:12 +00:00
intro adapted to router changes
This commit is contained in:
parent
b6f275c3c8
commit
7a4b2f5143
1 changed files with 4 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
const React = require('react');
|
||||
const classnames = require('classnames');
|
||||
const Icon = require('stremio-icons/dom');
|
||||
const { useFocusable } = require('stremio-router');
|
||||
const { useRouteFocused } = require('stremio-router');
|
||||
const { Button } = require('stremio/common');
|
||||
const CredentialsTextInput = require('./CredentialsTextInput');
|
||||
const ConsentCheckbox = require('./ConsentCheckbox');
|
||||
|
|
@ -11,7 +11,7 @@ const LOGIN_FORM = 'LOGIN_FORM';
|
|||
const SIGNUP_FORM = 'SIGNUP_FORM';
|
||||
|
||||
const Intro = () => {
|
||||
const focusable = useFocusable();
|
||||
const routeFocused = useRouteFocused();
|
||||
const emailRef = React.useRef();
|
||||
const passwordRef = React.useRef();
|
||||
const confirmPasswordRef = React.useRef();
|
||||
|
|
@ -137,10 +137,10 @@ const Intro = () => {
|
|||
}
|
||||
}, [state.error]);
|
||||
React.useEffect(() => {
|
||||
if (focusable) {
|
||||
if (routeFocused) {
|
||||
emailRef.current.focus();
|
||||
}
|
||||
}, [state.form, focusable]);
|
||||
}, [state.form, routeFocused]);
|
||||
return (
|
||||
<div className={styles['intro-container']}>
|
||||
<div className={styles['form-container']}>
|
||||
|
|
|
|||
Loading…
Reference in a new issue