mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fix eslint
This commit is contained in:
parent
e4b158dada
commit
a26e4168fd
80 changed files with 199 additions and 205 deletions
|
@ -4,7 +4,6 @@ import { BorisContacts } from '~/components/boris/BorisContacts';
|
|||
import { BorisStats } from '~/components/boris/BorisStats';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { SuperPowersToggle } from '~/containers/auth/SuperPowersToggle';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
import { useTelegramAccount } from '~/hooks/auth/useTelegramAccount';
|
||||
import { BorisUsageStats } from '~/types/boris';
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ const TelegramAttachDialog: FC<TelegramAttachDialogProps> = ({
|
|||
|
||||
const onAttach = useCallback(
|
||||
(data: TelegramUser) => attach(data, onRequestClose),
|
||||
[onRequestClose],
|
||||
[attach, onRequestClose],
|
||||
);
|
||||
|
||||
const buttons = useMemo(
|
||||
|
|
|
@ -2,7 +2,6 @@ import { FC, memo } from 'react';
|
|||
|
||||
import { Hoverable } from '~/components/common/Hoverable';
|
||||
import { Columns } from '~/components/containers/Columns';
|
||||
import { InfiniteScroll } from '~/components/containers/InfiniteScroll';
|
||||
import { LabNoResults } from '~/components/lab/LabNoResults';
|
||||
import { LabNode } from '~/components/lab/LabNode';
|
||||
import { useLabContext } from '~/utils/context/LabContextProvider';
|
||||
|
|
|
@ -43,7 +43,7 @@ const Header: FC<HeaderProps> = observer(() => {
|
|||
borisCommentedAt &&
|
||||
((fetched && !user.last_seen_boris) ||
|
||||
isBefore(new Date(user.last_seen_boris), new Date(borisCommentedAt))),
|
||||
[borisCommentedAt, isUser, user.last_seen_boris, fetched],
|
||||
[isUser, indicatorEnabled, borisCommentedAt, fetched, user.last_seen_boris],
|
||||
);
|
||||
|
||||
// Needed for SSR
|
||||
|
|
|
@ -2,7 +2,6 @@ import { FC, useMemo } from 'react';
|
|||
|
||||
import { SubTitle } from '~/components/common/SubTitle';
|
||||
import { Card } from '~/components/containers/Card';
|
||||
import { Padder } from '~/components/containers/Padder';
|
||||
import { Backlink } from '~/components/node/Backlink';
|
||||
import { NodeBackLink } from '~/types';
|
||||
import { has } from '~/utils/ramda';
|
||||
|
|
|
@ -5,7 +5,6 @@ import { observer } from 'mobx-react-lite';
|
|||
import { CommentForm } from '~/components/comment/CommentForm';
|
||||
import { CommentWrapper } from '~/components/containers/CommentWrapper';
|
||||
import { UploadDropzone } from '~/components/upload/UploadDropzone';
|
||||
import { EMPTY_USER } from '~/constants/auth';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { UploadSubject, UploadTarget } from '~/constants/uploads';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
|
|
|
@ -23,23 +23,27 @@ const NotificationList: FC<NotificationListProps> = () => {
|
|||
|
||||
useEffect(() => {
|
||||
return () => markAsRead();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const renderItem = useCallback((item: NotificationItem) => {
|
||||
const isNew =
|
||||
!lastSeen ||
|
||||
!item.created_at ||
|
||||
isAfter(parseISO(item.created_at), lastSeen);
|
||||
switch (item.type) {
|
||||
case NotificationType.Comment:
|
||||
case NotificationType.Boris:
|
||||
return <NotificationComment item={item} isNew={isNew} />;
|
||||
case NotificationType.Node:
|
||||
return <NotificationNode item={item} isNew={isNew} />;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}, []);
|
||||
const renderItem = useCallback(
|
||||
(item: NotificationItem) => {
|
||||
const isNew =
|
||||
!lastSeen ||
|
||||
!item.created_at ||
|
||||
isAfter(parseISO(item.created_at), lastSeen);
|
||||
switch (item.type) {
|
||||
case NotificationType.Comment:
|
||||
case NotificationType.Boris:
|
||||
return <NotificationComment item={item} isNew={isNew} />;
|
||||
case NotificationType.Node:
|
||||
return <NotificationNode item={item} isNew={isNew} />;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
[lastSeen],
|
||||
);
|
||||
|
||||
if (isLoading) {
|
||||
return <LoaderScreen align="top" />;
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
import React, { FC, Fragment, useCallback, useMemo } from 'react';
|
||||
import React, { FC, Fragment } from 'react';
|
||||
|
||||
import { Superpower } from '~/components/boris/Superpower';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||
import { SOCIAL_ICONS } from '~/constants/auth/socials';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { useOAuth } from '~/hooks/auth/useOAuth';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import { Avatar } from '~/components/common/Avatar';
|
||||
import { Markdown } from '~/components/containers/Markdown';
|
||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||
import { imagePresets } from '~/constants/urls';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { formatText } from '~/utils/dom';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
|
|
@ -2,12 +2,10 @@ import React, { FC } from 'react';
|
|||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { Avatar } from '~/components/common/Avatar';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { useUserActiveStatus } from '~/hooks/auth/useUserActiveStatus';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { path } from '~/utils/ramda';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ import React, { useCallback, VFC } from 'react';
|
|||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { Superpower } from '~/components/boris/Superpower';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Zone } from '~/components/containers/Zone';
|
||||
|
@ -32,7 +31,7 @@ const ProfileSidebarMenu: VFC<ProfileSidebarMenuProps> = ({ onClose }) => {
|
|||
const onLogout = useCallback(() => {
|
||||
logout();
|
||||
onClose();
|
||||
}, [onClose]);
|
||||
}, [logout, onClose]);
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Zone } from '~/components/containers/Zone';
|
||||
import { SuperPowersToggle } from '~/containers/auth/SuperPowersToggle';
|
||||
|
||||
interface ProfileTogglesProps {}
|
||||
|
|
|
@ -20,7 +20,7 @@ const List = () => {
|
|||
async (id: number) => {
|
||||
confirm('Удалить? Это удалит заметку навсегда', () => remove(id));
|
||||
},
|
||||
[remove],
|
||||
[confirm, remove],
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
@ -6,11 +6,9 @@ import { Group } from '~/components/containers/Group';
|
|||
import { Zone } from '~/components/containers/Zone';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import { Textarea } from '~/components/input/Textarea';
|
||||
import { ERROR_LITERAL } from '~/constants/errors';
|
||||
import { ProfileAccounts } from '~/containers/profile/ProfileAccounts';
|
||||
import { useWindowSize } from '~/hooks/dom/useWindowSize';
|
||||
import { useSettings } from '~/utils/providers/SettingsProvider';
|
||||
import { has } from '~/utils/ramda';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import { SidebarWrapper } from '~/components/sidebar/SidebarWrapper';
|
|||
import { SidebarName } from '~/constants/sidebar';
|
||||
import { ProfileSidebarMenu } from '~/containers/profile/ProfileSidebarMenu';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
import { useUser } from '~/hooks/auth/useUser';
|
||||
import type { SidebarComponentProps } from '~/types/sidebar';
|
||||
import { isNil } from '~/utils/ramda';
|
||||
|
||||
|
@ -41,13 +40,14 @@ const SettingsSidebar: VFC<SettingsSidebarProps> = ({
|
|||
page: !isNil(val) ? tabs[val] : undefined,
|
||||
});
|
||||
},
|
||||
[open, onRequestClose],
|
||||
[openSidebar],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isUser) {
|
||||
onRequestClose();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isUser]);
|
||||
|
||||
if (!isUser) {
|
||||
|
|
|
@ -2,7 +2,6 @@ import { useMemo, VFC } from 'react';
|
|||
|
||||
import { InfiniteScroll } from '~/components/containers/InfiniteScroll';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { LoaderCircle } from '~/components/input/LoaderCircle';
|
||||
import { SidebarStack } from '~/components/sidebar/SidebarStack';
|
||||
import { SidebarStackCard } from '~/components/sidebar/SidebarStackCard';
|
||||
import { SidebarWrapper } from '~/components/sidebar/SidebarWrapper';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue