From 7a7b7a4bf9920ce1e82bae24d61cc78a8325697f Mon Sep 17 00:00:00 2001 From: Fedor Katurov <gotham48@gmail.com> Date: Mon, 20 Nov 2023 22:35:07 +0600 Subject: [PATCH] refactored react imports --- src/components/common/Anchor/index.tsx | 2 +- src/components/common/ArcProgress/index.tsx | 12 ++- src/components/common/Authorized/index.tsx | 2 +- src/components/common/Avatar/index.tsx | 2 +- .../common/BetterScrollDialog/index.tsx | 4 +- src/components/common/BlurWrapper/index.tsx | 6 +- src/components/common/Card/index.tsx | 2 +- src/components/common/CellGrid/index.tsx | 2 +- src/components/common/Columns/index.tsx | 2 +- src/components/common/CoverBackdrop/index.tsx | 2 +- src/components/common/DialogTitle/index.tsx | 6 +- src/components/common/DropHereIcon/index.tsx | 2 +- src/components/common/Filler/index.tsx | 4 +- src/components/common/Grid/index.tsx | 8 +- src/components/common/Group/index.tsx | 6 +- src/components/common/Hoverable/index.tsx | 2 +- src/components/common/Icon/index.tsx | 8 +- .../common/ImageLoadingWrapper/index.tsx | 2 +- .../common/ImageWithSSRLoad/index.tsx | 13 +++- .../common/InfiniteScroll/index.tsx | 12 ++- .../common/InlineUsername/index.tsx | 2 +- .../components/LoaderCircleInner/index.tsx | 9 ++- src/components/common/LoaderCircle/index.tsx | 2 +- src/components/common/LoaderScreen/index.tsx | 2 +- .../common/LoadingProgress/index.tsx | 2 +- src/components/common/Markdown/index.tsx | 2 +- src/components/common/ModalWrapper/index.tsx | 4 +- src/components/common/Padder/index.tsx | 4 +- src/components/common/PageTitle/index.tsx | 2 +- src/components/common/Panel/index.tsx | 15 +++- src/components/common/Pressable/index.tsx | 2 +- .../common/ScrollHelperBottom/index.tsx | 2 +- src/components/common/Square/index.tsx | 2 +- src/components/common/StatsRow/index.tsx | 15 +++- src/components/common/Sticky/index.tsx | 2 +- src/components/common/SubTitle/index.tsx | 2 +- src/components/common/Superpower/index.tsx | 2 +- src/components/common/Tabs/index.tsx | 21 +++-- src/components/common/TagField/index.tsx | 6 +- src/components/common/Zone/index.tsx | 2 +- src/components/flow/CellShade/index.tsx | 2 +- src/components/flow/FlowCell/index.tsx | 2 +- src/components/flow/FlowCellImage/index.tsx | 2 +- .../flow/FlowCellImageLazyLoad/index.tsx | 2 +- src/components/flow/FlowCellMenu/index.tsx | 2 +- src/components/flow/FlowCellText/index.tsx | 2 +- src/components/flow/FlowGrid/index.tsx | 2 +- src/components/flow/FlowRecent/index.tsx | 10 ++- .../flow/FlowSearchResults/index.tsx | 2 +- src/components/flow/FlowSwiperHero/index.tsx | 2 +- src/components/input/Button/index.tsx | 2 +- src/components/input/ButtonGroup/index.tsx | 2 +- src/components/input/InputRow/index.tsx | 2 +- src/components/input/InputText/index.tsx | 2 +- src/components/input/InputWrapper/index.tsx | 10 ++- src/components/input/LoadMoreButton/index.tsx | 12 ++- src/components/input/SearchInput/index.tsx | 2 +- src/components/input/Textarea/index.tsx | 17 ++-- src/components/input/Toggle/index.tsx | 4 +- src/components/lab/LabAudioBlock/index.tsx | 2 +- src/components/lab/LabBanner/index.tsx | 2 +- src/components/lab/LabBottomPanel/index.tsx | 2 +- src/components/lab/LabDescription/index.tsx | 2 +- src/components/lab/LabFactoryBanner/index.tsx | 2 +- src/components/lab/LabHead/index.tsx | 2 +- src/components/lab/LabHero/index.tsx | 2 +- src/components/lab/LabHeroes/index.tsx | 2 +- src/components/lab/LabImage/index.tsx | 2 +- src/components/lab/LabLine/index.tsx | 2 +- src/components/lab/LabNoResults/index.tsx | 2 +- src/components/lab/LabNode/index.tsx | 9 ++- src/components/lab/LabNodeTitle/index.tsx | 2 +- src/components/lab/LabPad/index.tsx | 2 +- src/components/lab/LabSquare/index.tsx | 2 +- src/components/lab/LabTags/index.tsx | 4 +- src/components/lab/LabText/index.tsx | 2 +- src/components/lab/LabVideo/index.tsx | 2 +- src/components/main/Footer/index.tsx | 2 +- src/components/main/GodRays/index.tsx | 78 ++++++++++--------- src/components/main/Logo/index.tsx | 2 - src/components/main/MainPreloader/index.tsx | 2 +- src/components/media/AudioPlayer/index.tsx | 2 +- src/components/media/ImagePreloader/index.tsx | 8 +- src/components/menu/CornerMenu/index.tsx | 2 +- src/components/menu/HorizontalMenu/index.tsx | 2 +- src/components/menu/MenuButton/index.tsx | 2 +- src/components/menu/MenuDots/index.tsx | 2 +- .../menu/MenuItemWithIcon/index.tsx | 2 +- src/components/menu/SeparatedMenu/index.tsx | 2 +- src/components/node/Backlink/index.tsx | 2 +- src/components/node/CommendDeleted/index.tsx | 2 +- src/components/node/NodeAudioBlock/index.tsx | 2 +- .../node/NodeAudioImageBlock/index.tsx | 2 +- src/components/node/NodeAuthorBlock/index.tsx | 2 +- .../node/NodeDeletedBadge/index.tsx | 8 +- src/components/node/NodeEditMenu/index.tsx | 2 +- .../node/NodeHeadMetadata/index.tsx | 7 +- .../node/NodeImageBlockPlaceholder/index.tsx | 2 +- src/components/node/NodeLikeButton/index.tsx | 2 +- src/components/node/NodeNoComments/index.tsx | 2 +- src/components/node/NodeRelated/index.tsx | 2 +- .../node/NodeRelated/placeholder.tsx | 2 +- .../node/NodeRelatedBlock/index.tsx | 2 +- src/components/node/NodeTags/index.tsx | 4 +- src/components/node/NodeTagsBlock/index.tsx | 2 +- .../node/NodeTagsPlaceholder/index.tsx | 10 ++- src/components/node/NodeTextBlock/index.tsx | 2 +- src/components/node/NodeVideoBlock/index.tsx | 2 +- src/components/notes/NoteCard/index.tsx | 2 +- src/components/notes/NoteMenu/index.tsx | 2 +- .../notifications/NotificationBadge/index.tsx | 2 +- .../NotificationSettingsForm/index.tsx | 2 +- .../placeholders/Paragraph/index.tsx | 2 +- .../placeholders/Placeholder/index.tsx | 8 +- .../profile/ProfileAccountsError/index.tsx | 2 +- .../profile/ProfileAvatar/index.tsx | 2 +- .../profile/ProfileDescription/index.tsx | 2 +- src/components/sidebar/SidebarStack/index.tsx | 2 +- .../sidebar/SidebarStackCard/index.tsx | 2 +- .../sidebar/SidebarWrapper/index.tsx | 2 +- .../sidebar/TagSidebarList/index.tsx | 2 +- .../sortable/DragOverlayItem/index.tsx | 2 +- .../sortable/SortableAudioGrid/index.tsx | 19 +++-- .../sortable/SortableGrid/index.tsx | 2 +- .../sortable/SortableImageGrid/index.tsx | 2 +- .../sortable/SortableItem/index.tsx | 11 +-- .../sortable/SortableList/index.tsx | 2 +- src/components/tags/Tag/index.tsx | 2 +- src/components/tags/TagAutocomplete/index.tsx | 9 +-- .../tags/TagAutocompleteRow/index.tsx | 2 +- src/components/tags/TagWrapper/index.tsx | 2 +- src/components/upload/AudioUpload/index.tsx | 2 +- src/components/upload/ImageUpload/index.tsx | 2 +- .../upload/UploadDropzone/index.tsx | 2 +- .../components/LoginDialogButtons/index.tsx | 2 +- .../LoginSocialRegisterButtons/index.tsx | 2 +- .../components/LoginStaticScene/index.tsx | 2 +- .../components/TelegramLoginForm/index.tsx | 2 +- .../auth/LoginSocialRegisterDialog/index.tsx | 2 +- .../components/RestoreInvalidCode/index.tsx | 2 +- .../components/RestoreSuccess/index.tsx | 2 +- .../auth/RestorePasswordDialog/index.tsx | 2 +- .../components/RestoreSent/index.tsx | 2 +- .../auth/RestoreRequestDialog/index.tsx | 2 +- .../components/BorisSuperpowers/index.tsx | 2 +- .../auth/TelegramAttachDialog/index.tsx | 2 +- .../components/BorisContacts/index.tsx | 2 +- .../components/BasicCurveChart/index.tsx | 2 +- .../components/BorisGraphicStats/index.tsx | 2 +- .../components/BorisStatsGit/index.tsx | 25 ++++-- .../components/BorisStatsGitCard/index.tsx | 18 +++-- .../BorisStats/components/StatsCard/index.tsx | 2 +- .../components/StatsCountdownCard/index.tsx | 2 +- .../components/StatsGraphCard/index.tsx | 2 +- .../components/BorisStats/index.tsx | 2 +- .../CommentFormAttachButtons/index.tsx | 2 +- .../components/CommentFormAttaches/index.tsx | 2 +- .../CommentFormFormatButtons/index.tsx | 25 +++--- .../components/CommentFormTextarea/index.tsx | 2 +- .../components/CommentAvatar/index.tsx | 2 +- .../comments/CommentWrapper/index.tsx | 2 +- .../dialogs/EditorCreateDialog/index.tsx | 23 ++++-- .../components/AudioGrid/index.tsx | 2 +- .../EditorAudioUploadButton/index.tsx | 2 +- .../components/EditorFiller/index.tsx | 2 +- .../EditorImageUploadButton/index.tsx | 2 +- .../components/EditorPublicSwitch/index.tsx | 2 +- .../components/EditorUploadButton/index.tsx | 2 +- .../EditorUploadCoverButton/index.tsx | 2 +- .../components/EditorActionsPanel/index.tsx | 2 +- .../components/EditorButtons/index.tsx | 2 +- .../components/EditorConfirmClose/index.tsx | 2 +- .../components/ImageEditor/index.tsx | 2 +- .../components/ImageGrid/index.tsx | 2 +- .../components/TextEditor/index.tsx | 16 ++-- .../components/VideoEditor/index.tsx | 9 ++- src/containers/dialogs/EditorDialog/index.tsx | 8 +- .../dialogs/EditorEditDialog/index.tsx | 2 +- .../dialogs/LoadingDialog/index.tsx | 2 +- src/containers/dialogs/Modal/index.tsx | 4 +- src/containers/dialogs/PhotoSwipe/index.tsx | 2 +- src/containers/dialogs/TestDialog/index.tsx | 2 +- src/containers/flow/FlowStamp/index.tsx | 2 +- src/containers/lab/LabLoading/index.tsx | 2 +- src/containers/lab/LabStats/index.tsx | 2 +- src/containers/main/BottomContainer/index.tsx | 2 +- src/containers/main/Container/index.tsx | 2 +- src/containers/main/MainRouter/index.tsx | 2 +- .../components/SubmitBar/index.tsx | 2 +- src/containers/main/SubmitBarRouter/index.tsx | 2 +- .../components/CommentEmbedBlock/index.tsx | 2 +- .../components/CommentLike/index.tsx | 2 +- .../components/CommentMenu/index.tsx | 2 +- .../components/CommentTextBlock/index.tsx | 2 +- .../components/CommentDistance/index.tsx | 2 +- .../NodeComments/components/Comment/index.tsx | 2 +- src/containers/node/NodeComments/index.tsx | 2 +- src/containers/pages/ErrorNotFound/index.tsx | 4 +- .../PlayerView/components/PlayerBar/index.tsx | 2 +- src/containers/player/PlayerView/index.tsx | 2 +- .../profile/ProfileAccounts/index.tsx | 2 +- src/containers/profile/ProfileInfo/index.tsx | 2 +- .../profile/ProfileLoader/index.tsx | 2 +- .../profile/ProfilePageLeft/index.tsx | 2 +- .../profile/ProfilePageStats/index.tsx | 2 +- .../profile/ProfileQuickInfo/index.tsx | 2 +- .../profile/ProfileSidebarHead/index.tsx | 2 +- .../ProfileSidebarLogoutButton/index.tsx | 2 +- .../profile/ProfileSidebarMenu/index.tsx | 2 +- src/containers/profile/ProfileStats/index.tsx | 2 +- src/containers/profile/ProfileTabs/index.tsx | 2 +- .../profile/ProfileToggles/index.tsx | 2 +- .../settings/SettingsDeleted/index.tsx | 2 +- .../settings/ThemeSwitcher/index.tsx | 2 +- .../sidebars/ProfileSidebar/index.tsx | 2 +- src/containers/tags/TagInput/index.tsx | 2 +- src/containers/tags/Tags/index.tsx | 8 +- src/hooks/dom/useDragDetector.tsx | 20 ++++- src/layouts/LabLayout/index.tsx | 2 +- src/layouts/MainLayout/index.tsx | 2 - src/layouts/NodeLayout/index.tsx | 2 +- src/layouts/NotFoundLayout/index.tsx | 6 +- src/layouts/RoomLayout/index.tsx | 2 +- src/layouts/SettingsLayout/index.tsx | 2 +- src/layouts/WelcomeLayout/index.tsx | 2 - src/pages/boris.tsx | 2 +- src/pages/index.tsx | 2 +- src/pages/lab.tsx | 2 +- src/pages/node/[id].tsx | 2 +- src/pages/profile/[username].tsx | 2 +- src/pages/room/index.tsx | 2 +- src/pages/settings/index.tsx | 2 - src/pages/settings/notes.tsx | 2 - src/pages/settings/trash.tsx | 2 - src/sprites/Sprites.tsx | 2 +- src/utils/context/CommentContextProvider.tsx | 2 +- src/utils/context/LabContextProvider.tsx | 9 ++- src/utils/context/NodeContextProvider.tsx | 2 +- .../context/NodeRelatedContextProvider.tsx | 14 +++- src/utils/context/StoreContextProvider.tsx | 14 ++-- src/utils/context/TagsContextProvider.tsx | 11 ++- src/utils/context/UploaderContextProvider.tsx | 2 +- src/utils/context/UserContextProvider.tsx | 2 +- src/utils/providers/AudioPlayerProvider.tsx | 42 ++++++++-- src/utils/providers/FlowProvider.tsx | 45 ++++++----- src/utils/providers/LabProvider.tsx | 2 +- src/utils/providers/MetadataProvider.tsx | 4 +- src/utils/providers/NodeRelatedProvider.tsx | 13 +++- src/utils/providers/SWRConfigProvider.tsx | 2 +- src/utils/providers/SearchProvider.tsx | 5 +- src/utils/providers/ThemeProvider.tsx | 2 +- src/utils/toast/index.tsx | 35 +++++---- src/utils/types.ts | 27 ++++--- 253 files changed, 679 insertions(+), 479 deletions(-) diff --git a/src/components/common/Anchor/index.tsx b/src/components/common/Anchor/index.tsx index bb84a655..d02abe9b 100644 --- a/src/components/common/Anchor/index.tsx +++ b/src/components/common/Anchor/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import NextLink from 'next/link'; import { Link } from 'react-router-dom'; diff --git a/src/components/common/ArcProgress/index.tsx b/src/components/common/ArcProgress/index.tsx index bc1d4bf5..51bdc35a 100644 --- a/src/components/common/ArcProgress/index.tsx +++ b/src/components/common/ArcProgress/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { describeArc } from '~/utils/dom'; @@ -11,6 +11,14 @@ interface IProps { export const ArcProgress: FC<IProps> = ({ size, progress = 0 }) => ( <svg className={styles.icon} width={size} height={size}> - <path d={describeArc(size / 2, size / 2, size / 2 - 2, 360 * (1 - progress), 360)} /> + <path + d={describeArc( + size / 2, + size / 2, + size / 2 - 2, + 360 * (1 - progress), + 360, + )} + /> </svg> ); diff --git a/src/components/common/Authorized/index.tsx b/src/components/common/Authorized/index.tsx index d38a9ea6..ba997cef 100644 --- a/src/components/common/Authorized/index.tsx +++ b/src/components/common/Authorized/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/components/common/Avatar/index.tsx b/src/components/common/Avatar/index.tsx index dea2ef51..dc35d469 100644 --- a/src/components/common/Avatar/index.tsx +++ b/src/components/common/Avatar/index.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef } from 'react'; +import { forwardRef } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/BetterScrollDialog/index.tsx b/src/components/common/BetterScrollDialog/index.tsx index cb15f2aa..fe9780e1 100644 --- a/src/components/common/BetterScrollDialog/index.tsx +++ b/src/components/common/BetterScrollDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, MouseEventHandler, useEffect, useRef } from 'react'; +import { FC, MouseEventHandler, ReactChild, useEffect, useRef } from 'react'; import { clearAllBodyScrollLocks, disableBodyScroll } from 'body-scroll-lock'; @@ -8,7 +8,7 @@ import { LoaderCircle } from '~/components/common/LoaderCircle'; import styles from './styles.module.scss'; interface IProps { - children: React.ReactChild; + children: ReactChild; header?: JSX.Element; footer?: JSX.Element; backdrop?: JSX.Element; diff --git a/src/components/common/BlurWrapper/index.tsx b/src/components/common/BlurWrapper/index.tsx index 58f81140..f83ed2c4 100644 --- a/src/components/common/BlurWrapper/index.tsx +++ b/src/components/common/BlurWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { AllHTMLAttributes, FC } from 'react'; +import { AllHTMLAttributes, FC } from 'react'; import classNames from 'classnames'; @@ -7,5 +7,7 @@ import styles from './styles.module.scss'; type IProps = AllHTMLAttributes<HTMLDivElement> & { is_blurred: boolean }; export const BlurWrapper: FC<IProps> = ({ children, is_blurred }) => ( - <div className={classNames(styles.blur, { [styles.is_blurred]: is_blurred })}>{children}</div> + <div className={classNames(styles.blur, { [styles.is_blurred]: is_blurred })}> + {children} + </div> ); diff --git a/src/components/common/Card/index.tsx b/src/components/common/Card/index.tsx index 70576544..8986c6da 100644 --- a/src/components/common/Card/index.tsx +++ b/src/components/common/Card/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/CellGrid/index.tsx b/src/components/common/CellGrid/index.tsx index f0b02046..99fc4c85 100644 --- a/src/components/common/CellGrid/index.tsx +++ b/src/components/common/CellGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, HTMLAttributes } from 'react'; +import { FC, HTMLAttributes } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/Columns/index.tsx b/src/components/common/Columns/index.tsx index d7d164ed..65459c4f 100644 --- a/src/components/common/Columns/index.tsx +++ b/src/components/common/Columns/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useRef, useState } from 'react'; +import { FC, useEffect, useRef, useState } from 'react'; import Masonry from 'react-masonry-css'; diff --git a/src/components/common/CoverBackdrop/index.tsx b/src/components/common/CoverBackdrop/index.tsx index f9bc38a6..4cce6607 100644 --- a/src/components/common/CoverBackdrop/index.tsx +++ b/src/components/common/CoverBackdrop/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useEffect, useRef, useState } from 'react'; +import { FC, useCallback, useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/DialogTitle/index.tsx b/src/components/common/DialogTitle/index.tsx index abdbc47b..b5de8560 100644 --- a/src/components/common/DialogTitle/index.tsx +++ b/src/components/common/DialogTitle/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode } from 'react'; +import { FC, ReactNode } from 'react'; import styles from './styles.module.scss'; @@ -6,6 +6,8 @@ interface IProps { children: ReactNode; } -const DialogTitle: FC<IProps> = ({ children }) => <h2 className={styles.title}>{children}</h2>; +const DialogTitle: FC<IProps> = ({ children }) => ( + <h2 className={styles.title}>{children}</h2> +); export { DialogTitle }; diff --git a/src/components/common/DropHereIcon/index.tsx b/src/components/common/DropHereIcon/index.tsx index 0ff4e2d9..ad44361a 100644 --- a/src/components/common/DropHereIcon/index.tsx +++ b/src/components/common/DropHereIcon/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { SVGProps } from '~/utils/types'; diff --git a/src/components/common/Filler/index.tsx b/src/components/common/Filler/index.tsx index a65ec693..2f3c6ac7 100644 --- a/src/components/common/Filler/index.tsx +++ b/src/components/common/Filler/index.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react'; +import { FC, HTMLAttributes } from 'react'; import classNames from 'classnames'; import styles from './styles.module.scss'; -type IProps = React.HTMLAttributes<HTMLDivElement>; +type IProps = HTMLAttributes<HTMLDivElement>; export const Filler: FC<IProps> = ({ className = '', ...props }) => ( <div className={classNames(styles.filler, className)} {...props} /> diff --git a/src/components/common/Grid/index.tsx b/src/components/common/Grid/index.tsx index bfc83ae2..b8a0ec3f 100644 --- a/src/components/common/Grid/index.tsx +++ b/src/components/common/Grid/index.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react'; +import { FC, HTMLAttributes } from 'react'; import classNames from 'classnames'; import styles from './styles.module.scss'; -type IProps = React.HTMLAttributes<HTMLDivElement> & { +type IProps = HTMLAttributes<HTMLDivElement> & { horizontal?: boolean; vertical?: boolean; columns?: string; @@ -41,7 +41,9 @@ const Grid: FC<IProps> = ({ gridTemplateColumns: square ? `repeat(auto-fill, ${(columns !== 'auto' && columns) || size})` : columns, - gridTemplateRows: square ? `repeat(auto-fill, ${(rows !== 'auto' && rows) || size})` : rows, + gridTemplateRows: square + ? `repeat(auto-fill, ${(rows !== 'auto' && rows) || size})` + : rows, gridAutoRows: rows, gridAutoColumns: columns, gridRowGap: gap, diff --git a/src/components/common/Group/index.tsx b/src/components/common/Group/index.tsx index 906132ad..2ca88b38 100644 --- a/src/components/common/Group/index.tsx +++ b/src/components/common/Group/index.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react'; +import { FC, HTMLAttributes } from 'react'; import classNames from 'classnames'; import styles from './styles.module.scss'; -type IProps = React.HTMLAttributes<HTMLDivElement> & { +type IProps = HTMLAttributes<HTMLDivElement> & { horizontal?: boolean; top?: boolean; bottom?: boolean; @@ -33,7 +33,7 @@ const Group: FC<IProps> = ({ [styles.wrap]: wrap, [styles.seamless]: seamless, }, - className + className, )} {...props} > diff --git a/src/components/common/Hoverable/index.tsx b/src/components/common/Hoverable/index.tsx index c64c5f3e..6fd25339 100644 --- a/src/components/common/Hoverable/index.tsx +++ b/src/components/common/Hoverable/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode } from 'react'; +import { FC, ReactNode } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/Icon/index.tsx b/src/components/common/Icon/index.tsx index 9918e22e..a5fd8efc 100644 --- a/src/components/common/Icon/index.tsx +++ b/src/components/common/Icon/index.tsx @@ -1,15 +1,13 @@ -import React, { FC } from 'react'; +import { FC, SVGAttributes } from 'react'; import { IIcon } from '~/types'; -type IProps = React.SVGAttributes<SVGElement> & { +type IProps = SVGAttributes<SVGElement> & { size?: number; icon: IIcon; }; -export const Icon: FC<IProps> = ({ - size = 20, icon, style, ...props -}) => ( +export const Icon: FC<IProps> = ({ size = 20, icon, style, ...props }) => ( <svg width={size} height={size} diff --git a/src/components/common/ImageLoadingWrapper/index.tsx b/src/components/common/ImageLoadingWrapper/index.tsx index a189e205..2aafb855 100644 --- a/src/components/common/ImageLoadingWrapper/index.tsx +++ b/src/components/common/ImageLoadingWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { CSSProperties, ReactNode, forwardRef, diff --git a/src/components/common/ImageWithSSRLoad/index.tsx b/src/components/common/ImageWithSSRLoad/index.tsx index 467540c1..884d392f 100644 --- a/src/components/common/ImageWithSSRLoad/index.tsx +++ b/src/components/common/ImageWithSSRLoad/index.tsx @@ -1,7 +1,16 @@ -import React, { useEffect, useRef, VFC } from 'react'; +import { + DetailedHTMLProps, + ImgHTMLAttributes, + useEffect, + useRef, + VFC, +} from 'react'; interface ImgProps - extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> { + extends DetailedHTMLProps< + ImgHTMLAttributes<HTMLImageElement>, + HTMLImageElement + > { onLoad?: () => void; } diff --git a/src/components/common/InfiniteScroll/index.tsx b/src/components/common/InfiniteScroll/index.tsx index ac7024a8..8a5d5062 100644 --- a/src/components/common/InfiniteScroll/index.tsx +++ b/src/components/common/InfiniteScroll/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, HTMLAttributes, useCallback, useEffect, useRef } from 'react'; +import { FC, HTMLAttributes, useCallback, useEffect, useRef } from 'react'; import styles from './styles.module.scss'; @@ -8,7 +8,13 @@ interface IProps extends HTMLAttributes<HTMLDivElement> { loadMore: () => void; } -const InfiniteScroll: FC<IProps> = ({ children, hasMore, scrollReactPx, loadMore, ...props }) => { +const InfiniteScroll: FC<IProps> = ({ + children, + hasMore, + scrollReactPx, + loadMore, + ...props +}) => { const ref = useRef<HTMLDivElement>(null); const onScrollEnd = useCallback( @@ -16,7 +22,7 @@ const InfiniteScroll: FC<IProps> = ({ children, hasMore, scrollReactPx, loadMore if (!hasMore || !entries[0].isIntersecting) return; loadMore(); }, - [hasMore, loadMore] + [hasMore, loadMore], ); useEffect(() => { diff --git a/src/components/common/InlineUsername/index.tsx b/src/components/common/InlineUsername/index.tsx index 1bfb3124..85a12343 100644 --- a/src/components/common/InlineUsername/index.tsx +++ b/src/components/common/InlineUsername/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { useColorFromString } from '~/hooks/color/useColorFromString'; diff --git a/src/components/common/LoaderCircle/components/LoaderCircleInner/index.tsx b/src/components/common/LoaderCircle/components/LoaderCircleInner/index.tsx index 5658f14c..d7734884 100644 --- a/src/components/common/LoaderCircle/components/LoaderCircleInner/index.tsx +++ b/src/components/common/LoaderCircle/components/LoaderCircleInner/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, SVGAttributes } from 'react'; +import { FC, SVGAttributes } from 'react'; import classNames from 'classnames'; @@ -12,7 +12,12 @@ interface IProps extends SVGAttributes<SVGElement> { } const LoaderCircleInner: FC<IProps> = ({ size, className, ...props }) => ( - <svg className={classNames(styles.icon, className)} width={size} height={size} {...props}> + <svg + className={classNames(styles.icon, className)} + width={size} + height={size} + {...props} + > <path d={describeArc(size / 2, size / 2, size / 2, 0, 90)} /> <path d={describeArc(size / 2, size / 2, size / 2, 180, 270)} /> </svg> diff --git a/src/components/common/LoaderCircle/index.tsx b/src/components/common/LoaderCircle/index.tsx index c04e112a..d74b9e61 100644 --- a/src/components/common/LoaderCircle/index.tsx +++ b/src/components/common/LoaderCircle/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/LoaderScreen/index.tsx b/src/components/common/LoaderScreen/index.tsx index 0cc3c1da..a6ebccfc 100644 --- a/src/components/common/LoaderScreen/index.tsx +++ b/src/components/common/LoaderScreen/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/LoadingProgress/index.tsx b/src/components/common/LoadingProgress/index.tsx index e5c387b2..dcbd3a39 100644 --- a/src/components/common/LoadingProgress/index.tsx +++ b/src/components/common/LoadingProgress/index.tsx @@ -1,4 +1,4 @@ -import React, { Fragment, VFC } from 'react'; +import { Fragment, VFC } from 'react'; import { useSSRLoadingIndicator } from '~/hooks/dom/useSSRLoadingIndicator'; diff --git a/src/components/common/Markdown/index.tsx b/src/components/common/Markdown/index.tsx index 3d9e349e..1334b288 100644 --- a/src/components/common/Markdown/index.tsx +++ b/src/components/common/Markdown/index.tsx @@ -1,4 +1,4 @@ -import React, { DetailedHTMLProps, VFC, HTMLAttributes } from 'react'; +import { DetailedHTMLProps, VFC, HTMLAttributes } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/ModalWrapper/index.tsx b/src/components/common/ModalWrapper/index.tsx index 577174dd..efef7088 100644 --- a/src/components/common/ModalWrapper/index.tsx +++ b/src/components/common/ModalWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, MouseEventHandler } from 'react'; +import { FC, MouseEventHandler } from 'react'; import ReactDOM from 'react-dom'; @@ -14,7 +14,7 @@ const ModalWrapper: FC<IProps> = ({ children, onOverlayClick }) => { <div className={styles.overlay} onClick={onOverlayClick} /> <div className={styles.content}>{children}</div> </div>, - document.body + document.body, ); }; diff --git a/src/components/common/Padder/index.tsx b/src/components/common/Padder/index.tsx index 6247b581..90839804 100644 --- a/src/components/common/Padder/index.tsx +++ b/src/components/common/Padder/index.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react'; +import { FC, HTMLAttributes } from 'react'; import classNames from 'classnames'; import styles from './styles.module.scss'; -type IProps = React.HTMLAttributes<HTMLDivElement> & { +type IProps = HTMLAttributes<HTMLDivElement> & { padding?: number; vertical?: boolean; horizontal?: boolean; diff --git a/src/components/common/PageTitle/index.tsx b/src/components/common/PageTitle/index.tsx index 91e5f2da..2227af18 100644 --- a/src/components/common/PageTitle/index.tsx +++ b/src/components/common/PageTitle/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import Head from 'next/head'; diff --git a/src/components/common/Panel/index.tsx b/src/components/common/Panel/index.tsx index 440dc17c..f3176bc1 100644 --- a/src/components/common/Panel/index.tsx +++ b/src/components/common/Panel/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, HTMLAttributes } from 'react'; +import { FC, HTMLAttributes } from 'react'; import classNames from 'classnames'; @@ -9,8 +9,17 @@ type IProps = HTMLAttributes<HTMLDivElement> & { stretchy?: boolean; }; -const Panel: FC<IProps> = ({ className, children, seamless, stretchy, ...props }) => ( - <div className={classNames(styles.panel, className, { seamless, stretchy })} {...props}> +const Panel: FC<IProps> = ({ + className, + children, + seamless, + stretchy, + ...props +}) => ( + <div + className={classNames(styles.panel, className, { seamless, stretchy })} + {...props} + > {children} </div> ); diff --git a/src/components/common/Pressable/index.tsx b/src/components/common/Pressable/index.tsx index 86778068..45fb8e3f 100644 --- a/src/components/common/Pressable/index.tsx +++ b/src/components/common/Pressable/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/ScrollHelperBottom/index.tsx b/src/components/common/ScrollHelperBottom/index.tsx index 4febcadf..60f4589d 100644 --- a/src/components/common/ScrollHelperBottom/index.tsx +++ b/src/components/common/ScrollHelperBottom/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/Square/index.tsx b/src/components/common/Square/index.tsx index ff471820..f3ab983a 100644 --- a/src/components/common/Square/index.tsx +++ b/src/components/common/Square/index.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef } from 'react'; +import { forwardRef } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/StatsRow/index.tsx b/src/components/common/StatsRow/index.tsx index 6a6a9b4e..c157a634 100644 --- a/src/components/common/StatsRow/index.tsx +++ b/src/components/common/StatsRow/index.tsx @@ -1,15 +1,24 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Placeholder } from '~/components/placeholders/Placeholder'; import styles from './styles.module.scss'; -const StatsRow: FC<{ isLoading: boolean; label: string }> = ({ isLoading, label, children }) => ( +const StatsRow: FC<{ isLoading: boolean; label: string }> = ({ + isLoading, + label, + children, +}) => ( <li className={styles.row}> {isLoading ? ( <> <Placeholder active={isLoading} loading className={styles.label} /> - <Placeholder active={isLoading} loading className={styles.value} width="24px" /> + <Placeholder + active={isLoading} + loading + className={styles.value} + width="24px" + /> </> ) : ( <> diff --git a/src/components/common/Sticky/index.tsx b/src/components/common/Sticky/index.tsx index bf664518..3fb9628d 100644 --- a/src/components/common/Sticky/index.tsx +++ b/src/components/common/Sticky/index.tsx @@ -1,4 +1,4 @@ -import React, { DetailsHTMLAttributes, FC } from 'react'; +import { DetailsHTMLAttributes, FC } from 'react'; import StickyBox from 'react-sticky-box'; diff --git a/src/components/common/SubTitle/index.tsx b/src/components/common/SubTitle/index.tsx index 7b090b9c..ebfd8961 100644 --- a/src/components/common/SubTitle/index.tsx +++ b/src/components/common/SubTitle/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/common/Superpower/index.tsx b/src/components/common/Superpower/index.tsx index 1ee45c4e..2b78429f 100644 --- a/src/components/common/Superpower/index.tsx +++ b/src/components/common/Superpower/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/components/common/Tabs/index.tsx b/src/components/common/Tabs/index.tsx index ad2772c4..4a9c9e7a 100644 --- a/src/components/common/Tabs/index.tsx +++ b/src/components/common/Tabs/index.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext, useMemo, useState, VFC } from 'react'; +import { createContext, FC, useContext, useMemo, useState, VFC } from 'react'; import classNames from 'classnames'; @@ -20,7 +20,9 @@ const HorizontalList: VFC<TabProps> = ({ items }) => { <div className={styles.tabs}> {items.map((it, index) => ( <div - className={classNames(styles.tab, { [styles.active]: activeTab === index })} + className={classNames(styles.tab, { + [styles.active]: activeTab === index, + })} onClick={() => setActiveTab(index)} key={it} > @@ -38,20 +40,27 @@ const Content: FC<any> = ({ children }) => { return [children]; } - return children.filter(it => it); + return children.filter((it) => it); }, [children]); - if (Array.isArray(notEmptyChildren) && notEmptyChildren.length - 1 < activeTab) { + if ( + Array.isArray(notEmptyChildren) && + notEmptyChildren.length - 1 < activeTab + ) { return notEmptyChildren[notEmptyChildren.length - 1]; } return notEmptyChildren[activeTab]; }; -const Tabs = function({ children }) { +const Tabs = function ({ children }) { const [activeTab, setActiveTab] = useState(0); - return <TabContext.Provider value={{ activeTab, setActiveTab }}>{children}</TabContext.Provider>; + return ( + <TabContext.Provider value={{ activeTab, setActiveTab }}> + {children} + </TabContext.Provider> + ); }; Tabs.Horizontal = HorizontalList; diff --git a/src/components/common/TagField/index.tsx b/src/components/common/TagField/index.tsx index d2bb2144..84d4613b 100644 --- a/src/components/common/TagField/index.tsx +++ b/src/components/common/TagField/index.tsx @@ -1,9 +1,11 @@ -import React, { FC, HTMLAttributes } from 'react'; +import { FC, HTMLAttributes } from 'react'; import styles from './styles.module.scss'; type IProps = HTMLAttributes<HTMLDivElement> & {}; -const TagField: FC<IProps> = ({ children }) => <div className={styles.wrap}>{children}</div>; +const TagField: FC<IProps> = ({ children }) => ( + <div className={styles.wrap}>{children}</div> +); export { TagField }; diff --git a/src/components/common/Zone/index.tsx b/src/components/common/Zone/index.tsx index 86c13f71..016c8c45 100644 --- a/src/components/common/Zone/index.tsx +++ b/src/components/common/Zone/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/flow/CellShade/index.tsx b/src/components/flow/CellShade/index.tsx index 758d4097..61b50260 100644 --- a/src/components/flow/CellShade/index.tsx +++ b/src/components/flow/CellShade/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; import { transparentize } from 'color2k'; diff --git a/src/components/flow/FlowCell/index.tsx b/src/components/flow/FlowCell/index.tsx index 608f1e85..cd8b74ba 100644 --- a/src/components/flow/FlowCell/index.tsx +++ b/src/components/flow/FlowCell/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/components/flow/FlowCellImage/index.tsx b/src/components/flow/FlowCellImage/index.tsx index f105cade..9b822918 100644 --- a/src/components/flow/FlowCellImage/index.tsx +++ b/src/components/flow/FlowCellImage/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; import Image from 'next/image'; diff --git a/src/components/flow/FlowCellImageLazyLoad/index.tsx b/src/components/flow/FlowCellImageLazyLoad/index.tsx index 2c722210..3b3d8b9a 100644 --- a/src/components/flow/FlowCellImageLazyLoad/index.tsx +++ b/src/components/flow/FlowCellImageLazyLoad/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; import LazyLoad from 'react-lazyload'; diff --git a/src/components/flow/FlowCellMenu/index.tsx b/src/components/flow/FlowCellMenu/index.tsx index 739d531b..b188e600 100644 --- a/src/components/flow/FlowCellMenu/index.tsx +++ b/src/components/flow/FlowCellMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/flow/FlowCellText/index.tsx b/src/components/flow/FlowCellText/index.tsx index f23fbe90..e49e2822 100644 --- a/src/components/flow/FlowCellText/index.tsx +++ b/src/components/flow/FlowCellText/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactElement } from 'react'; +import { FC, ReactElement } from 'react'; import classNames from 'classnames'; diff --git a/src/components/flow/FlowGrid/index.tsx b/src/components/flow/FlowGrid/index.tsx index 5aac50b5..e5db9697 100644 --- a/src/components/flow/FlowGrid/index.tsx +++ b/src/components/flow/FlowGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, Fragment } from 'react'; +import { FC, Fragment } from 'react'; import classNames from 'classnames'; import { observer } from 'mobx-react-lite'; diff --git a/src/components/flow/FlowRecent/index.tsx b/src/components/flow/FlowRecent/index.tsx index 2539b40d..ca856b62 100644 --- a/src/components/flow/FlowRecent/index.tsx +++ b/src/components/flow/FlowRecent/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { IFlowNode } from '~/types'; @@ -15,11 +15,15 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => { return ( <> <div className={styles.updates}> - {updated && updated.map(node => <FlowRecentItem node={node} key={node.id} has_new />)} + {updated && + updated.map((node) => ( + <FlowRecentItem node={node} key={node.id} has_new /> + ))} </div> <div className={styles.recent}> - {recent && recent.map(node => <FlowRecentItem node={node} key={node.id} />)} + {recent && + recent.map((node) => <FlowRecentItem node={node} key={node.id} />)} </div> </> ); diff --git a/src/components/flow/FlowSearchResults/index.tsx b/src/components/flow/FlowSearchResults/index.tsx index c4c539e7..f37325ec 100644 --- a/src/components/flow/FlowSearchResults/index.tsx +++ b/src/components/flow/FlowSearchResults/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Icon } from '~/components/common/Icon'; import { InfiniteScroll } from '~/components/common/InfiniteScroll'; diff --git a/src/components/flow/FlowSwiperHero/index.tsx b/src/components/flow/FlowSwiperHero/index.tsx index 3fc07041..f66cfc24 100644 --- a/src/components/flow/FlowSwiperHero/index.tsx +++ b/src/components/flow/FlowSwiperHero/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useMemo, useState } from 'react'; +import { FC, useCallback, useMemo, useState } from 'react'; import classNames from 'classnames'; import Image from 'next/future/image'; diff --git a/src/components/input/Button/index.tsx b/src/components/input/Button/index.tsx index 6e65fb6c..b03f3c23 100644 --- a/src/components/input/Button/index.tsx +++ b/src/components/input/Button/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { ButtonHTMLAttributes, DetailedHTMLProps, FC, diff --git a/src/components/input/ButtonGroup/index.tsx b/src/components/input/ButtonGroup/index.tsx index 58330384..d582cad2 100644 --- a/src/components/input/ButtonGroup/index.tsx +++ b/src/components/input/ButtonGroup/index.tsx @@ -1,4 +1,4 @@ -import React, { HTMLAttributes } from 'react'; +import { HTMLAttributes } from 'react'; import classNames from 'classnames'; diff --git a/src/components/input/InputRow/index.tsx b/src/components/input/InputRow/index.tsx index 9fb25231..244adb27 100644 --- a/src/components/input/InputRow/index.tsx +++ b/src/components/input/InputRow/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode } from 'react'; +import { FC, ReactNode } from 'react'; import classNames from 'classnames'; diff --git a/src/components/input/InputText/index.tsx b/src/components/input/InputText/index.tsx index b69f02c7..3c96a720 100644 --- a/src/components/input/InputText/index.tsx +++ b/src/components/input/InputText/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { ChangeEvent, DetailedHTMLProps, FC, diff --git a/src/components/input/InputWrapper/index.tsx b/src/components/input/InputWrapper/index.tsx index fcf912e8..4e3733f3 100644 --- a/src/components/input/InputWrapper/index.tsx +++ b/src/components/input/InputWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; @@ -11,7 +11,13 @@ interface InputWrapperProps { notEmpty: boolean; } -const InputWrapper: FC<InputWrapperProps> = ({ children, notEmpty, title, focused, error }) => ( +const InputWrapper: FC<InputWrapperProps> = ({ + children, + notEmpty, + title, + focused, + error, +}) => ( <div className={classNames(styles.content, { [styles.has_error]: !!error, diff --git a/src/components/input/LoadMoreButton/index.tsx b/src/components/input/LoadMoreButton/index.tsx index c3a71a51..4f4435f7 100644 --- a/src/components/input/LoadMoreButton/index.tsx +++ b/src/components/input/LoadMoreButton/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Button } from '~/components/input/Button'; @@ -10,9 +10,15 @@ interface LoadMoreButtonProps { } const LoadMoreButton: FC<LoadMoreButtonProps> = ({ isLoading, onClick }) => ( - <Button color="flat" onClick={onClick} stretchy className={styles.more} loading={isLoading}> + <Button + color="flat" + onClick={onClick} + stretchy + className={styles.more} + loading={isLoading} + > Показать ещё комментарии </Button> ); -export { LoadMoreButton } +export { LoadMoreButton }; diff --git a/src/components/input/SearchInput/index.tsx b/src/components/input/SearchInput/index.tsx index 6a3fc4e5..f922b0f3 100644 --- a/src/components/input/SearchInput/index.tsx +++ b/src/components/input/SearchInput/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Icon } from '~/components/common/Icon'; import { InputText, InputTextProps } from '~/components/input/InputText'; diff --git a/src/components/input/Textarea/index.tsx b/src/components/input/Textarea/index.tsx index 4e2ab9fa..aeb59504 100644 --- a/src/components/input/Textarea/index.tsx +++ b/src/components/input/Textarea/index.tsx @@ -1,11 +1,11 @@ -import React, { +import { ChangeEvent, DetailedHTMLProps, forwardRef, TextareaHTMLAttributes, useCallback, useEffect, - useState + useState, } from 'react'; import autosize from 'autosize'; @@ -42,14 +42,14 @@ const Textarea = forwardRef<HTMLTextAreaElement, IProps>( value, ...props }, - forwardRef + forwardRef, ) => { const ref = useForwardRef(forwardRef); const [focused, setFocused] = useState(false); const onInput = useCallback( ({ target }: ChangeEvent<HTMLTextAreaElement>) => handler(target.value), - [handler] + [handler], ); const onFocus = useCallback(() => setFocused(true), [setFocused]); @@ -68,7 +68,12 @@ const Textarea = forwardRef<HTMLTextAreaElement, IProps>( }, [ref, value, forwardRef]); return ( - <InputWrapper title={title} error={error} focused={focused} notEmpty={!!value}> + <InputWrapper + title={title} + error={error} + focused={focused} + notEmpty={!!value} + > <textarea {...props} ref={ref} @@ -85,7 +90,7 @@ const Textarea = forwardRef<HTMLTextAreaElement, IProps>( /> </InputWrapper> ); - } + }, ); export { Textarea }; diff --git a/src/components/input/Toggle/index.tsx b/src/components/input/Toggle/index.tsx index 8ad1555b..c271e5e1 100644 --- a/src/components/input/Toggle/index.tsx +++ b/src/components/input/Toggle/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classNames from 'classnames'; @@ -31,7 +31,7 @@ const Toggle: FC<IProps> = ({ value, handler, color = 'primary', ...rest }) => { styles.toggle, { [styles.active]: value }, styles[color], - rest.className + rest.className, )} onClick={onClick} /> diff --git a/src/components/lab/LabAudioBlock/index.tsx b/src/components/lab/LabAudioBlock/index.tsx index 5c565f2d..8360b868 100644 --- a/src/components/lab/LabAudioBlock/index.tsx +++ b/src/components/lab/LabAudioBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { NodeAudioBlock } from '~/components/node/NodeAudioBlock'; import { Placeholder } from '~/components/placeholders/Placeholder'; diff --git a/src/components/lab/LabBanner/index.tsx b/src/components/lab/LabBanner/index.tsx index 04e0dd58..6c2f90b5 100644 --- a/src/components/lab/LabBanner/index.tsx +++ b/src/components/lab/LabBanner/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { LabSquare } from '~/components/lab/LabSquare'; diff --git a/src/components/lab/LabBottomPanel/index.tsx b/src/components/lab/LabBottomPanel/index.tsx index 2ad11099..6cdd05ea 100644 --- a/src/components/lab/LabBottomPanel/index.tsx +++ b/src/components/lab/LabBottomPanel/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classNames from 'classnames'; diff --git a/src/components/lab/LabDescription/index.tsx b/src/components/lab/LabDescription/index.tsx index 5bc8da77..7ed92f09 100644 --- a/src/components/lab/LabDescription/index.tsx +++ b/src/components/lab/LabDescription/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Markdown } from '~/components/common/Markdown'; import { Paragraph } from '~/components/placeholders/Paragraph'; diff --git a/src/components/lab/LabFactoryBanner/index.tsx b/src/components/lab/LabFactoryBanner/index.tsx index fa9c36ef..493480b4 100644 --- a/src/components/lab/LabFactoryBanner/index.tsx +++ b/src/components/lab/LabFactoryBanner/index.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from 'react'; +import { useRef } from 'react'; import classNames from 'classnames'; diff --git a/src/components/lab/LabHead/index.tsx b/src/components/lab/LabHead/index.tsx index caab0535..6983c231 100644 --- a/src/components/lab/LabHead/index.tsx +++ b/src/components/lab/LabHead/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Filler } from '~/components/common/Filler'; import { SearchInput } from '~/components/input/SearchInput'; diff --git a/src/components/lab/LabHero/index.tsx b/src/components/lab/LabHero/index.tsx index 96301c04..ed836f03 100644 --- a/src/components/lab/LabHero/index.tsx +++ b/src/components/lab/LabHero/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Group } from '~/components/common/Group'; import { Icon } from '~/components/common/Icon'; diff --git a/src/components/lab/LabHeroes/index.tsx b/src/components/lab/LabHeroes/index.tsx index 456e496d..2cbcb053 100644 --- a/src/components/lab/LabHeroes/index.tsx +++ b/src/components/lab/LabHeroes/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { LabHero } from '~/components/lab/LabHero'; diff --git a/src/components/lab/LabImage/index.tsx b/src/components/lab/LabImage/index.tsx index 346b2986..f371e2d3 100644 --- a/src/components/lab/LabImage/index.tsx +++ b/src/components/lab/LabImage/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import Image from 'next/future/image'; diff --git a/src/components/lab/LabLine/index.tsx b/src/components/lab/LabLine/index.tsx index a29443fe..2c22c1d6 100644 --- a/src/components/lab/LabLine/index.tsx +++ b/src/components/lab/LabLine/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { NodeComponentProps } from '~/constants/node'; import { useColorGradientFromString } from '~/hooks/color/useColorGradientFromString'; diff --git a/src/components/lab/LabNoResults/index.tsx b/src/components/lab/LabNoResults/index.tsx index 86d40f48..398bced4 100644 --- a/src/components/lab/LabNoResults/index.tsx +++ b/src/components/lab/LabNoResults/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Card } from '~/components/common/Card'; import { Button } from '~/components/input/Button'; diff --git a/src/components/lab/LabNode/index.tsx b/src/components/lab/LabNode/index.tsx index 8864fed5..e75b4586 100644 --- a/src/components/lab/LabNode/index.tsx +++ b/src/components/lab/LabNode/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; import { isAfter, parseISO } from 'date-fns'; @@ -10,7 +10,6 @@ import { INode } from '~/types'; import styles from './styles.module.scss'; - interface IProps { node: INode; lastSeen: string | null | undefined; @@ -23,8 +22,10 @@ const LabNode: FC<IProps> = ({ node, isLoading, lastSeen, commentCount }) => { const hasNewComments = useMemo( () => - !!node.commented_at && !!lastSeen && isAfter(parseISO(node.commented_at), parseISO(lastSeen)), - [node.commented_at, lastSeen] + !!node.commented_at && + !!lastSeen && + isAfter(parseISO(node.commented_at), parseISO(lastSeen)), + [node.commented_at, lastSeen], ); const background = useColorGradientFromString(node.title, 3, 2); diff --git a/src/components/lab/LabNodeTitle/index.tsx b/src/components/lab/LabNodeTitle/index.tsx index 3d408133..9aef2821 100644 --- a/src/components/lab/LabNodeTitle/index.tsx +++ b/src/components/lab/LabNodeTitle/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import Tippy from '@tippyjs/react'; diff --git a/src/components/lab/LabPad/index.tsx b/src/components/lab/LabPad/index.tsx index cf95f0f1..7ca8b89f 100644 --- a/src/components/lab/LabPad/index.tsx +++ b/src/components/lab/LabPad/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { NodeComponentProps } from '~/constants/node'; import { useGotoNode } from '~/hooks/node/useGotoNode'; diff --git a/src/components/lab/LabSquare/index.tsx b/src/components/lab/LabSquare/index.tsx index 2bd2ed0c..9913507f 100644 --- a/src/components/lab/LabSquare/index.tsx +++ b/src/components/lab/LabSquare/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/lab/LabTags/index.tsx b/src/components/lab/LabTags/index.tsx index e8168f0a..d860dd62 100644 --- a/src/components/lab/LabTags/index.tsx +++ b/src/components/lab/LabTags/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Placeholder } from '~/components/placeholders/Placeholder'; import { Tag } from '~/components/tags/Tag'; @@ -27,7 +27,7 @@ const LabTags: FC<IProps> = ({ tags, isLoading }) => { return ( <div className={styles.tags}> - {tags.slice(0, 10).map(tag => ( + {tags.slice(0, 10).map((tag) => ( <Tag tag={tag} key={tag.ID} /> ))} </div> diff --git a/src/components/lab/LabText/index.tsx b/src/components/lab/LabText/index.tsx index 9a42f968..d764e531 100644 --- a/src/components/lab/LabText/index.tsx +++ b/src/components/lab/LabText/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { Markdown } from '~/components/common/Markdown'; import { Paragraph } from '~/components/placeholders/Paragraph'; diff --git a/src/components/lab/LabVideo/index.tsx b/src/components/lab/LabVideo/index.tsx index 53c4f4b9..e7c52ec6 100644 --- a/src/components/lab/LabVideo/index.tsx +++ b/src/components/lab/LabVideo/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { NodeVideoBlock } from '~/components/node/NodeVideoBlock'; import { Placeholder } from '~/components/placeholders/Placeholder'; diff --git a/src/components/main/Footer/index.tsx b/src/components/main/Footer/index.tsx index 505ed9b3..1fa4f3ff 100644 --- a/src/components/main/Footer/index.tsx +++ b/src/components/main/Footer/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo } from 'react'; +import { FC, memo } from 'react'; import styles from './styles.module.scss'; diff --git a/src/components/main/GodRays/index.tsx b/src/components/main/GodRays/index.tsx index 299fc562..dc32ac0f 100644 --- a/src/components/main/GodRays/index.tsx +++ b/src/components/main/GodRays/index.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import { Component } from 'react'; interface IGodRaysProps { raised?: boolean; } -export class GodRays extends React.Component<IGodRaysProps> { +export class GodRays extends Component<IGodRaysProps> { state = { width: 0, height: 0, @@ -42,49 +42,51 @@ export class GodRays extends React.Component<IGodRaysProps> { ctx.clearRect(0, 0, width, height + 100); // clear canvas ctx.save(); - rays.forEach(({ angle, iterator, weight, speed, pulsar, opacity }, index) => { - const gradient = ctx.createLinearGradient(0, 0, 0, height * 1.3); - gradient.addColorStop(0.2, `rgba(160, 255, 60, ${opacity * 0.1})`); - gradient.addColorStop(1, 'rgba(160, 255, 60, 0)'); + rays.forEach( + ({ angle, iterator, weight, speed, pulsar, opacity }, index) => { + const gradient = ctx.createLinearGradient(0, 0, 0, height * 1.3); + gradient.addColorStop(0.2, `rgba(160, 255, 60, ${opacity * 0.1})`); + gradient.addColorStop(1, 'rgba(160, 255, 60, 0)'); - const gradient2 = ctx.createLinearGradient(0, 0, 0, height * 1.3); - gradient2.addColorStop(0.2, `rgba(60, 255, 200, ${opacity * 0.2})`); - gradient2.addColorStop(1, 'rgba(60, 255, 200, 0)'); + const gradient2 = ctx.createLinearGradient(0, 0, 0, height * 1.3); + gradient2.addColorStop(0.2, `rgba(60, 255, 200, ${opacity * 0.2})`); + gradient2.addColorStop(1, 'rgba(60, 255, 200, 0)'); - ctx.save(); - ctx.translate(width / 2, -900); - ctx.rotate(angle); - ctx.translate(-width / 2, 900); + ctx.save(); + ctx.translate(width / 2, -900); + ctx.rotate(angle); + ctx.translate(-width / 2, 900); - ctx.beginPath(); - ctx.fillStyle = gradient; - ctx.moveTo(width / 2 - weight / 2, -900); - ctx.lineTo(width / 2 + weight / 2, -900); - ctx.lineTo(width / 2 + (weight / 2 + 300), height * 1.4); - ctx.lineTo(width / 2 - (weight / 2 + 300), height * 1.4); - ctx.fill(); - ctx.closePath(); + ctx.beginPath(); + ctx.fillStyle = gradient; + ctx.moveTo(width / 2 - weight / 2, -900); + ctx.lineTo(width / 2 + weight / 2, -900); + ctx.lineTo(width / 2 + (weight / 2 + 300), height * 1.4); + ctx.lineTo(width / 2 - (weight / 2 + 300), height * 1.4); + ctx.fill(); + ctx.closePath(); - ctx.beginPath(); - ctx.fillStyle = gradient2; - ctx.moveTo(width / 2 - weight / 6, -900); - ctx.lineTo(width / 2 + weight / 6, -900); - ctx.lineTo(width / 2 + (weight / 6 + 50), height * 1.4); - ctx.lineTo(width / 2 - (weight / 6 + 250), height * 1.4); - ctx.fill(); - ctx.closePath(); + ctx.beginPath(); + ctx.fillStyle = gradient2; + ctx.moveTo(width / 2 - weight / 6, -900); + ctx.lineTo(width / 2 + weight / 6, -900); + ctx.lineTo(width / 2 + (weight / 6 + 50), height * 1.4); + ctx.lineTo(width / 2 - (weight / 6 + 250), height * 1.4); + ctx.fill(); + ctx.closePath(); - rays[index].angle += iterator * speed; - rays[index].opacity += pulsar * 0.01; + rays[index].angle += iterator * speed; + rays[index].opacity += pulsar * 0.01; - if (rays[index].angle > 0.8) rays[index].iterator = -1; - if (rays[index].angle < -0.8) rays[index].iterator = 1; + if (rays[index].angle > 0.8) rays[index].iterator = -1; + if (rays[index].angle < -0.8) rays[index].iterator = 1; - if (rays[index].opacity >= 1) rays[index].pulsar = -1; - if (rays[index].opacity <= 0) rays[index].pulsar = 1; + if (rays[index].opacity >= 1) rays[index].pulsar = -1; + if (rays[index].opacity <= 0) rays[index].pulsar = 1; - ctx.restore(); - }); + ctx.restore(); + }, + ); setTimeout(() => window.requestAnimationFrame(this.draw), 1000 / 15); }; @@ -119,7 +121,7 @@ export class GodRays extends React.Component<IGodRaysProps> { position: 'relative', top: -100, }} - ref={el => { + ref={(el) => { this.canvas = el; }} /> diff --git a/src/components/main/Logo/index.tsx b/src/components/main/Logo/index.tsx index 7d5e5360..ccd1afd8 100644 --- a/src/components/main/Logo/index.tsx +++ b/src/components/main/Logo/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Anchor } from '~/components/common/Anchor'; import { URLS } from '~/constants/urls'; diff --git a/src/components/main/MainPreloader/index.tsx b/src/components/main/MainPreloader/index.tsx index 543e54e2..5ccf9084 100644 --- a/src/components/main/MainPreloader/index.tsx +++ b/src/components/main/MainPreloader/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; interface MainPreloaderProps {} diff --git a/src/components/media/AudioPlayer/index.tsx b/src/components/media/AudioPlayer/index.tsx index 1e2d3700..1c331a7f 100644 --- a/src/components/media/AudioPlayer/index.tsx +++ b/src/components/media/AudioPlayer/index.tsx @@ -1,4 +1,4 @@ -import React, { memo, useCallback, useMemo } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/components/media/ImagePreloader/index.tsx b/src/components/media/ImagePreloader/index.tsx index 36c7185c..212bba54 100644 --- a/src/components/media/ImagePreloader/index.tsx +++ b/src/components/media/ImagePreloader/index.tsx @@ -1,10 +1,4 @@ -import React, { - FC, - MouseEventHandler, - useCallback, - useMemo, - useState, -} from 'react'; +import { FC, MouseEventHandler, useCallback, useMemo, useState } from 'react'; import classNames from 'classnames'; diff --git a/src/components/menu/CornerMenu/index.tsx b/src/components/menu/CornerMenu/index.tsx index 4929bc37..4707d0f7 100644 --- a/src/components/menu/CornerMenu/index.tsx +++ b/src/components/menu/CornerMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState, VFC } from 'react'; +import { useCallback, useState, VFC } from 'react'; import { MenuDots } from '~/components/menu/MenuDots'; diff --git a/src/components/menu/HorizontalMenu/index.tsx b/src/components/menu/HorizontalMenu/index.tsx index 07202e96..978d0cbb 100644 --- a/src/components/menu/HorizontalMenu/index.tsx +++ b/src/components/menu/HorizontalMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren } from 'react'; +import { PropsWithChildren } from 'react'; import classNames from 'classnames'; diff --git a/src/components/menu/MenuButton/index.tsx b/src/components/menu/MenuButton/index.tsx index bd9fa555..67ca25a9 100644 --- a/src/components/menu/MenuButton/index.tsx +++ b/src/components/menu/MenuButton/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode, useEffect, useState } from 'react'; +import { FC, ReactNode, useEffect, useState } from 'react'; import { Placement } from '@popperjs/core'; import classNames from 'classnames'; diff --git a/src/components/menu/MenuDots/index.tsx b/src/components/menu/MenuDots/index.tsx index da4a9adc..51d9f3c6 100644 --- a/src/components/menu/MenuDots/index.tsx +++ b/src/components/menu/MenuDots/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/menu/MenuItemWithIcon/index.tsx b/src/components/menu/MenuItemWithIcon/index.tsx index 20045580..f8861c0c 100644 --- a/src/components/menu/MenuItemWithIcon/index.tsx +++ b/src/components/menu/MenuItemWithIcon/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Icon } from '~/components/common/Icon'; diff --git a/src/components/menu/SeparatedMenu/index.tsx b/src/components/menu/SeparatedMenu/index.tsx index c030220b..201a58b8 100644 --- a/src/components/menu/SeparatedMenu/index.tsx +++ b/src/components/menu/SeparatedMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode, useMemo } from 'react'; +import { FC, ReactNode, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/components/node/Backlink/index.tsx b/src/components/node/Backlink/index.tsx index e4d5c072..c109966a 100644 --- a/src/components/node/Backlink/index.tsx +++ b/src/components/node/Backlink/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Icon } from '~/components/common/Icon'; import { WithDescription } from '~/components/common/WithDescription'; diff --git a/src/components/node/CommendDeleted/index.tsx b/src/components/node/CommendDeleted/index.tsx index c096c4de..1099e23b 100644 --- a/src/components/node/CommendDeleted/index.tsx +++ b/src/components/node/CommendDeleted/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Button } from '~/components/input/Button'; import { IComment } from '~/types'; diff --git a/src/components/node/NodeAudioBlock/index.tsx b/src/components/node/NodeAudioBlock/index.tsx index 64c5645f..853eb34c 100644 --- a/src/components/node/NodeAudioBlock/index.tsx +++ b/src/components/node/NodeAudioBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { AudioPlayer } from '~/components/media/AudioPlayer'; import { NodeComponentProps } from '~/constants/node'; diff --git a/src/components/node/NodeAudioImageBlock/index.tsx b/src/components/node/NodeAudioImageBlock/index.tsx index a87ea38a..83e557ad 100644 --- a/src/components/node/NodeAudioImageBlock/index.tsx +++ b/src/components/node/NodeAudioImageBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { NodeComponentProps } from '~/constants/node'; import { imagePresets } from '~/constants/urls'; diff --git a/src/components/node/NodeAuthorBlock/index.tsx b/src/components/node/NodeAuthorBlock/index.tsx index b467bc20..04813e56 100644 --- a/src/components/node/NodeAuthorBlock/index.tsx +++ b/src/components/node/NodeAuthorBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Avatar } from '~/components/common/Avatar'; import { Card } from '~/components/common/Card'; diff --git a/src/components/node/NodeDeletedBadge/index.tsx b/src/components/node/NodeDeletedBadge/index.tsx index 72d84532..32a24ce0 100644 --- a/src/components/node/NodeDeletedBadge/index.tsx +++ b/src/components/node/NodeDeletedBadge/index.tsx @@ -1,11 +1,15 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import styles from './styles.module.scss'; interface IProps {} const NodeDeletedBadge: FC<IProps> = () => { - return <div className={styles.badge}>Эта ячейка заблокирована. Её не никто не увидит.</div>; + return ( + <div className={styles.badge}> + Эта ячейка заблокирована. Её не никто не увидит. + </div> + ); }; export { NodeDeletedBadge }; diff --git a/src/components/node/NodeEditMenu/index.tsx b/src/components/node/NodeEditMenu/index.tsx index 388f3025..5457b260 100644 --- a/src/components/node/NodeEditMenu/index.tsx +++ b/src/components/node/NodeEditMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import Tippy from '@tippyjs/react'; diff --git a/src/components/node/NodeHeadMetadata/index.tsx b/src/components/node/NodeHeadMetadata/index.tsx index 706b2ec1..93868871 100644 --- a/src/components/node/NodeHeadMetadata/index.tsx +++ b/src/components/node/NodeHeadMetadata/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import Head from 'next/head'; @@ -20,7 +20,10 @@ const NodeHeadMetadata: VFC<NodeHeadMetadataProps> = () => { <meta property="og:title" content={node.title} /> <meta property="og:type" content={node.type} /> <meta property="og:image" content={getURLFromString(node.thumbnail)} /> - <meta property="og:image:secure_url" content={getURLFromString(node.thumbnail)} /> + <meta + property="og:image:secure_url" + content={getURLFromString(node.thumbnail)} + /> <meta property="og:image:type" content="image/jpeg" /> <meta property="og:image:alt" content={node.description} /> <meta property="og:description" content={node.description} /> diff --git a/src/components/node/NodeImageBlockPlaceholder/index.tsx b/src/components/node/NodeImageBlockPlaceholder/index.tsx index eebdc1d2..00cc4b8c 100644 --- a/src/components/node/NodeImageBlockPlaceholder/index.tsx +++ b/src/components/node/NodeImageBlockPlaceholder/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { LoaderCircle } from '~/components/common/LoaderCircle'; diff --git a/src/components/node/NodeLikeButton/index.tsx b/src/components/node/NodeLikeButton/index.tsx index c43354f6..5bddc2e3 100644 --- a/src/components/node/NodeLikeButton/index.tsx +++ b/src/components/node/NodeLikeButton/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/node/NodeNoComments/index.tsx b/src/components/node/NodeNoComments/index.tsx index e983ce38..abb0f047 100644 --- a/src/components/node/NodeNoComments/index.tsx +++ b/src/components/node/NodeNoComments/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/components/node/NodeRelated/index.tsx b/src/components/node/NodeRelated/index.tsx index c4dd6dfa..422a9228 100644 --- a/src/components/node/NodeRelated/index.tsx +++ b/src/components/node/NodeRelated/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactElement } from 'react'; +import { FC, ReactElement } from 'react'; import { Group } from '~/components/common/Group'; import { Hoverable } from '~/components/common/Hoverable'; diff --git a/src/components/node/NodeRelated/placeholder.tsx b/src/components/node/NodeRelated/placeholder.tsx index 5cff3b2a..c6f6000b 100644 --- a/src/components/node/NodeRelated/placeholder.tsx +++ b/src/components/node/NodeRelated/placeholder.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo } from 'react'; +import { FC, memo } from 'react'; import classNames from 'classnames'; diff --git a/src/components/node/NodeRelatedBlock/index.tsx b/src/components/node/NodeRelatedBlock/index.tsx index 7b69e32a..136e1a86 100644 --- a/src/components/node/NodeRelatedBlock/index.tsx +++ b/src/components/node/NodeRelatedBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Pressable } from '~/components/common/Pressable'; import { NodeRelated } from '~/components/node/NodeRelated'; diff --git a/src/components/node/NodeTags/index.tsx b/src/components/node/NodeTags/index.tsx index e9dc6189..4eac5c27 100644 --- a/src/components/node/NodeTags/index.tsx +++ b/src/components/node/NodeTags/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo } from 'react'; +import { FC, memo } from 'react'; import { Tags } from '~/containers/tags/Tags'; import { ITag } from '~/types'; @@ -24,7 +24,7 @@ const NodeTags: FC<IProps> = memo( deletable={is_deletable} /> ); - } + }, ); export { NodeTags }; diff --git a/src/components/node/NodeTagsBlock/index.tsx b/src/components/node/NodeTagsBlock/index.tsx index bf504653..77e303c5 100644 --- a/src/components/node/NodeTagsBlock/index.tsx +++ b/src/components/node/NodeTagsBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { NodeTags } from '~/components/node/NodeTags'; import { useTagContext } from '~/utils/context/TagsContextProvider'; diff --git a/src/components/node/NodeTagsPlaceholder/index.tsx b/src/components/node/NodeTagsPlaceholder/index.tsx index 428a447b..2524e4b2 100644 --- a/src/components/node/NodeTagsPlaceholder/index.tsx +++ b/src/components/node/NodeTagsPlaceholder/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo } from 'react'; +import { FC, memo } from 'react'; import { Tags } from '~/containers/tags/Tags'; import { ITag } from '~/types'; @@ -9,8 +9,10 @@ interface IProps { onChange?: (tags: string[]) => void; } -const NodeTagsPlaceholder: FC<IProps> = memo(({ is_editable, tags, onChange }) => ( - <Tags tags={tags} editable={is_editable} onTagsChange={onChange} /> -)); +const NodeTagsPlaceholder: FC<IProps> = memo( + ({ is_editable, tags, onChange }) => ( + <Tags tags={tags} editable={is_editable} onTagsChange={onChange} /> + ), +); export { NodeTagsPlaceholder }; diff --git a/src/components/node/NodeTextBlock/index.tsx b/src/components/node/NodeTextBlock/index.tsx index 6b82a5b5..cf892702 100644 --- a/src/components/node/NodeTextBlock/index.tsx +++ b/src/components/node/NodeTextBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/components/node/NodeVideoBlock/index.tsx b/src/components/node/NodeVideoBlock/index.tsx index 93c10116..c876b301 100644 --- a/src/components/node/NodeVideoBlock/index.tsx +++ b/src/components/node/NodeVideoBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { NodeComponentProps } from '~/constants/node'; import { path } from '~/utils/ramda'; diff --git a/src/components/notes/NoteCard/index.tsx b/src/components/notes/NoteCard/index.tsx index 898362ee..eefc6898 100644 --- a/src/components/notes/NoteCard/index.tsx +++ b/src/components/notes/NoteCard/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState, VFC } from 'react'; +import { useCallback, useState, VFC } from 'react'; import { Card } from '~/components/common/Card'; import { Markdown } from '~/components/common/Markdown'; diff --git a/src/components/notes/NoteMenu/index.tsx b/src/components/notes/NoteMenu/index.tsx index 2521eb07..83d718ee 100644 --- a/src/components/notes/NoteMenu/index.tsx +++ b/src/components/notes/NoteMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { useMemo, VFC } from 'react'; +import { useMemo, VFC } from 'react'; import { CornerMenu } from '~/components/menu/CornerMenu'; diff --git a/src/components/notifications/NotificationBadge/index.tsx b/src/components/notifications/NotificationBadge/index.tsx index 59a209d0..1508151a 100644 --- a/src/components/notifications/NotificationBadge/index.tsx +++ b/src/components/notifications/NotificationBadge/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Anchor } from '~/components/common/Anchor'; import { InlineUsername } from '~/components/common/InlineUsername'; diff --git a/src/components/notifications/NotificationSettingsForm/index.tsx b/src/components/notifications/NotificationSettingsForm/index.tsx index 25597c78..5d48ab07 100644 --- a/src/components/notifications/NotificationSettingsForm/index.tsx +++ b/src/components/notifications/NotificationSettingsForm/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Card } from '~/components/common/Card'; import { Group } from '~/components/common/Group'; diff --git a/src/components/placeholders/Paragraph/index.tsx b/src/components/placeholders/Paragraph/index.tsx index aa6bf6ca..5c40b56e 100644 --- a/src/components/placeholders/Paragraph/index.tsx +++ b/src/components/placeholders/Paragraph/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { Group } from '~/components/common/Group'; import { diff --git a/src/components/placeholders/Placeholder/index.tsx b/src/components/placeholders/Placeholder/index.tsx index 4daa51df..ba155188 100644 --- a/src/components/placeholders/Placeholder/index.tsx +++ b/src/components/placeholders/Placeholder/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; @@ -24,7 +24,11 @@ const Placeholder: FC<PlaceholderProps> = ({ }) => { return active ? ( <div - className={classNames(styles.placeholder, { [styles.loading]: loading }, className)} + className={classNames( + styles.placeholder, + { [styles.loading]: loading }, + className, + )} style={{ height, color, width }} /> ) : ( diff --git a/src/components/profile/ProfileAccountsError/index.tsx b/src/components/profile/ProfileAccountsError/index.tsx index 0c803264..c377c77c 100644 --- a/src/components/profile/ProfileAccountsError/index.tsx +++ b/src/components/profile/ProfileAccountsError/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { Button } from '~/components/input/Button'; diff --git a/src/components/profile/ProfileAvatar/index.tsx b/src/components/profile/ProfileAvatar/index.tsx index 2666966e..479ed3f1 100644 --- a/src/components/profile/ProfileAvatar/index.tsx +++ b/src/components/profile/ProfileAvatar/index.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, FC, useCallback } from 'react'; +import { ChangeEvent, FC, useCallback } from 'react'; import { Avatar } from '~/components/common/Avatar'; import { Button } from '~/components/input/Button'; diff --git a/src/components/profile/ProfileDescription/index.tsx b/src/components/profile/ProfileDescription/index.tsx index b7725d08..bd37df20 100644 --- a/src/components/profile/ProfileDescription/index.tsx +++ b/src/components/profile/ProfileDescription/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/sidebar/SidebarStack/index.tsx b/src/components/sidebar/SidebarStack/index.tsx index 07fdd7fe..d15015aa 100644 --- a/src/components/sidebar/SidebarStack/index.tsx +++ b/src/components/sidebar/SidebarStack/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { createContext, FC, PropsWithChildren, diff --git a/src/components/sidebar/SidebarStackCard/index.tsx b/src/components/sidebar/SidebarStackCard/index.tsx index 47dfd228..00402352 100644 --- a/src/components/sidebar/SidebarStackCard/index.tsx +++ b/src/components/sidebar/SidebarStackCard/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode, useMemo } from 'react'; +import { FC, ReactNode, useMemo } from 'react'; import { Filler } from '~/components/common/Filler'; import { Button } from '~/components/input/Button'; diff --git a/src/components/sidebar/SidebarWrapper/index.tsx b/src/components/sidebar/SidebarWrapper/index.tsx index 76991a21..ccb9fbfc 100644 --- a/src/components/sidebar/SidebarWrapper/index.tsx +++ b/src/components/sidebar/SidebarWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode, useEffect, useRef } from 'react'; +import { FC, ReactNode, useEffect, useRef } from 'react'; import { clearAllBodyScrollLocks, disableBodyScroll } from 'body-scroll-lock'; diff --git a/src/components/sidebar/TagSidebarList/index.tsx b/src/components/sidebar/TagSidebarList/index.tsx index c8025e5c..15ff54e4 100644 --- a/src/components/sidebar/TagSidebarList/index.tsx +++ b/src/components/sidebar/TagSidebarList/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { FlowRecentItem } from '~/components/flow/FlowRecentItem'; import { INode } from '~/types'; diff --git a/src/components/sortable/DragOverlayItem/index.tsx b/src/components/sortable/DragOverlayItem/index.tsx index ef265846..7da0582e 100644 --- a/src/components/sortable/DragOverlayItem/index.tsx +++ b/src/components/sortable/DragOverlayItem/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/components/sortable/SortableAudioGrid/index.tsx b/src/components/sortable/SortableAudioGrid/index.tsx index 6df9ac9b..ebf5ac87 100644 --- a/src/components/sortable/SortableAudioGrid/index.tsx +++ b/src/components/sortable/SortableAudioGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { AudioPlayer } from '~/components/media/AudioPlayer'; import { AudioUpload } from '~/components/upload/AudioUpload'; @@ -28,7 +28,13 @@ const renderItem = ({ onDelete?: (id: IFile['id']) => void; onTitleChange?: (file_id: IFile['id'], title: string) => void; }) => ( - <AudioPlayer file={item} onDelete={onDelete} isEditing onTitleChange={onTitleChange} key={key} /> + <AudioPlayer + file={item} + onDelete={onDelete} + isEditing + onTitleChange={onTitleChange} + key={key} + /> ); const renderLocked = ({ locked }: { locked: UploadStatus }) => ( @@ -49,15 +55,18 @@ const SortableAudioGrid: FC<SortableAudioGridProps> = ({ onSortEnd, onTitleChange, }) => { - const renderItemProps = useMemo(() => ({ onDelete, onTitleChange }), [onDelete, onTitleChange]); + const renderItemProps = useMemo( + () => ({ onDelete, onTitleChange }), + [onDelete, onTitleChange], + ); const renderLockedProps = useMemo(() => ({}), []); return ( <SortableList items={items} locked={locked} - getID={it => it.id} - getLockedID={it => it.id} + getID={(it) => it.id} + getLockedID={(it) => it.id} renderItem={renderItem} renderItemProps={renderItemProps} renderLocked={renderLocked} diff --git a/src/components/sortable/SortableGrid/index.tsx b/src/components/sortable/SortableGrid/index.tsx index 68b4c4ae..f8bd73b1 100644 --- a/src/components/sortable/SortableGrid/index.tsx +++ b/src/components/sortable/SortableGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { createElement, FC, useMemo } from 'react'; +import { createElement, FC, useMemo } from 'react'; import { closestCenter, DndContext, DragOverlay } from '@dnd-kit/core'; import { rectSortingStrategy, SortableContext } from '@dnd-kit/sortable'; diff --git a/src/components/sortable/SortableImageGrid/index.tsx b/src/components/sortable/SortableImageGrid/index.tsx index 086fd268..7d32e996 100644 --- a/src/components/sortable/SortableImageGrid/index.tsx +++ b/src/components/sortable/SortableImageGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/components/sortable/SortableItem/index.tsx b/src/components/sortable/SortableItem/index.tsx index 9d4ebf8a..5c7d67ef 100644 --- a/src/components/sortable/SortableItem/index.tsx +++ b/src/components/sortable/SortableItem/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; @@ -18,10 +18,11 @@ const SortableItem: FC<SortableImageGridItemProps> = ({ disabled = false, className, }) => { - const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ - id, - disabled, - }); + const { attributes, listeners, setNodeRef, transform, transition } = + useSortable({ + id, + disabled, + }); const style = { transform: CSS.Transform.toString(transform), diff --git a/src/components/sortable/SortableList/index.tsx b/src/components/sortable/SortableList/index.tsx index 0f815719..3e6bce82 100644 --- a/src/components/sortable/SortableList/index.tsx +++ b/src/components/sortable/SortableList/index.tsx @@ -1,4 +1,4 @@ -import React, { createElement, FC } from 'react'; +import { createElement, FC } from 'react'; import { closestCenter, DndContext, DragOverlay } from '@dnd-kit/core'; import { diff --git a/src/components/tags/Tag/index.tsx b/src/components/tags/Tag/index.tsx index fe3eea23..aa63bdf2 100644 --- a/src/components/tags/Tag/index.tsx +++ b/src/components/tags/Tag/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, FocusEventHandler, useCallback } from 'react'; +import { FC, FocusEventHandler, useCallback } from 'react'; import { TagWrapper } from '~/components/tags/TagWrapper'; import { ITag } from '~/types'; diff --git a/src/components/tags/TagAutocomplete/index.tsx b/src/components/tags/TagAutocomplete/index.tsx index 02570c6c..a18758eb 100644 --- a/src/components/tags/TagAutocomplete/index.tsx +++ b/src/components/tags/TagAutocomplete/index.tsx @@ -1,11 +1,4 @@ -import React, { - useCallback, - useEffect, - useMemo, - useRef, - useState, - VFC, -} from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState, VFC } from 'react'; import classNames from 'classnames'; import { usePopper } from 'react-popper'; diff --git a/src/components/tags/TagAutocompleteRow/index.tsx b/src/components/tags/TagAutocompleteRow/index.tsx index 40d6237b..a032db95 100644 --- a/src/components/tags/TagAutocompleteRow/index.tsx +++ b/src/components/tags/TagAutocompleteRow/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classNames from 'classnames'; diff --git a/src/components/tags/TagWrapper/index.tsx b/src/components/tags/TagWrapper/index.tsx index 00e6fdf1..0d95d755 100644 --- a/src/components/tags/TagWrapper/index.tsx +++ b/src/components/tags/TagWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classNames from 'classnames'; diff --git a/src/components/upload/AudioUpload/index.tsx b/src/components/upload/AudioUpload/index.tsx index 6b11f1b6..3e62971b 100644 --- a/src/components/upload/AudioUpload/index.tsx +++ b/src/components/upload/AudioUpload/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classNames from 'classnames'; diff --git a/src/components/upload/ImageUpload/index.tsx b/src/components/upload/ImageUpload/index.tsx index b12e5a04..ed951042 100644 --- a/src/components/upload/ImageUpload/index.tsx +++ b/src/components/upload/ImageUpload/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classNames from 'classnames'; diff --git a/src/components/upload/UploadDropzone/index.tsx b/src/components/upload/UploadDropzone/index.tsx index 887b0e68..3bc9a71c 100644 --- a/src/components/upload/UploadDropzone/index.tsx +++ b/src/components/upload/UploadDropzone/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import classnames from 'classnames'; import classNames from 'classnames'; diff --git a/src/containers/auth/LoginDialog/components/LoginDialogButtons/index.tsx b/src/containers/auth/LoginDialog/components/LoginDialogButtons/index.tsx index 3b376b1a..55f4fef9 100644 --- a/src/containers/auth/LoginDialog/components/LoginDialogButtons/index.tsx +++ b/src/containers/auth/LoginDialog/components/LoginDialogButtons/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Grid } from '~/components/common/Grid'; import { Group } from '~/components/common/Group'; diff --git a/src/containers/auth/LoginDialog/components/LoginSocialRegisterButtons/index.tsx b/src/containers/auth/LoginDialog/components/LoginSocialRegisterButtons/index.tsx index 5454d479..92a9e06d 100644 --- a/src/containers/auth/LoginDialog/components/LoginSocialRegisterButtons/index.tsx +++ b/src/containers/auth/LoginDialog/components/LoginSocialRegisterButtons/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Button } from '~/components/input/Button'; diff --git a/src/containers/auth/LoginDialog/components/LoginStaticScene/index.tsx b/src/containers/auth/LoginDialog/components/LoginStaticScene/index.tsx index 205e02a8..70729afc 100644 --- a/src/containers/auth/LoginDialog/components/LoginStaticScene/index.tsx +++ b/src/containers/auth/LoginDialog/components/LoginStaticScene/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/auth/LoginDialog/components/TelegramLoginForm/index.tsx b/src/containers/auth/LoginDialog/components/TelegramLoginForm/index.tsx index 9284da9e..3e5b5ba1 100644 --- a/src/containers/auth/LoginDialog/components/TelegramLoginForm/index.tsx +++ b/src/containers/auth/LoginDialog/components/TelegramLoginForm/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import TelegramLoginButton, { TelegramUser, diff --git a/src/containers/auth/LoginSocialRegisterDialog/index.tsx b/src/containers/auth/LoginSocialRegisterDialog/index.tsx index 2dc469c8..23a6c0fe 100644 --- a/src/containers/auth/LoginSocialRegisterDialog/index.tsx +++ b/src/containers/auth/LoginSocialRegisterDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useState } from 'react'; +import { FC, useCallback, useState } from 'react'; import { apiLoginWithSocial } from '~/api/auth'; import { BetterScrollDialog } from '~/components/common/BetterScrollDialog'; diff --git a/src/containers/auth/RestorePasswordDialog/components/RestoreInvalidCode/index.tsx b/src/containers/auth/RestorePasswordDialog/components/RestoreInvalidCode/index.tsx index e39c0ad7..cdb37999 100644 --- a/src/containers/auth/RestorePasswordDialog/components/RestoreInvalidCode/index.tsx +++ b/src/containers/auth/RestorePasswordDialog/components/RestoreInvalidCode/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Group } from '~/components/common/Group'; import { Icon } from '~/components/common/Icon'; diff --git a/src/containers/auth/RestorePasswordDialog/components/RestoreSuccess/index.tsx b/src/containers/auth/RestorePasswordDialog/components/RestoreSuccess/index.tsx index 67a95c86..07128f64 100644 --- a/src/containers/auth/RestorePasswordDialog/components/RestoreSuccess/index.tsx +++ b/src/containers/auth/RestorePasswordDialog/components/RestoreSuccess/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Group } from '~/components/common/Group'; import { Icon } from '~/components/common/Icon'; diff --git a/src/containers/auth/RestorePasswordDialog/index.tsx b/src/containers/auth/RestorePasswordDialog/index.tsx index 4b7f6a03..2d8f36cf 100644 --- a/src/containers/auth/RestorePasswordDialog/index.tsx +++ b/src/containers/auth/RestorePasswordDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useMemo, useState } from 'react'; +import { FC, useCallback, useMemo, useState } from 'react'; import { apiRestoreCode } from '~/api/auth'; import { Group } from '~/components/common/Group'; diff --git a/src/containers/auth/RestoreRequestDialog/components/RestoreSent/index.tsx b/src/containers/auth/RestoreRequestDialog/components/RestoreSent/index.tsx index 19c0076b..cc0ea7de 100644 --- a/src/containers/auth/RestoreRequestDialog/components/RestoreSent/index.tsx +++ b/src/containers/auth/RestoreRequestDialog/components/RestoreSent/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Group } from '~/components/common/Group'; import { Icon } from '~/components/common/Icon'; diff --git a/src/containers/auth/RestoreRequestDialog/index.tsx b/src/containers/auth/RestoreRequestDialog/index.tsx index f18425df..4f08a0ea 100644 --- a/src/containers/auth/RestoreRequestDialog/index.tsx +++ b/src/containers/auth/RestoreRequestDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useMemo, useState, VFC } from 'react'; +import { useCallback, useMemo, useState, VFC } from 'react'; import { apiRequestRestoreCode } from '~/api/auth'; import { Group } from '~/components/common/Group'; diff --git a/src/containers/auth/SuperPowersToggle/components/BorisSuperpowers/index.tsx b/src/containers/auth/SuperPowersToggle/components/BorisSuperpowers/index.tsx index 531d1d28..72a79cea 100644 --- a/src/containers/auth/SuperPowersToggle/components/BorisSuperpowers/index.tsx +++ b/src/containers/auth/SuperPowersToggle/components/BorisSuperpowers/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Toggle } from '~/components/input/Toggle'; diff --git a/src/containers/auth/TelegramAttachDialog/index.tsx b/src/containers/auth/TelegramAttachDialog/index.tsx index 2e784ef1..b4ad6ed6 100644 --- a/src/containers/auth/TelegramAttachDialog/index.tsx +++ b/src/containers/auth/TelegramAttachDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useMemo } from 'react'; +import { FC, useCallback, useMemo } from 'react'; import { TelegramUser } from '@v9v/ts-react-telegram-login'; diff --git a/src/containers/boris/BorisSidebar/components/BorisContacts/index.tsx b/src/containers/boris/BorisSidebar/components/BorisContacts/index.tsx index d38d6280..298b358a 100644 --- a/src/containers/boris/BorisSidebar/components/BorisContacts/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisContacts/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Padder } from '~/components/common/Padder'; import { Button } from '~/components/input/Button'; diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/BasicCurveChart/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/BasicCurveChart/index.tsx index d81cd4ec..f2b76ff9 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/BasicCurveChart/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/BasicCurveChart/index.tsx @@ -1,4 +1,4 @@ -import React, { useMemo, VFC } from 'react'; +import { useMemo, VFC } from 'react'; import { makeBezierCurve, PathPoint } from '~/utils/dom/makeBezierCurve'; import { SVGProps } from '~/utils/types'; diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisGraphicStats/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisGraphicStats/index.tsx index a87fe6ca..307698c8 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisGraphicStats/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisGraphicStats/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { StatsGraphCard } from '../StatsGraphCard'; diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGit/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGit/index.tsx index 58a3291f..f0a35812 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGit/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGit/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { Placeholder } from '~/components/placeholders/Placeholder'; import { GithubIssue } from '~/types/boris'; @@ -14,13 +14,19 @@ interface IProps { const BorisStatsGit: FC<IProps> = ({ issues, isLoading }) => { const open = useMemo( - () => issues.filter(el => !el.pull_request && el.state === 'open').slice(0, 5), - [issues] + () => + issues + .filter((el) => !el.pull_request && el.state === 'open') + .slice(0, 5), + [issues], ); const closed = useMemo( - () => issues.filter(el => !el.pull_request && el.state === 'closed').slice(0, 5), - [issues] + () => + issues + .filter((el) => !el.pull_request && el.state === 'closed') + .slice(0, 5), + [issues], ); if (!issues.length) return null; @@ -46,14 +52,17 @@ const BorisStatsGit: FC<IProps> = ({ issues, isLoading }) => { <div className={styles.wrap}> <div className={styles.stats__title}> <span>КОММИТС</span> - <img src="https://jenkins.vault48.org/api/badges/muerwre/vault-golang/status.svg" alt="" /> + <img + src="https://jenkins.vault48.org/api/badges/muerwre/vault-golang/status.svg" + alt="" + /> </div> - {open.map(data => ( + {open.map((data) => ( <BorisStatsGitCard data={data} key={data.id} /> ))} - {closed.map(data => ( + {closed.map((data) => ( <BorisStatsGitCard data={data} key={data.id} /> ))} </div> diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGitCard/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGitCard/index.tsx index 7b6530d4..859adc21 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGitCard/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/BorisStatsGitCard/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; @@ -7,7 +7,6 @@ import { getPrettyDate } from '~/utils/dom'; import styles from './styles.module.scss'; - interface IProps { data: GithubIssue; } @@ -17,7 +16,9 @@ const stateLabels: Record<GithubIssue['state'], string> = { closed: 'Сделано', }; -const BorisStatsGitCard: FC<IProps> = ({ data: { created_at, title, html_url, state } }) => { +const BorisStatsGitCard: FC<IProps> = ({ + data: { created_at, title, html_url, state }, +}) => { const date = useMemo(() => getPrettyDate(created_at), [created_at]); if (!title || !created_at) return null; @@ -25,11 +26,18 @@ const BorisStatsGitCard: FC<IProps> = ({ data: { created_at, title, html_url, st return ( <div className={styles.wrap}> <div className={styles.time}> - <span className={classNames(styles.icon, styles[state])}>{stateLabels[state]}</span> + <span className={classNames(styles.icon, styles[state])}> + {stateLabels[state]} + </span> {date} </div> - <a className={styles.subject} href={html_url} target="_blank" rel="noreferrer"> + <a + className={styles.subject} + href={html_url} + target="_blank" + rel="noreferrer" + > {title} </a> </div> diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCard/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCard/index.tsx index 26c27d30..1cbf6f41 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCard/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCard/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode } from 'react'; +import { FC, ReactNode } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCountdownCard/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCountdownCard/index.tsx index 9f2b736e..23755b0d 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCountdownCard/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsCountdownCard/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import classNames from 'classnames'; import { addYears, differenceInMonths, differenceInYears } from 'date-fns'; diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsGraphCard/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsGraphCard/index.tsx index dda29b34..f22c7daf 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsGraphCard/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/components/StatsGraphCard/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { CardProps } from '~/components/common/Card'; import { Filler } from '~/components/common/Filler'; diff --git a/src/containers/boris/BorisSidebar/components/BorisStats/index.tsx b/src/containers/boris/BorisSidebar/components/BorisStats/index.tsx index 3284aed0..87ca992b 100644 --- a/src/containers/boris/BorisSidebar/components/BorisStats/index.tsx +++ b/src/containers/boris/BorisSidebar/components/BorisStats/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { BorisUsageStats } from '~/types/boris'; diff --git a/src/containers/comments/CommentForm/components/CommentFormAttachButtons/index.tsx b/src/containers/comments/CommentForm/components/CommentFormAttachButtons/index.tsx index adc275c8..1fb49e54 100644 --- a/src/containers/comments/CommentForm/components/CommentFormAttachButtons/index.tsx +++ b/src/containers/comments/CommentForm/components/CommentFormAttachButtons/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Button } from '~/components/input/Button'; import { ButtonGroup } from '~/components/input/ButtonGroup'; diff --git a/src/containers/comments/CommentForm/components/CommentFormAttaches/index.tsx b/src/containers/comments/CommentForm/components/CommentFormAttaches/index.tsx index 3589ae2d..3f4f1ef9 100644 --- a/src/containers/comments/CommentForm/components/CommentFormAttaches/index.tsx +++ b/src/containers/comments/CommentForm/components/CommentFormAttaches/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { SortableAudioGrid } from '~/components/sortable/SortableAudioGrid'; import { SortableImageGrid } from '~/components/sortable/SortableImageGrid'; diff --git a/src/containers/comments/CommentForm/components/CommentFormFormatButtons/index.tsx b/src/containers/comments/CommentForm/components/CommentFormFormatButtons/index.tsx index e90ba9ab..f9368235 100644 --- a/src/containers/comments/CommentForm/components/CommentFormFormatButtons/index.tsx +++ b/src/containers/comments/CommentForm/components/CommentFormFormatButtons/index.tsx @@ -1,8 +1,11 @@ -import React, { FC, useCallback, useEffect } from 'react'; +import { FC, useCallback, useEffect } from 'react'; import { Button } from '~/components/input/Button'; import { ButtonGroup } from '~/components/input/ButtonGroup'; -import { useFormatWrapper, wrapTextInsideInput } from '~/hooks/dom/useFormatWrapper'; +import { + useFormatWrapper, + wrapTextInsideInput, +} from '~/hooks/dom/useFormatWrapper'; import styles from './styles.module.scss'; @@ -14,25 +17,25 @@ interface IProps { const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => { const wrapper = useFormatWrapper(handler); - const wrap = useCallback((prefix = '', suffix = '') => wrapper(element, prefix, suffix), [ - element, - wrapper, - ]); + const wrap = useCallback( + (prefix = '', suffix = '') => wrapper(element, prefix, suffix), + [element, wrapper], + ); const wrapBold = useCallback( - event => { + (event) => { event.preventDefault(); wrapTextInsideInput(element, '**', '**', handler); }, - [element, handler] + [element, handler], ); const wrapItalic = useCallback( - event => { + (event) => { event.preventDefault(); wrapTextInsideInput(element, '*', '*', handler); }, - [element, handler] + [element, handler], ); const onKeyPress = useCallback( @@ -47,7 +50,7 @@ const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => { wrapItalic(event); } }, - [wrapBold, wrapItalic] + [wrapBold, wrapItalic], ); useEffect(() => { diff --git a/src/containers/comments/CommentForm/components/CommentFormTextarea/index.tsx b/src/containers/comments/CommentForm/components/CommentFormTextarea/index.tsx index 31230b8c..088e3140 100644 --- a/src/containers/comments/CommentForm/components/CommentFormTextarea/index.tsx +++ b/src/containers/comments/CommentForm/components/CommentFormTextarea/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { forwardRef, KeyboardEventHandler, TextareaHTMLAttributes, diff --git a/src/containers/comments/CommentWrapper/components/CommentAvatar/index.tsx b/src/containers/comments/CommentWrapper/components/CommentAvatar/index.tsx index 909d59ca..21a2dea3 100644 --- a/src/containers/comments/CommentWrapper/components/CommentAvatar/index.tsx +++ b/src/containers/comments/CommentWrapper/components/CommentAvatar/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Avatar } from '~/components/common/Avatar'; import { MenuButton } from '~/components/menu/MenuButton'; diff --git a/src/containers/comments/CommentWrapper/index.tsx b/src/containers/comments/CommentWrapper/index.tsx index a0ba8544..c2839400 100644 --- a/src/containers/comments/CommentWrapper/index.tsx +++ b/src/containers/comments/CommentWrapper/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/dialogs/EditorCreateDialog/index.tsx b/src/containers/dialogs/EditorCreateDialog/index.tsx index 27f7e14d..50b16dd4 100644 --- a/src/containers/dialogs/EditorCreateDialog/index.tsx +++ b/src/containers/dialogs/EditorCreateDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useMemo, useRef } from 'react'; +import { FC, useCallback, useMemo, useRef } from 'react'; import { EMPTY_NODE, NODE_TYPES } from '~/constants/node'; import { EditorDialog } from '~/containers/dialogs/EditorDialog'; @@ -12,8 +12,15 @@ export interface EditorCreateDialogProps extends DialogComponentProps { isInLab: boolean; } -const EditorCreateDialog: FC<EditorCreateDialogProps> = ({ type, isInLab, onRequestClose }) => { - const isExist = useMemo(() => values(NODE_TYPES).some(el => el === type), [type]); +const EditorCreateDialog: FC<EditorCreateDialogProps> = ({ + type, + isInLab, + onRequestClose, +}) => { + const isExist = useMemo( + () => values(NODE_TYPES).some((el) => el === type), + [type], + ); const data = useRef({ ...EMPTY_NODE, type, is_promoted: !isInLab }); @@ -24,14 +31,20 @@ const EditorCreateDialog: FC<EditorCreateDialogProps> = ({ type, isInLab, onRequ await createNode(node); onRequestClose(); }, - [onRequestClose, createNode] + [onRequestClose, createNode], ); if (!type || !isExist) { return null; } - return <EditorDialog node={data.current} onRequestClose={onRequestClose} onSubmit={onSubmit} />; + return ( + <EditorDialog + node={data.current} + onRequestClose={onRequestClose} + onSubmit={onSubmit} + /> + ); }; export { EditorCreateDialog }; diff --git a/src/containers/dialogs/EditorDialog/components/AudioGrid/index.tsx b/src/containers/dialogs/EditorDialog/components/AudioGrid/index.tsx index 1102eb47..44d3ee22 100644 --- a/src/containers/dialogs/EditorDialog/components/AudioGrid/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/AudioGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { SortableAudioGrid } from '~/components/sortable/SortableAudioGrid'; import { UploadStatus } from '~/store/uploader/UploaderStore'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorAudioUploadButton/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorAudioUploadButton/index.tsx index 114d8a81..40598cd3 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorAudioUploadButton/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorAudioUploadButton/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { UploadType } from '~/constants/uploads'; import { EditorUploadButton } from '~/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorFiller/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorFiller/index.tsx index a6856ba6..7c055257 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorFiller/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorFiller/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Filler } from '~/components/common/Filler'; import { IEditorComponentProps } from '~/types/node'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorImageUploadButton/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorImageUploadButton/index.tsx index 91209938..d223d6b2 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorImageUploadButton/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorImageUploadButton/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { UploadType } from '~/constants/uploads'; import { IEditorComponentProps } from '~/types/node'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorPublicSwitch/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorPublicSwitch/index.tsx index 2abafeeb..69e8d474 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorPublicSwitch/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorPublicSwitch/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Icon } from '~/components/common/Icon'; import { Button } from '~/components/input/Button'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton/index.tsx index 22c471d6..71db0fe1 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton/index.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, FC, useCallback } from 'react'; +import { ChangeEvent, FC, useCallback } from 'react'; import { Icon } from '~/components/common/Icon'; import { Button } from '~/components/input/Button'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadCoverButton/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadCoverButton/index.tsx index 254c0ffb..4a30109a 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadCoverButton/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadCoverButton/index.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, FC, useCallback, useEffect } from 'react'; +import { ChangeEvent, FC, useCallback, useEffect } from 'react'; import { Icon } from '~/components/common/Icon'; import { UploadSubject, UploadTarget, UploadType } from '~/constants/uploads'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/index.tsx index 69eb3d3f..1beeec8c 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/index.tsx @@ -1,4 +1,4 @@ -import React, { createElement, FC } from 'react'; +import { createElement, FC } from 'react'; import { useNodeFormContext } from '~/hooks/node/useNodeFormFormik'; import { has } from '~/utils/ramda'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorButtons/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorButtons/index.tsx index 155c36c7..692a5657 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorButtons/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorButtons/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Filler } from '~/components/common/Filler'; import { Group } from '~/components/common/Group'; diff --git a/src/containers/dialogs/EditorDialog/components/EditorConfirmClose/index.tsx b/src/containers/dialogs/EditorDialog/components/EditorConfirmClose/index.tsx index 7f9dace5..140bd265 100644 --- a/src/containers/dialogs/EditorDialog/components/EditorConfirmClose/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/EditorConfirmClose/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { Button } from '~/components/input/Button'; diff --git a/src/containers/dialogs/EditorDialog/components/ImageEditor/index.tsx b/src/containers/dialogs/EditorDialog/components/ImageEditor/index.tsx index ce304682..283d08c8 100644 --- a/src/containers/dialogs/EditorDialog/components/ImageEditor/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/ImageEditor/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { UploadDropzone } from '~/components/upload/UploadDropzone'; import { NodeEditorProps } from '~/types/node'; diff --git a/src/containers/dialogs/EditorDialog/components/ImageGrid/index.tsx b/src/containers/dialogs/EditorDialog/components/ImageGrid/index.tsx index 26d91aac..07161055 100644 --- a/src/containers/dialogs/EditorDialog/components/ImageGrid/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/ImageGrid/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { SortableImageGrid } from '~/components/sortable/SortableImageGrid'; import { useWindowSize } from '~/hooks/dom/useWindowSize'; diff --git a/src/containers/dialogs/EditorDialog/components/TextEditor/index.tsx b/src/containers/dialogs/EditorDialog/components/TextEditor/index.tsx index 25665ee5..4db2f517 100644 --- a/src/containers/dialogs/EditorDialog/components/TextEditor/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/TextEditor/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { Textarea } from '~/components/input/Textarea'; import { useRandomPhrase } from '~/constants/phrases'; @@ -14,15 +14,21 @@ const TextEditor: FC<IProps> = () => { const { values, setFieldValue } = useNodeFormContext(); const placeholder = useRandomPhrase('SIMPLE'); - const setText = useCallback((text: string) => setFieldValue('blocks', [{ type: 'text', text }]), [ - setFieldValue, - ]); + const setText = useCallback( + (text: string) => setFieldValue('blocks', [{ type: 'text', text }]), + [setFieldValue], + ); const text = (path(['blocks', 0, 'text'], values) as string) || ''; return ( <div className={styles.wrap}> - <Textarea value={text} handler={setText} minRows={6} placeholder={placeholder} /> + <Textarea + value={text} + handler={setText} + minRows={6} + placeholder={placeholder} + /> </div> ); }; diff --git a/src/containers/dialogs/EditorDialog/components/VideoEditor/index.tsx b/src/containers/dialogs/EditorDialog/components/VideoEditor/index.tsx index 2d015b58..91241a7b 100644 --- a/src/containers/dialogs/EditorDialog/components/VideoEditor/index.tsx +++ b/src/containers/dialogs/EditorDialog/components/VideoEditor/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useMemo } from 'react'; +import { FC, useCallback, useMemo } from 'react'; import classnames from 'classnames'; @@ -15,9 +15,10 @@ type IProps = NodeEditorProps & {}; const VideoEditor: FC<IProps> = () => { const { values, setFieldValue } = useNodeFormContext(); - const setUrl = useCallback((url: string) => setFieldValue('blocks', [{ type: 'video', url }]), [ - setFieldValue, - ]); + const setUrl = useCallback( + (url: string) => setFieldValue('blocks', [{ type: 'video', url }]), + [setFieldValue], + ); const url = (path(['blocks', 0, 'url'], values) as string) || ''; const preview = useMemo(() => getYoutubeThumb(url), [url]); diff --git a/src/containers/dialogs/EditorDialog/index.tsx b/src/containers/dialogs/EditorDialog/index.tsx index d5144e4c..4cb624e9 100644 --- a/src/containers/dialogs/EditorDialog/index.tsx +++ b/src/containers/dialogs/EditorDialog/index.tsx @@ -1,10 +1,4 @@ -import React, { - createElement, - FC, - useCallback, - useMemo, - useState, -} from 'react'; +import { createElement, FC, useCallback, useMemo, useState } from 'react'; import { FormikProvider } from 'formik'; import { observer } from 'mobx-react-lite'; diff --git a/src/containers/dialogs/EditorEditDialog/index.tsx b/src/containers/dialogs/EditorEditDialog/index.tsx index 13ea890a..3fd21cf7 100644 --- a/src/containers/dialogs/EditorEditDialog/index.tsx +++ b/src/containers/dialogs/EditorEditDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from 'react'; +import { FC, useCallback } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/containers/dialogs/LoadingDialog/index.tsx b/src/containers/dialogs/LoadingDialog/index.tsx index fc081dd8..13bb2486 100644 --- a/src/containers/dialogs/LoadingDialog/index.tsx +++ b/src/containers/dialogs/LoadingDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { LoaderCircle } from '~/components/common/LoaderCircle'; diff --git a/src/containers/dialogs/Modal/index.tsx b/src/containers/dialogs/Modal/index.tsx index 1a43da99..63616b1e 100644 --- a/src/containers/dialogs/Modal/index.tsx +++ b/src/containers/dialogs/Modal/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC, createElement } from 'react'; import { observer } from 'mobx-react-lite'; @@ -18,7 +18,7 @@ const Modal: FC<IProps> = observer(() => { return ( <ModalWrapper onOverlayClick={hide}> - {React.createElement(DIALOG_CONTENT[current!]! as any, { + {createElement(DIALOG_CONTENT[current!]! as any, { onRequestClose: hide, ...props, })} diff --git a/src/containers/dialogs/PhotoSwipe/index.tsx b/src/containers/dialogs/PhotoSwipe/index.tsx index a0437ec3..3a285696 100644 --- a/src/containers/dialogs/PhotoSwipe/index.tsx +++ b/src/containers/dialogs/PhotoSwipe/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, VFC } from 'react'; +import { useEffect, useRef, VFC } from 'react'; import classNames from 'classnames'; import { observer } from 'mobx-react-lite'; diff --git a/src/containers/dialogs/TestDialog/index.tsx b/src/containers/dialogs/TestDialog/index.tsx index 21e76720..bd6264e4 100644 --- a/src/containers/dialogs/TestDialog/index.tsx +++ b/src/containers/dialogs/TestDialog/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { BetterScrollDialog } from '~/components/common/BetterScrollDialog'; diff --git a/src/containers/flow/FlowStamp/index.tsx b/src/containers/flow/FlowStamp/index.tsx index 94d9158c..5644a999 100644 --- a/src/containers/flow/FlowStamp/index.tsx +++ b/src/containers/flow/FlowStamp/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, FormEvent, useCallback, useMemo } from 'react'; +import { FC, FormEvent, useCallback, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/lab/LabLoading/index.tsx b/src/containers/lab/LabLoading/index.tsx index 084663df..49581dba 100644 --- a/src/containers/lab/LabLoading/index.tsx +++ b/src/containers/lab/LabLoading/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo } from 'react'; +import { FC, memo } from 'react'; import { Columns } from '~/components/common/Columns'; import { LabNode } from '~/components/lab/LabNode'; diff --git a/src/containers/lab/LabStats/index.tsx b/src/containers/lab/LabStats/index.tsx index b409dd8f..f96891ce 100644 --- a/src/containers/lab/LabStats/index.tsx +++ b/src/containers/lab/LabStats/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { SubTitle } from '~/components/common/SubTitle'; diff --git a/src/containers/main/BottomContainer/index.tsx b/src/containers/main/BottomContainer/index.tsx index ada9724f..de71bc79 100644 --- a/src/containers/main/BottomContainer/index.tsx +++ b/src/containers/main/BottomContainer/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { PlayerView } from '~/containers/player/PlayerView'; diff --git a/src/containers/main/Container/index.tsx b/src/containers/main/Container/index.tsx index 6a4b4bfd..f12c3c64 100644 --- a/src/containers/main/Container/index.tsx +++ b/src/containers/main/Container/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/main/MainRouter/index.tsx b/src/containers/main/MainRouter/index.tsx index a8404efc..ecabb7ef 100644 --- a/src/containers/main/MainRouter/index.tsx +++ b/src/containers/main/MainRouter/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Redirect, Route, Switch, useLocation } from 'react-router'; diff --git a/src/containers/main/SubmitBarRouter/components/SubmitBar/index.tsx b/src/containers/main/SubmitBarRouter/components/SubmitBar/index.tsx index 17c5a9af..bdb68700 100644 --- a/src/containers/main/SubmitBarRouter/components/SubmitBar/index.tsx +++ b/src/containers/main/SubmitBarRouter/components/SubmitBar/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback, useState } from 'react'; +import { FC, useCallback, useState } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/main/SubmitBarRouter/index.tsx b/src/containers/main/SubmitBarRouter/index.tsx index 87f673cc..a31e33b5 100644 --- a/src/containers/main/SubmitBarRouter/index.tsx +++ b/src/containers/main/SubmitBarRouter/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Authorized } from '~/components/common/Authorized'; diff --git a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentEmbedBlock/index.tsx b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentEmbedBlock/index.tsx index 3e2fc242..8305866d 100644 --- a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentEmbedBlock/index.tsx +++ b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentEmbedBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo, useMemo } from 'react'; +import { FC, memo, useMemo } from 'react'; import { Icon } from '~/components/common/Icon'; import { ICommentBlockProps } from '~/constants/comment'; diff --git a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentLike/index.tsx b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentLike/index.tsx index e0ac77e8..e0c4e32f 100644 --- a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentLike/index.tsx +++ b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentLike/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classnames from 'classnames'; diff --git a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentMenu/index.tsx b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentMenu/index.tsx index f19028e7..9c05352f 100644 --- a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentMenu/index.tsx +++ b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { CornerMenu } from '~/components/menu/CornerMenu'; diff --git a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentTextBlock/index.tsx b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentTextBlock/index.tsx index 4b0289f7..ed0de098 100644 --- a/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentTextBlock/index.tsx +++ b/src/containers/node/NodeComments/components/Comment/components/CommentContent/components/CommentTextBlock/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/node/NodeComments/components/Comment/components/CommentDistance/index.tsx b/src/containers/node/NodeComments/components/Comment/components/CommentDistance/index.tsx index a74d2e27..7e682f17 100644 --- a/src/containers/node/NodeComments/components/Comment/components/CommentDistance/index.tsx +++ b/src/containers/node/NodeComments/components/Comment/components/CommentDistance/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, memo, useMemo } from 'react'; +import { FC, memo, useMemo } from 'react'; import { formatDistance } from 'date-fns'; import ru from 'date-fns/locale/ru'; diff --git a/src/containers/node/NodeComments/components/Comment/index.tsx b/src/containers/node/NodeComments/components/Comment/index.tsx index ec645f93..121d8051 100644 --- a/src/containers/node/NodeComments/components/Comment/index.tsx +++ b/src/containers/node/NodeComments/components/Comment/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, HTMLAttributes, memo } from 'react'; +import { FC, HTMLAttributes, memo } from 'react'; import classNames from 'classnames'; import { parseISO } from 'date-fns'; diff --git a/src/containers/node/NodeComments/index.tsx b/src/containers/node/NodeComments/index.tsx index e598ad97..41905936 100644 --- a/src/containers/node/NodeComments/index.tsx +++ b/src/containers/node/NodeComments/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/containers/pages/ErrorNotFound/index.tsx b/src/containers/pages/ErrorNotFound/index.tsx index 9eff2e22..831a351f 100644 --- a/src/containers/pages/ErrorNotFound/index.tsx +++ b/src/containers/pages/ErrorNotFound/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { createPortal } from 'react-dom'; @@ -13,7 +13,7 @@ const ErrorNotFound: VFC = () => <h2 className={styles.sign}>Страница утеряна</h2> <div>Нам очень жаль</div> </div>, - document.body + document.body, ); export { ErrorNotFound }; diff --git a/src/containers/player/PlayerView/components/PlayerBar/index.tsx b/src/containers/player/PlayerView/components/PlayerBar/index.tsx index d59d9853..3b4d7c5a 100644 --- a/src/containers/player/PlayerView/components/PlayerBar/index.tsx +++ b/src/containers/player/PlayerView/components/PlayerBar/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, VFC } from 'react'; +import { useCallback, VFC } from 'react'; import { Icon } from '~/components/common/Icon'; import { PlayerState } from '~/constants/player'; diff --git a/src/containers/player/PlayerView/index.tsx b/src/containers/player/PlayerView/index.tsx index 51249c1c..93ac7511 100644 --- a/src/containers/player/PlayerView/index.tsx +++ b/src/containers/player/PlayerView/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { useAudioPlayer } from '~/utils/providers/AudioPlayerProvider'; diff --git a/src/containers/profile/ProfileAccounts/index.tsx b/src/containers/profile/ProfileAccounts/index.tsx index e876bbff..f836ad87 100644 --- a/src/containers/profile/ProfileAccounts/index.tsx +++ b/src/containers/profile/ProfileAccounts/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, Fragment } from 'react'; +import { FC, Fragment } from 'react'; import { Group } from '~/components/common/Group'; import { Icon } from '~/components/common/Icon'; diff --git a/src/containers/profile/ProfileInfo/index.tsx b/src/containers/profile/ProfileInfo/index.tsx index 948bdfff..50d0da6b 100644 --- a/src/containers/profile/ProfileInfo/index.tsx +++ b/src/containers/profile/ProfileInfo/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { Placeholder } from '~/components/placeholders/Placeholder'; diff --git a/src/containers/profile/ProfileLoader/index.tsx b/src/containers/profile/ProfileLoader/index.tsx index 6f2102d8..51fd1a4f 100644 --- a/src/containers/profile/ProfileLoader/index.tsx +++ b/src/containers/profile/ProfileLoader/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { LoaderCircle } from '~/components/common/LoaderCircle'; diff --git a/src/containers/profile/ProfilePageLeft/index.tsx b/src/containers/profile/ProfilePageLeft/index.tsx index e268fbaa..6418d07b 100644 --- a/src/containers/profile/ProfilePageLeft/index.tsx +++ b/src/containers/profile/ProfilePageLeft/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Avatar } from '~/components/common/Avatar'; import { Placeholder } from '~/components/placeholders/Placeholder'; diff --git a/src/containers/profile/ProfilePageStats/index.tsx b/src/containers/profile/ProfilePageStats/index.tsx index 633b4660..fee17a60 100644 --- a/src/containers/profile/ProfilePageStats/index.tsx +++ b/src/containers/profile/ProfilePageStats/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { StatsRow } from '~/components/common/StatsRow'; import { SubTitle } from '~/components/common/SubTitle'; diff --git a/src/containers/profile/ProfileQuickInfo/index.tsx b/src/containers/profile/ProfileQuickInfo/index.tsx index ddf5ad62..4d972645 100644 --- a/src/containers/profile/ProfileQuickInfo/index.tsx +++ b/src/containers/profile/ProfileQuickInfo/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/profile/ProfileSidebarHead/index.tsx b/src/containers/profile/ProfileSidebarHead/index.tsx index b17b3adf..c413f51d 100644 --- a/src/containers/profile/ProfileSidebarHead/index.tsx +++ b/src/containers/profile/ProfileSidebarHead/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Filler } from '~/components/common/Filler'; import { Group } from '~/components/common/Group'; diff --git a/src/containers/profile/ProfileSidebarLogoutButton/index.tsx b/src/containers/profile/ProfileSidebarLogoutButton/index.tsx index bc03f284..9a43a80a 100644 --- a/src/containers/profile/ProfileSidebarLogoutButton/index.tsx +++ b/src/containers/profile/ProfileSidebarLogoutButton/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { Padder } from '~/components/common/Padder'; diff --git a/src/containers/profile/ProfileSidebarMenu/index.tsx b/src/containers/profile/ProfileSidebarMenu/index.tsx index e309ecc9..41faa8c5 100644 --- a/src/containers/profile/ProfileSidebarMenu/index.tsx +++ b/src/containers/profile/ProfileSidebarMenu/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, VFC } from 'react'; +import { useCallback, VFC } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/profile/ProfileStats/index.tsx b/src/containers/profile/ProfileStats/index.tsx index 6da74058..a4392981 100644 --- a/src/containers/profile/ProfileStats/index.tsx +++ b/src/containers/profile/ProfileStats/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Card } from '~/components/common/Card'; import { Grid } from '~/components/common/Grid'; diff --git a/src/containers/profile/ProfileTabs/index.tsx b/src/containers/profile/ProfileTabs/index.tsx index 3f47b1c1..35115038 100644 --- a/src/containers/profile/ProfileTabs/index.tsx +++ b/src/containers/profile/ProfileTabs/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Tabs } from '~/components/common/Tabs'; diff --git a/src/containers/profile/ProfileToggles/index.tsx b/src/containers/profile/ProfileToggles/index.tsx index ed60c36f..d9e5f21e 100644 --- a/src/containers/profile/ProfileToggles/index.tsx +++ b/src/containers/profile/ProfileToggles/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { SuperPowersToggle } from '~/containers/auth/SuperPowersToggle'; diff --git a/src/containers/settings/SettingsDeleted/index.tsx b/src/containers/settings/SettingsDeleted/index.tsx index cfd4b400..6c9c08d2 100644 --- a/src/containers/settings/SettingsDeleted/index.tsx +++ b/src/containers/settings/SettingsDeleted/index.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { Filler } from '~/components/common/Filler'; import { Group } from '~/components/common/Group'; diff --git a/src/containers/settings/ThemeSwitcher/index.tsx b/src/containers/settings/ThemeSwitcher/index.tsx index 89d83f2d..cca45663 100644 --- a/src/containers/settings/ThemeSwitcher/index.tsx +++ b/src/containers/settings/ThemeSwitcher/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import classNames from 'classnames'; diff --git a/src/containers/sidebars/ProfileSidebar/index.tsx b/src/containers/sidebars/ProfileSidebar/index.tsx index bd723609..ff623d89 100644 --- a/src/containers/sidebars/ProfileSidebar/index.tsx +++ b/src/containers/sidebars/ProfileSidebar/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useMemo, VFC } from 'react'; +import { useCallback, useEffect, useMemo, VFC } from 'react'; import { CoverBackdrop } from '~/components/common/CoverBackdrop'; import { ProfileSidebarNotes } from '~/components/profile/ProfileSidebarNotes'; diff --git a/src/containers/tags/TagInput/index.tsx b/src/containers/tags/TagInput/index.tsx index 031c74f9..4fd50992 100644 --- a/src/containers/tags/TagInput/index.tsx +++ b/src/containers/tags/TagInput/index.tsx @@ -1,4 +1,4 @@ -import React, { +import { ChangeEvent, FC, useCallback, diff --git a/src/containers/tags/Tags/index.tsx b/src/containers/tags/Tags/index.tsx index eb17591c..98df0201 100644 --- a/src/containers/tags/Tags/index.tsx +++ b/src/containers/tags/Tags/index.tsx @@ -1,10 +1,4 @@ -import React, { - FC, - HTMLAttributes, - useCallback, - useMemo, - useState, -} from 'react'; +import { FC, HTMLAttributes, useCallback, useMemo, useState } from 'react'; import { TagField } from '~/components/common/TagField'; import { Tag } from '~/components/tags/Tag'; diff --git a/src/hooks/dom/useDragDetector.tsx b/src/hooks/dom/useDragDetector.tsx index 890a68e1..671ecd2e 100644 --- a/src/hooks/dom/useDragDetector.tsx +++ b/src/hooks/dom/useDragDetector.tsx @@ -1,4 +1,11 @@ -import React, { createContext, FC, useCallback, useContext, useEffect, useState } from 'react'; +import { + createContext, + FC, + useCallback, + useContext, + useEffect, + useState, +} from 'react'; const DragContext = createContext({ isDragging: false, @@ -9,19 +16,24 @@ export const DragDetectorProvider: FC = ({ children }) => { const [isDragging, setIsDragging] = useState(false); return ( - <DragContext.Provider value={{ isDragging, setIsDragging }}>{children}</DragContext.Provider> + <DragContext.Provider value={{ isDragging, setIsDragging }}> + {children} + </DragContext.Provider> ); }; export const useDragDetector = () => { const { isDragging, setIsDragging } = useContext(DragContext); - const onStopDragging = useCallback(() => setIsDragging(false), [setIsDragging]); + const onStopDragging = useCallback( + () => setIsDragging(false), + [setIsDragging], + ); useEffect(() => { const addClass = () => setIsDragging(true); - const removeClass = event => { + const removeClass = (event) => { // Small hack to ignore intersection with child elements if (event.pageX !== 0 && event.pageY !== 0) { return; diff --git a/src/layouts/LabLayout/index.tsx b/src/layouts/LabLayout/index.tsx index a7935435..6944cd6f 100644 --- a/src/layouts/LabLayout/index.tsx +++ b/src/layouts/LabLayout/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Group } from '~/components/common/Group'; import { Sticky } from '~/components/common/Sticky'; diff --git a/src/layouts/MainLayout/index.tsx b/src/layouts/MainLayout/index.tsx index 8211e423..a23b7b29 100644 --- a/src/layouts/MainLayout/index.tsx +++ b/src/layouts/MainLayout/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { LoadingProgress } from '~/components/common/LoadingProgress'; import { HeaderSSR } from '~/containers/main/Header/ssr'; diff --git a/src/layouts/NodeLayout/index.tsx b/src/layouts/NodeLayout/index.tsx index 170a652c..405796ea 100644 --- a/src/layouts/NodeLayout/index.tsx +++ b/src/layouts/NodeLayout/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/layouts/NotFoundLayout/index.tsx b/src/layouts/NotFoundLayout/index.tsx index b4d8a18d..adc385e2 100644 --- a/src/layouts/NotFoundLayout/index.tsx +++ b/src/layouts/NotFoundLayout/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, VFC } from 'react'; +import { useCallback, VFC } from 'react'; import { useRouter } from 'next/router'; @@ -19,7 +19,9 @@ const NotFoundLayout: VFC<NotFoundLayoutProps> = () => { <div className={styles.block}> <div className={styles.text}> <h1>Потерян навсегда</h1> - <p className={styles.caption}>Этой страницы никогда не существовало</p> + <p className={styles.caption}> + Этой страницы никогда не существовало + </p> <Button color="outline-white" diff --git a/src/layouts/RoomLayout/index.tsx b/src/layouts/RoomLayout/index.tsx index e805ca44..80da62b4 100644 --- a/src/layouts/RoomLayout/index.tsx +++ b/src/layouts/RoomLayout/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Anchor } from '~/components/common/Anchor'; import { Button } from '~/components/input/Button'; diff --git a/src/layouts/SettingsLayout/index.tsx b/src/layouts/SettingsLayout/index.tsx index 1d3ab2b0..0ce09fdd 100644 --- a/src/layouts/SettingsLayout/index.tsx +++ b/src/layouts/SettingsLayout/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Card } from '~/components/common/Card'; import { Sticky } from '~/components/common/Sticky'; diff --git a/src/layouts/WelcomeLayout/index.tsx b/src/layouts/WelcomeLayout/index.tsx index 3c96fbc6..df4de9b9 100644 --- a/src/layouts/WelcomeLayout/index.tsx +++ b/src/layouts/WelcomeLayout/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { HistorySlide } from '~/components/welcome/HistorySlide'; import { PersonsSlide } from '~/components/welcome/PersonsSlide'; import { WelcomeSlide } from '~/components/welcome/WelcomeSlide'; diff --git a/src/pages/boris.tsx b/src/pages/boris.tsx index 53625202..4008aaba 100644 --- a/src/pages/boris.tsx +++ b/src/pages/boris.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 09ccc3f3..1fe08394 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { observer } from 'mobx-react-lite'; import { InferGetStaticPropsType } from 'next'; diff --git a/src/pages/lab.tsx b/src/pages/lab.tsx index 98739022..38a51504 100644 --- a/src/pages/lab.tsx +++ b/src/pages/lab.tsx @@ -1,4 +1,4 @@ -import React, { VFC } from 'react'; +import { VFC } from 'react'; import { PageTitle } from '~/components/common/PageTitle'; import { LabLayout } from '~/layouts/LabLayout'; diff --git a/src/pages/node/[id].tsx b/src/pages/node/[id].tsx index cb1497a0..57a50fcd 100644 --- a/src/pages/node/[id].tsx +++ b/src/pages/node/[id].tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { observer } from 'mobx-react-lite'; import { GetStaticPropsResult, InferGetStaticPropsType } from 'next'; diff --git a/src/pages/profile/[username].tsx b/src/pages/profile/[username].tsx index 418d75eb..4f50dbd5 100644 --- a/src/pages/profile/[username].tsx +++ b/src/pages/profile/[username].tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { useRouter } from 'next/router'; import { RouteComponentProps } from 'react-router'; diff --git a/src/pages/room/index.tsx b/src/pages/room/index.tsx index a4544869..8cb3235e 100644 --- a/src/pages/room/index.tsx +++ b/src/pages/room/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { InferGetStaticPropsType } from 'next'; import { RouteComponentProps } from 'react-router'; diff --git a/src/pages/settings/index.tsx b/src/pages/settings/index.tsx index 5a748d89..b416f011 100644 --- a/src/pages/settings/index.tsx +++ b/src/pages/settings/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { PageTitle } from '~/components/common/PageTitle'; import { ProfileSettings } from '~/components/profile/ProfileSettings'; import { SettingsLayout } from '~/layouts/SettingsLayout'; diff --git a/src/pages/settings/notes.tsx b/src/pages/settings/notes.tsx index 122616ed..814d9844 100644 --- a/src/pages/settings/notes.tsx +++ b/src/pages/settings/notes.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { PageTitle } from '~/components/common/PageTitle'; import { SettingsNotes } from '~/containers/settings/SettingsNotes'; import { SettingsLayout } from '~/layouts/SettingsLayout'; diff --git a/src/pages/settings/trash.tsx b/src/pages/settings/trash.tsx index fed946e5..3e0ee2f9 100644 --- a/src/pages/settings/trash.tsx +++ b/src/pages/settings/trash.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { PageTitle } from '~/components/common/PageTitle'; import { SettingsDeleted } from '~/containers/settings/SettingsDeleted'; import { SettingsLayout } from '~/layouts/SettingsLayout'; diff --git a/src/sprites/Sprites.tsx b/src/sprites/Sprites.tsx index 4e81bef7..a01e7e52 100644 --- a/src/sprites/Sprites.tsx +++ b/src/sprites/Sprites.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; const Sprites: FC = () => ( <svg width={0} height={0} viewBox="0 0 24 24"> diff --git a/src/utils/context/CommentContextProvider.tsx b/src/utils/context/CommentContextProvider.tsx index d044d429..a4e2de29 100644 --- a/src/utils/context/CommentContextProvider.tsx +++ b/src/utils/context/CommentContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { IComment, IFile } from '~/types'; diff --git a/src/utils/context/LabContextProvider.tsx b/src/utils/context/LabContextProvider.tsx index 20d3e913..d90f90b8 100644 --- a/src/utils/context/LabContextProvider.tsx +++ b/src/utils/context/LabContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { IFlowNode, ITag } from '~/types'; import { ILabNode, LabNodesSort } from '~/types/lab'; @@ -36,8 +36,9 @@ const defaultValues: LabContextProps = { const LabContext = createContext<LabContextProps>(defaultValues); -export const LabContextProvider: FC<LabContextProps> = ({ children, ...rest }) => ( - <LabContext.Provider value={rest}>{children}</LabContext.Provider> -); +export const LabContextProvider: FC<LabContextProps> = ({ + children, + ...rest +}) => <LabContext.Provider value={rest}>{children}</LabContext.Provider>; export const useLabContext = () => useContext(LabContext); diff --git a/src/utils/context/NodeContextProvider.tsx b/src/utils/context/NodeContextProvider.tsx index 9e09cd7f..7fc67e24 100644 --- a/src/utils/context/NodeContextProvider.tsx +++ b/src/utils/context/NodeContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { EMPTY_NODE } from '~/constants/node'; import { INode, NodeBackLink } from '~/types'; diff --git a/src/utils/context/NodeRelatedContextProvider.tsx b/src/utils/context/NodeRelatedContextProvider.tsx index eb24d95b..89c5cb36 100644 --- a/src/utils/context/NodeRelatedContextProvider.tsx +++ b/src/utils/context/NodeRelatedContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { INodeRelated } from '~/types/node'; @@ -12,8 +12,14 @@ const NodeRelatedContext = createContext<NodeRelatedProviderProps>({ isLoading: false, }); -export const NodeRelatedContextProvider: FC<NodeRelatedProviderProps> = ({ children, ...rest }) => ( - <NodeRelatedContext.Provider value={rest}>{children}</NodeRelatedContext.Provider> +export const NodeRelatedContextProvider: FC<NodeRelatedProviderProps> = ({ + children, + ...rest +}) => ( + <NodeRelatedContext.Provider value={rest}> + {children} + </NodeRelatedContext.Provider> ); -export const useNodeRelatedContext = () => useContext<NodeRelatedProviderProps>(NodeRelatedContext); +export const useNodeRelatedContext = () => + useContext<NodeRelatedProviderProps>(NodeRelatedContext); diff --git a/src/utils/context/StoreContextProvider.tsx b/src/utils/context/StoreContextProvider.tsx index f2ad01ae..46dc218e 100644 --- a/src/utils/context/StoreContextProvider.tsx +++ b/src/utils/context/StoreContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { observer } from 'mobx-react-lite'; @@ -6,10 +6,14 @@ import { Store } from '~/store'; export const StoreContext = createContext<Store>(new Store()); -export const StoreContextProvider: FC<{ store: Store }> = observer(({ children, store }) => { - if (!store.isHydrated) return null; +export const StoreContextProvider: FC<{ store: Store }> = observer( + ({ children, store }) => { + if (!store.isHydrated) return null; - return <StoreContext.Provider value={store}>{children}</StoreContext.Provider>; -}); + return ( + <StoreContext.Provider value={store}>{children}</StoreContext.Provider> + ); + }, +); export const useStore = () => useContext(StoreContext); diff --git a/src/utils/context/TagsContextProvider.tsx b/src/utils/context/TagsContextProvider.tsx index 668017f8..030ae972 100644 --- a/src/utils/context/TagsContextProvider.tsx +++ b/src/utils/context/TagsContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { ITag } from '~/types'; @@ -22,8 +22,13 @@ const TagContext = createContext<TagContextProps>({ onTagDelete: () => {}, }); -export const TagsContextProvider: FC<TagContextProps> = ({ children, ...contextValue }) => { - return <TagContext.Provider value={contextValue}>{children}</TagContext.Provider>; +export const TagsContextProvider: FC<TagContextProps> = ({ + children, + ...contextValue +}) => { + return ( + <TagContext.Provider value={contextValue}>{children}</TagContext.Provider> + ); }; export const useTagContext = () => useContext(TagContext); diff --git a/src/utils/context/UploaderContextProvider.tsx b/src/utils/context/UploaderContextProvider.tsx index dbe3d6cb..826c9c82 100644 --- a/src/utils/context/UploaderContextProvider.tsx +++ b/src/utils/context/UploaderContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { EMPTY_FILE } from '~/constants/uploads'; import { useUploader } from '~/hooks/data/useUploader'; diff --git a/src/utils/context/UserContextProvider.tsx b/src/utils/context/UserContextProvider.tsx index 02e02c85..2e665ac4 100644 --- a/src/utils/context/UserContextProvider.tsx +++ b/src/utils/context/UserContextProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { observer } from 'mobx-react-lite'; diff --git a/src/utils/providers/AudioPlayerProvider.tsx b/src/utils/providers/AudioPlayerProvider.tsx index aaa8a688..1337f0fe 100644 --- a/src/utils/providers/AudioPlayerProvider.tsx +++ b/src/utils/providers/AudioPlayerProvider.tsx @@ -1,4 +1,12 @@ -import React, { createContext, FC, useCallback, useContext, useEffect, useRef, useState } from 'react'; +import { + createContext, + FC, + useCallback, + useContext, + useEffect, + useRef, + useState, +} from 'react'; import { PlayerState } from '~/constants/player'; import { IFile } from '~/types'; @@ -35,10 +43,16 @@ const PlayerContext = createContext<AudioPlayerProps>({ }); export const AudioPlayerProvider: FC = ({ children }) => { - const audio = useRef(typeof Audio !== 'undefined' ? new Audio() : undefined).current; + const audio = useRef( + typeof Audio !== 'undefined' ? new Audio() : undefined, + ).current; const [status, setStatus] = useState(PlayerState.UNSET); const [file, setFile] = useState<IFile | undefined>(); - const [progress, setProgress] = useState<PlayerProgress>({ progress: 0, current: 0, total: 0 }); + const [progress, setProgress] = useState<PlayerProgress>({ + progress: 0, + current: 0, + total: 0, + }); /** controls */ const play = async () => audio?.play(); @@ -58,14 +72,14 @@ export const AudioPlayerProvider: FC = ({ children }) => { audio.currentTime = time; }, - [audio] + [audio], ); const toPercent = useCallback( (percent: number) => { toTime((progress.total * percent) / 100); }, - [progress, toTime] + [progress, toTime], ); /** handles progress update */ @@ -109,12 +123,26 @@ export const AudioPlayerProvider: FC = ({ children }) => { const metadata: IFile['metadata'] = path(['metadata'], file); const title = (metadata && - (metadata.title || [metadata.id3artist, metadata.id3title].filter(el => !!el).join(' - '))) || + (metadata.title || + [metadata.id3artist, metadata.id3title] + .filter((el) => !!el) + .join(' - '))) || ''; return ( <PlayerContext.Provider - value={{ file, setFile, title, progress, toTime, toPercent, play, pause, stop, status }} + value={{ + file, + setFile, + title, + progress, + toTime, + toPercent, + play, + pause, + stop, + status, + }} > {children} </PlayerContext.Provider> diff --git a/src/utils/providers/FlowProvider.tsx b/src/utils/providers/FlowProvider.tsx index 0720e842..448f9cb4 100644 --- a/src/utils/providers/FlowProvider.tsx +++ b/src/utils/providers/FlowProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext, useMemo } from 'react'; +import { createContext, FC, useContext, useMemo } from 'react'; import { observer } from 'mobx-react-lite'; @@ -32,27 +32,36 @@ export const FlowContext = createContext<FlowContextProps>({ onChangeCellView: () => {}, }); -export const FlowProvider: FC<FlowProviderProps> = observer(({ fallbackData, children }) => { - const flow = useFlow(); +export const FlowProvider: FC<FlowProviderProps> = observer( + ({ fallbackData, children }) => { + const flow = useFlow(); + + const value = useMemo<FlowContextProps>(() => { + if (!flow.nodes?.length && fallbackData) { + return { + ...flow, + heroes: fallbackData.heroes || [], + updates: fallbackData.updated || [], + recent: fallbackData.recent || [], + nodes: uniq([ + ...(fallbackData.before || []), + ...(fallbackData.after || []), + ]), + }; + } - const value = useMemo<FlowContextProps>(() => { - if (!flow.nodes?.length && fallbackData) { return { ...flow, - heroes: fallbackData.heroes || [], - updates: fallbackData.updated || [], - recent: fallbackData.recent || [], - nodes: uniq([...(fallbackData.before || []), ...(fallbackData.after || [])]), + heroes: fallbackData?.heroes?.length + ? fallbackData.heroes + : flow.heroes, }; - } + }, [flow, fallbackData]); - return { - ...flow, - heroes: fallbackData?.heroes?.length ? fallbackData.heroes : flow.heroes, - }; - }, [flow, fallbackData]); - - return <FlowContext.Provider value={value}>{children}</FlowContext.Provider>; -}); + return ( + <FlowContext.Provider value={value}>{children}</FlowContext.Provider> + ); + }, +); export const useFlowContext = () => useContext(FlowContext); diff --git a/src/utils/providers/LabProvider.tsx b/src/utils/providers/LabProvider.tsx index c3701be3..d7ca38a7 100644 --- a/src/utils/providers/LabProvider.tsx +++ b/src/utils/providers/LabProvider.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { useLab } from '~/hooks/lab/useLab'; import { LabContextProvider } from '~/utils/context/LabContextProvider'; diff --git a/src/utils/providers/MetadataProvider.tsx b/src/utils/providers/MetadataProvider.tsx index fcf805ba..18d0cd9d 100644 --- a/src/utils/providers/MetadataProvider.tsx +++ b/src/utils/providers/MetadataProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext, useEffect } from 'react'; +import { createContext, FC, useContext, useEffect } from 'react'; import { observer, useLocalObservable } from 'mobx-react-lite'; @@ -26,7 +26,7 @@ const fetchItems = async (ids: string[]) => { export const MetadataProvider: FC = observer(({ children }) => { const { metadata, enqueue, queue, pending, watch } = useLocalObservable( - () => new MetadataStore(fetchItems) + () => new MetadataStore(fetchItems), ); useEffect(watch, [watch]); diff --git a/src/utils/providers/NodeRelatedProvider.tsx b/src/utils/providers/NodeRelatedProvider.tsx index f948d076..8b46d80d 100644 --- a/src/utils/providers/NodeRelatedProvider.tsx +++ b/src/utils/providers/NodeRelatedProvider.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { useGetNodeRelated } from '~/hooks/node/useGetNodeRelated'; import { INode, ITag } from '~/types'; @@ -15,11 +15,18 @@ const defaultValue: INodeRelated = { similar: [], }; -const NodeRelatedProvider: FC<NodeRelatedProviderProps> = ({ id, children, tags }) => { +const NodeRelatedProvider: FC<NodeRelatedProviderProps> = ({ + id, + children, + tags, +}) => { const { related, isLoading } = useGetNodeRelated(id); return ( - <NodeRelatedContextProvider related={related || defaultValue} isLoading={isLoading}> + <NodeRelatedContextProvider + related={related || defaultValue} + isLoading={isLoading} + > {children} </NodeRelatedContextProvider> ); diff --git a/src/utils/providers/SWRConfigProvider.tsx b/src/utils/providers/SWRConfigProvider.tsx index 2f7bd67f..a74d5c5a 100644 --- a/src/utils/providers/SWRConfigProvider.tsx +++ b/src/utils/providers/SWRConfigProvider.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { SWRConfig, SWRConfiguration } from 'swr'; diff --git a/src/utils/providers/SearchProvider.tsx b/src/utils/providers/SearchProvider.tsx index ace32e35..ca475904 100644 --- a/src/utils/providers/SearchProvider.tsx +++ b/src/utils/providers/SearchProvider.tsx @@ -1,4 +1,4 @@ -import React, { createContext, FC, useContext } from 'react'; +import { createContext, FC, useContext } from 'react'; import { useSearch } from '~/hooks/search/useSearch'; import { INode } from '~/types'; @@ -22,7 +22,8 @@ export const SearchContext = createContext<SearchContextProps>({ }); export const SearchProvider: FC = ({ children }) => { - const { results, searchText, isLoading, loadMore, setSearchText, hasMore } = useSearch(); + const { results, searchText, isLoading, loadMore, setSearchText, hasMore } = + useSearch(); return ( <SearchContext.Provider diff --git a/src/utils/providers/ThemeProvider.tsx b/src/utils/providers/ThemeProvider.tsx index 66958863..556bec1a 100644 --- a/src/utils/providers/ThemeProvider.tsx +++ b/src/utils/providers/ThemeProvider.tsx @@ -1,4 +1,4 @@ -import React, { +import { createContext, FC, useCallback, diff --git a/src/utils/toast/index.tsx b/src/utils/toast/index.tsx index bda14d3f..ca2e8764 100644 --- a/src/utils/toast/index.tsx +++ b/src/utils/toast/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import classNames from 'classnames'; import toast, { ToastOptions } from 'react-hot-toast'; @@ -14,21 +12,30 @@ const defaultOptions: ToastOptions = { }; export const showToastError = (message: string) => - toast.error(t => <span onClick={() => toast.dismiss(t.id)}>{message}</span>, { - ...defaultOptions, - className: classNames(styles.toast, styles.error), - }); + toast.error( + (t) => <span onClick={() => toast.dismiss(t.id)}>{message}</span>, + { + ...defaultOptions, + className: classNames(styles.toast, styles.error), + }, + ); export const showToastSuccess = (message: string) => - toast.success(t => <span onClick={() => toast.dismiss(t.id)}>{message}</span>, { - ...defaultOptions, - className: classNames(styles.toast, styles.success), - }); + toast.success( + (t) => <span onClick={() => toast.dismiss(t.id)}>{message}</span>, + { + ...defaultOptions, + className: classNames(styles.toast, styles.success), + }, + ); export const showToastInfo = (message: string) => - toast.success(t => <span onClick={() => toast.dismiss(t.id)}>{message}</span>, { - ...defaultOptions, - className: classNames(styles.toast, styles.info), - }); + toast.success( + (t) => <span onClick={() => toast.dismiss(t.id)}>{message}</span>, + { + ...defaultOptions, + className: classNames(styles.toast, styles.info), + }, + ); export const hideToast = (id: string) => toast.dismiss(id); diff --git a/src/utils/types.ts b/src/utils/types.ts index 21f1e758..fa616269 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -1,23 +1,30 @@ -import React from 'react'; +import { + AnchorHTMLAttributes, + ButtonHTMLAttributes, + DetailedHTMLProps, + HTMLAttributes, + ImgHTMLAttributes, + SVGProps as ReactSVGProps, +} from 'react'; -export type DivProps = React.DetailedHTMLProps< - React.HTMLAttributes<HTMLDivElement>, +export type DivProps = DetailedHTMLProps< + HTMLAttributes<HTMLDivElement>, HTMLDivElement >; -export type SVGProps = React.SVGProps<SVGSVGElement>; +export type SVGProps = ReactSVGProps<SVGSVGElement>; -export type IMGProps = React.DetailedHTMLProps< - React.ImgHTMLAttributes<HTMLImageElement>, +export type IMGProps = DetailedHTMLProps< + ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement >; -export type ButtonProps = React.DetailedHTMLProps< - React.ButtonHTMLAttributes<HTMLButtonElement>, +export type ButtonProps = DetailedHTMLProps< + ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement >; -export type LinkProps = React.DetailedHTMLProps< - React.AnchorHTMLAttributes<HTMLAnchorElement>, +export type LinkProps = DetailedHTMLProps< + AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement >;