mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed dots on lab and flow
This commit is contained in:
parent
2395c9fbab
commit
2160f50711
3 changed files with 20 additions and 14 deletions
|
@ -26,12 +26,10 @@ import styles from './styles.module.scss';
|
||||||
export interface HeaderProps {}
|
export interface HeaderProps {}
|
||||||
|
|
||||||
const Header: FC<HeaderProps> = observer(() => {
|
const Header: FC<HeaderProps> = observer(() => {
|
||||||
const labStats = useGetLabStats();
|
|
||||||
|
|
||||||
const [isScrolled, setIsScrolled] = useState(false);
|
const [isScrolled, setIsScrolled] = useState(false);
|
||||||
const { showModal } = useModal();
|
const { showModal } = useModal();
|
||||||
const { isUser, user } = useAuth();
|
const { isUser, user } = useAuth();
|
||||||
const { updates: flowUpdates } = useFlow();
|
const { hasFlowUpdates, hasLabUpdates } = useFlow();
|
||||||
const { borisCommentedAt } = useUpdates();
|
const { borisCommentedAt } = useUpdates();
|
||||||
const { open } = useSidebar();
|
const { open } = useSidebar();
|
||||||
|
|
||||||
|
@ -52,12 +50,6 @@ const Header: FC<HeaderProps> = observer(() => {
|
||||||
[borisCommentedAt, isUser, user.last_seen_boris],
|
[borisCommentedAt, isUser, user.last_seen_boris],
|
||||||
);
|
);
|
||||||
|
|
||||||
const hasLabUpdates = useMemo(
|
|
||||||
() => labStats.updates.length > 0,
|
|
||||||
[labStats.updates],
|
|
||||||
);
|
|
||||||
const hasFlowUpdates = useMemo(() => flowUpdates.length > 0, [flowUpdates]);
|
|
||||||
|
|
||||||
// Needed for SSR
|
// Needed for SSR
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsScrolled(top > 10);
|
setIsScrolled(top > 10);
|
||||||
|
|
|
@ -114,6 +114,11 @@
|
||||||
top: 6px;
|
top: 6px;
|
||||||
transition: opacity 0.5s;
|
transition: opacity 0.5s;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
|
@include tablet {
|
||||||
|
top: -4px;
|
||||||
|
right: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.has_dot {
|
&.has_dot {
|
||||||
|
@ -139,10 +144,6 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: $gap;
|
margin-right: $gap;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,26 @@ import { useFlowStore } from '~/store/flow/useFlowStore';
|
||||||
|
|
||||||
export const useFlow = () => {
|
export const useFlow = () => {
|
||||||
const { loadMore, isSyncing } = useFlowLoader();
|
const { loadMore, isSyncing } = useFlowLoader();
|
||||||
|
const labStats = useGetLabStats();
|
||||||
|
|
||||||
const { nodes, heroes, recent, updated } = useFlowStore();
|
const { nodes, heroes, recent, updated } = useFlowStore();
|
||||||
const { isFluid, toggleLayout } = useFlowLayout();
|
const { isFluid, toggleLayout } = useFlowLayout();
|
||||||
const lab = useGetLabStats();
|
const lab = useGetLabStats();
|
||||||
|
|
||||||
const updates = useMemo(() => [...updated, ...lab.updates].slice(0, 10), [lab.updates, updated]);
|
const updates = useMemo(
|
||||||
|
() => [...updated, ...lab.updates].slice(0, 10),
|
||||||
|
[lab.updates, updated],
|
||||||
|
);
|
||||||
|
|
||||||
const onChangeCellView = useFlowSetCellView();
|
const onChangeCellView = useFlowSetCellView();
|
||||||
|
|
||||||
|
const hasLabUpdates = useMemo(
|
||||||
|
() => labStats.updates.length > 0,
|
||||||
|
[labStats.updates],
|
||||||
|
);
|
||||||
|
|
||||||
|
const hasFlowUpdates = useMemo(() => updated.length > 0, [updated]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
nodes,
|
nodes,
|
||||||
heroes,
|
heroes,
|
||||||
|
@ -27,5 +38,7 @@ export const useFlow = () => {
|
||||||
onChangeCellView,
|
onChangeCellView,
|
||||||
loadMore,
|
loadMore,
|
||||||
isSyncing,
|
isSyncing,
|
||||||
|
hasLabUpdates,
|
||||||
|
hasFlowUpdates,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue