refactor: implicit user
This commit is contained in:
parent
c589abc50e
commit
e759851b97
|
@ -9,8 +9,6 @@ import {
|
|||
Routes as ReactRouterRoutes,
|
||||
Route,
|
||||
} from '@flecks/react/router';
|
||||
import {useSelector} from '@flecks/redux';
|
||||
import {userIdSelector} from '@flecks/user';
|
||||
import {UserRequired} from '@flecks/user/local';
|
||||
import '@humus/app/scss/index.scss';
|
||||
|
||||
|
@ -21,8 +19,7 @@ import Play from './play';
|
|||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
const Persea = () => {
|
||||
const userId = useSelector(userIdSelector);
|
||||
function Persea() {
|
||||
return (
|
||||
<ReactRouterRoutes>
|
||||
<Route
|
||||
|
@ -46,19 +43,9 @@ const Persea = () => {
|
|||
path="/"
|
||||
element={(
|
||||
<li className={styles.action}>
|
||||
{
|
||||
userId === 0
|
||||
? (
|
||||
<Link to="/login" className={classnames('button', styles.button)}>
|
||||
Log in
|
||||
</Link>
|
||||
)
|
||||
: (
|
||||
<Link to="/overview" className={classnames('button', styles.button)}>
|
||||
Play
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
<Link to="/overview" className={classnames('button', styles.button)}>
|
||||
Play
|
||||
</Link>
|
||||
</li>
|
||||
)}
|
||||
/>
|
||||
|
@ -86,6 +73,6 @@ const Persea = () => {
|
|||
</Route>
|
||||
</ReactRouterRoutes>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default hot(module)(Persea);
|
||||
|
|
Loading…
Reference in New Issue
Block a user