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