mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
eslint auto-fix
This commit is contained in:
parent
312156bdf8
commit
4c4461ea19
55 changed files with 107 additions and 110 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, { FC, useCallback, useEffect, useState } from 'react';
|
||||
import React, { FC, useCallback, useEffect } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { SidebarWrapper } from '~/containers/sidebars/SidebarWrapper';
|
||||
import { connect } from 'react-redux';
|
||||
|
@ -37,11 +37,11 @@ const ProfileSidebarUnconnected: FC<Props> = ({
|
|||
|
||||
useEffect(() => {
|
||||
authLoadProfile(username);
|
||||
}, [username]);
|
||||
}, [authLoadProfile, username]);
|
||||
|
||||
const history = useHistory();
|
||||
const basePath = url.replace(new RegExp(`\/~${username}$`), '');
|
||||
const onClose = useCallback(() => history.push(basePath), [basePath]);
|
||||
const onClose = useCallback(() => history.push(basePath), [basePath, history]);
|
||||
|
||||
useCloseOnEscape(onClose);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, useEffect, useRef } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';
|
||||
import { clearAllBodyScrollLocks, disableBodyScroll } from 'body-scroll-lock';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
|
||||
interface IProps {
|
||||
|
@ -18,7 +18,7 @@ const SidebarWrapper: FC<IProps> = ({ children, onClose }) => {
|
|||
disableBodyScroll(ref.current, { reserveScrollBarGap: true });
|
||||
|
||||
return () => clearAllBodyScrollLocks();
|
||||
}, [ref.current]);
|
||||
}, []);
|
||||
|
||||
return createPortal(
|
||||
<div className={styles.wrapper} ref={ref}>
|
||||
|
|
|
@ -31,7 +31,7 @@ const TagSidebarUnconnected: FC<Props> = ({ nodes, tagLoadNodes, tagSetNodes })
|
|||
const history = useHistory();
|
||||
|
||||
const basePath = url.replace(new RegExp(`\/tag\/${tag}$`), '');
|
||||
const onClose = useCallback(() => history.push(basePath), [basePath]);
|
||||
const onClose = useCallback(() => history.push(basePath), [basePath, history]);
|
||||
|
||||
useEffect(() => {
|
||||
tagLoadNodes(tag);
|
||||
|
@ -39,7 +39,7 @@ const TagSidebarUnconnected: FC<Props> = ({ nodes, tagLoadNodes, tagSetNodes })
|
|||
return () => {
|
||||
tagSetNodes({ list: [], count: 0 });
|
||||
};
|
||||
}, [tag]);
|
||||
}, [tag, tagLoadNodes, tagSetNodes]);
|
||||
|
||||
const loadMore = useCallback(() => {
|
||||
if (nodes.isLoading) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue