mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
delay showing login stamp
This commit is contained in:
parent
44ddde9bf7
commit
a00267a75c
1 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
|
|
||||||
|
@ -13,12 +15,17 @@ import { useFlowContext } from '~/utils/providers/FlowProvider';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
const FlowLayout = observer(() => {
|
const FlowLayout = observer(() => {
|
||||||
|
const [showLoginStamp, setShowLoginStamp] = useState(false);
|
||||||
|
|
||||||
const { heroes, nodes, onChangeCellView, loadMore, isSyncing } =
|
const { heroes, nodes, onChangeCellView, loadMore, isSyncing } =
|
||||||
useFlowContext();
|
useFlowContext();
|
||||||
|
|
||||||
const { user, isUser } = useAuth();
|
const { user, isUser } = useAuth();
|
||||||
|
|
||||||
useInfiniteLoader(loadMore, isSyncing);
|
useInfiniteLoader(loadMore, isSyncing);
|
||||||
|
|
||||||
|
useEffect(() => setShowLoginStamp(!isUser), [isUser]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.container)}>
|
<div className={classNames(styles.container)}>
|
||||||
<div className={styles.grid}>
|
<div className={styles.grid}>
|
||||||
|
@ -30,7 +37,7 @@ const FlowLayout = observer(() => {
|
||||||
<FlowStamp isFluid={false} onToggleLayout={console.warn} />
|
<FlowStamp isFluid={false} onToggleLayout={console.warn} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!isUser && (
|
{showLoginStamp && (
|
||||||
<div className={styles.login}>
|
<div className={styles.login}>
|
||||||
<FlowLoginStamp />
|
<FlowLoginStamp />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue