mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 13:26:40 +07:00
refactored hooks directory
This commit is contained in:
parent
efa3ba902d
commit
f76a5a4798
106 changed files with 122 additions and 144 deletions
|
@ -3,7 +3,7 @@ import styles from './styles.module.scss';
|
|||
import { clearAllBodyScrollLocks, disableBodyScroll } from 'body-scroll-lock';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { LoaderCircle } from '~/components/input/LoaderCircle';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { useCloseOnEscape } from '~/hooks';
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactChild;
|
||||
|
|
|
@ -5,8 +5,8 @@ import { useHistory, useRouteMatch } from 'react-router';
|
|||
import { values } from 'ramda';
|
||||
import { INode } from '~/redux/types';
|
||||
import { apiPostNode } from '~/redux/node/api';
|
||||
import { useUpdateNode } from '~/utils/hooks/data/useUpdateNode';
|
||||
import { useCreateNode } from '~/utils/hooks/data/useCreateNode';
|
||||
import { useUpdateNode } from '~/hooks/node/useUpdateNode';
|
||||
import { useCreateNode } from '~/hooks/node/useCreateNode';
|
||||
|
||||
const EditorCreateDialog: FC = () => {
|
||||
const history = useHistory();
|
||||
|
|
|
@ -5,15 +5,15 @@ import { NODE_EDITORS } from '~/redux/node/constants';
|
|||
import { BetterScrollDialog } from '../BetterScrollDialog';
|
||||
import { CoverBackdrop } from '~/components/containers/CoverBackdrop';
|
||||
import { prop } from 'ramda';
|
||||
import { useNodeFormFormik } from '~/utils/hooks/node/useNodeFormFormik';
|
||||
import { useNodeFormFormik } from '~/hooks/node/useNodeFormFormik';
|
||||
import { EditorButtons } from '~/components/editors/EditorButtons';
|
||||
import { FileUploaderProvider, useFileUploader } from '~/utils/hooks/useFileUploader';
|
||||
import { FileUploaderProvider, useFileUploader } from '~/hooks/data/useFileUploader';
|
||||
import { UPLOAD_SUBJECTS, UPLOAD_TARGETS } from '~/redux/uploads/constants';
|
||||
import { FormikProvider } from 'formik';
|
||||
import { INode } from '~/redux/types';
|
||||
import { ModalWrapper } from '~/components/dialogs/ModalWrapper';
|
||||
import { useTranslatedError } from '~/utils/hooks/useTranslatedError';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { useTranslatedError } from '~/hooks/data/useTranslatedError';
|
||||
import { useCloseOnEscape } from '~/hooks';
|
||||
import { EditorConfirmClose } from '~/components/editors/EditorConfirmClose';
|
||||
import { on } from 'cluster';
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import { useHistory, useRouteMatch } from 'react-router';
|
|||
import { ModalWrapper } from '~/components/dialogs/ModalWrapper';
|
||||
import { LoaderCircle } from '~/components/input/LoaderCircle';
|
||||
import styles from './styles.module.scss';
|
||||
import { useGetNode } from '~/utils/hooks/data/useGetNode';
|
||||
import { useUpdateNode } from '~/utils/hooks/data/useUpdateNode';
|
||||
import { useGetNode } from '~/hooks/node/useGetNode';
|
||||
import { useUpdateNode } from '~/hooks/node/useUpdateNode';
|
||||
import { INode } from '~/redux/types';
|
||||
|
||||
const EditorEditDialog: FC = () => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, FormEvent, useCallback, useEffect, useState } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { DIALOGS, IDialogProps } from '~/redux/modal/constants';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { useCloseOnEscape } from '~/hooks';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import { Button } from '~/components/input/Button';
|
||||
|
@ -18,7 +18,7 @@ import { pick } from 'ramda';
|
|||
import { LoginDialogButtons } from '~/containers/dialogs/LoginDialogButtons';
|
||||
import { OAUTH_EVENT_TYPES } from '~/redux/types';
|
||||
import { DialogTitle } from '~/components/dialogs/DialogTitle';
|
||||
import { useTranslatedError } from '~/utils/hooks/useTranslatedError';
|
||||
import { useTranslatedError } from '~/hooks/data/useTranslatedError';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
...pick(['error', 'is_registering'], selectAuthLogin(state)),
|
||||
|
@ -80,7 +80,7 @@ const LoginDialogUnconnected: FC<IProps> = ({
|
|||
[authGotOauthLoginEvent]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
useEffect(() => {
|
||||
if (error) userSetLoginError('');
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [username, password]);
|
||||
|
|
|
@ -9,7 +9,7 @@ import { InputText } from '~/components/input/InputText';
|
|||
import styles from './styles.module.scss';
|
||||
import { selectAuthRegisterSocial } from '~/redux/auth/selectors';
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { useCloseOnEscape } from '~/hooks';
|
||||
import { LoginSocialRegisterButtons } from '~/containers/dialogs/LoginSocialRegisterButtons';
|
||||
import { Toggle } from '~/components/input/Toggle';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, useCallback } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { DIALOG_CONTENT } from '~/constants/dialogs';
|
||||
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
||||
import { useShallowSelect } from '~/hooks/data/useShallowSelect';
|
||||
import { selectModal } from '~/redux/modal/selectors';
|
||||
import { modalSetDialog, modalSetShown, modalShowDialog } from '~/redux/modal/actions';
|
||||
import { ModalWrapper } from '~/components/dialogs/ModalWrapper';
|
||||
|
|
|
@ -12,7 +12,7 @@ import { PRESETS } from '~/constants/urls';
|
|||
import * as MODAL_ACTIONS from '~/redux/modal/actions';
|
||||
import styles from './styles.module.scss';
|
||||
import classNames from 'classnames';
|
||||
import { useBlockBackButton } from '~/utils/hooks/useBlockBackButton';
|
||||
import { useBlockBackButton } from '~/hooks/navigation/useBlockBackButton';
|
||||
|
||||
const mapStateToProps = (state: IState) => ({
|
||||
photoswipe: selectModal(state).photoswipe,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { pick } from 'ramda';
|
|||
import { selectAuthRestore } from '~/redux/auth/selectors';
|
||||
import { ERROR_LITERAL, ERRORS } from '~/constants/errors';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { useCloseOnEscape } from '~/hooks';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
restore: selectAuthRestore(state),
|
||||
|
|
|
@ -12,7 +12,7 @@ import { pick } from 'ramda';
|
|||
import { selectAuthRestore } from '~/redux/auth/selectors';
|
||||
import { ERROR_LITERAL } from '~/constants/errors';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { useCloseOnEscape } from '~/hooks';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
restore: selectAuthRestore(state),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue