mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
eslint fix
This commit is contained in:
parent
dfaac877fb
commit
fa4d51360b
81 changed files with 741 additions and 972 deletions
|
@ -1,4 +1,10 @@
|
|||
import React, { FC, useState, useCallback, useEffect } from 'react';
|
||||
import React, {
|
||||
FC, useState, useCallback, useEffect
|
||||
} from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import append from 'ramda/es/append';
|
||||
import uuid from 'uuid4';
|
||||
import { ScrollDialog } from '../ScrollDialog';
|
||||
import { IDialogProps } from '~/redux/modal/constants';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
|
@ -7,19 +13,15 @@ import { InputText } from '~/components/input/InputText';
|
|||
import { Button } from '~/components/input/Button';
|
||||
import { Padder } from '~/components/containers/Padder';
|
||||
import * as styles from './styles.scss';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectNode } from '~/redux/node/selectors';
|
||||
import { ImageEditor } from '~/components/editors/ImageEditor';
|
||||
import { EditorPanel } from '~/components/editors/EditorPanel';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import append from 'ramda/es/append';
|
||||
import { moveArrItem } from '~/utils/fn';
|
||||
import { IFile, IFileWithUUID } from '~/redux/types';
|
||||
import uuid from 'uuid4';
|
||||
import * as UPLOAD_ACTIONS from '~/redux/uploads/actions';
|
||||
import { selectUploads } from '~/redux/uploads/selectors';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
const mapStateToProps = (state) => {
|
||||
const { editor } = selectNode(state);
|
||||
const { statuses, files } = selectUploads(state);
|
||||
|
||||
|
@ -32,7 +34,9 @@ const mapDispatchToProps = {
|
|||
|
||||
type IProps = IDialogProps & ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
|
||||
|
||||
const EditorDialogUnconnected: FC<IProps> = ({ onRequestClose, editor, uploadUploadFiles, files, statuses }) => {
|
||||
const EditorDialogUnconnected: FC<IProps> = ({
|
||||
onRequestClose, editor, uploadUploadFiles, files, statuses
|
||||
}) => {
|
||||
const [data, setData] = useState(editor);
|
||||
const eventPreventer = useCallback(event => event.preventDefault(), []);
|
||||
const [temp, setTemp] = useState([]);
|
||||
|
@ -68,7 +72,7 @@ const EditorDialogUnconnected: FC<IProps> = ({ onRequestClose, editor, uploadUpl
|
|||
);
|
||||
|
||||
const onInputChange = useCallback(
|
||||
event => {
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (!event.target.files || !event.target.files.length) return;
|
||||
|
@ -109,10 +113,10 @@ const EditorDialogUnconnected: FC<IProps> = ({ onRequestClose, editor, uploadUpl
|
|||
setTemp(temp.filter(el => el !== id));
|
||||
}
|
||||
});
|
||||
}, [statuses, files]);
|
||||
}, [statuses, files, temp, onFileAdd]);
|
||||
|
||||
const setTitle = useCallback(
|
||||
title => {
|
||||
(title) => {
|
||||
setData({ ...data, title });
|
||||
},
|
||||
[setData, data]
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
import React, { FC, FormEvent, useCallback, useEffect, useState } from 'react';
|
||||
import React, {
|
||||
FC, FormEvent, useCallback, useEffect, useState
|
||||
} from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { ScrollDialog } from '../ScrollDialog';
|
||||
import { IDialogProps } from '~/redux/modal/constants';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
|
@ -7,9 +10,8 @@ import { InputText } from '~/components/input/InputText';
|
|||
import { Button } from '~/components/input/Button';
|
||||
import { Padder } from '~/components/containers/Padder';
|
||||
import * as styles from './styles.scss';
|
||||
import { selectAuthLogin } from "~/redux/auth/selectors";
|
||||
import { selectAuthLogin } from '~/redux/auth/selectors';
|
||||
import * as ACTIONS from '~/redux/auth/actions';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const mapStateToProps = selectAuthLogin;
|
||||
|
||||
|
@ -20,7 +22,9 @@ const mapDispatchToProps = {
|
|||
|
||||
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & IDialogProps & {};
|
||||
|
||||
const LoginDialogUnconnected: FC<IProps> = ({ onRequestClose, error, userSendLoginRequest, userSetLoginError }) => {
|
||||
const LoginDialogUnconnected: FC<IProps> = ({
|
||||
onRequestClose, error, userSendLoginRequest, userSetLoginError
|
||||
}) => {
|
||||
const [username, setUserName] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
|
||||
|
@ -31,7 +35,7 @@ const LoginDialogUnconnected: FC<IProps> = ({ onRequestClose, error, userSendLog
|
|||
|
||||
useEffect(() => {
|
||||
if (error) userSetLoginError(null);
|
||||
}, [username, password]);
|
||||
}, [username, password, error, userSetLoginError]);
|
||||
|
||||
const buttons = (
|
||||
<Padder>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import React, { Attributes, FC, useCallback } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import ReactDOM from 'react-dom';
|
||||
import * as styles from './styles.scss';
|
||||
import { IState } from '~/redux/store';
|
||||
import * as ACTIONS from '~/redux/modal/actions';
|
||||
import { connect } from 'react-redux';
|
||||
import { DIALOG_CONTENT, IDialogProps } from '~/redux/modal/constants';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
const mapStateToProps = ({ modal }: IState) => ({ ...modal });
|
||||
const mapDispatchToProps = {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import React, { FC, MouseEventHandler, ReactChild, useCallback, useEffect, useState } from 'react';
|
||||
import React, {
|
||||
FC, MouseEventHandler, ReactChild, useCallback, useEffect, useState
|
||||
} from 'react';
|
||||
// import { DialogPanel } from '~/components/panels/DialogPanel';
|
||||
import classNames from 'classnames';
|
||||
import { Scroll } from '~/components/containers/Scroll';
|
||||
|
@ -41,7 +43,7 @@ const ScrollDialog: FC<IProps> = ({
|
|||
useEffect(() => {
|
||||
window.addEventListener('resize', onResize);
|
||||
return () => window.removeEventListener('resize', onResize);
|
||||
}, []);
|
||||
}, [onResize]);
|
||||
|
||||
const onScroll = useCallback(
|
||||
({ target: { scrollTop = 0 } = {} } = {}) => {
|
||||
|
@ -54,7 +56,7 @@ const ScrollDialog: FC<IProps> = ({
|
|||
[top_sticky, top_sticky_offset, show_top_sticky, setShowTopSticky]
|
||||
);
|
||||
|
||||
useEffect(() => onScroll(), []);
|
||||
useEffect(() => onScroll(), [onScroll]);
|
||||
useEffect(() => {
|
||||
if (ref && onRefCapture) onRefCapture(ref);
|
||||
}, [ref, onRefCapture]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue