mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
eslint fix
This commit is contained in:
parent
dfaac877fb
commit
fa4d51360b
81 changed files with 741 additions and 972 deletions
|
@ -1,20 +1,22 @@
|
|||
import * as React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { bindActionCreators } from "redux";
|
||||
import { hot } from "react-hot-loader";
|
||||
import { ConnectedRouter } from "connected-react-router";
|
||||
import { history } from "~/redux/store";
|
||||
import { NavLink, Switch, Route, Redirect } from "react-router-dom";
|
||||
import { FlowLayout } from "~/containers/flow/FlowLayout";
|
||||
import { MainLayout } from "~/containers/main/MainLayout";
|
||||
import { ImageExample } from "~/containers/examples/ImageExample";
|
||||
import { EditorExample } from "~/containers/examples/EditorExample";
|
||||
import { HorizontalExample } from "~/containers/examples/HorizontalExample";
|
||||
import { Sprites } from "~/sprites/Sprites";
|
||||
import { URLS } from "~/constants/urls";
|
||||
import { Modal } from "~/containers/dialogs/Modal";
|
||||
import { selectModal } from "~/redux/modal/selectors";
|
||||
import { BlurWrapper } from "~/components/containers/BlurWrapper";
|
||||
import * as React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { hot } from 'react-hot-loader';
|
||||
import { ConnectedRouter } from 'connected-react-router';
|
||||
import {
|
||||
NavLink, Switch, Route, Redirect
|
||||
} from 'react-router-dom';
|
||||
import { history } from '~/redux/store';
|
||||
import { FlowLayout } from '~/containers/flow/FlowLayout';
|
||||
import { MainLayout } from '~/containers/main/MainLayout';
|
||||
import { ImageExample } from '~/containers/examples/ImageExample';
|
||||
import { EditorExample } from '~/containers/examples/EditorExample';
|
||||
import { HorizontalExample } from '~/containers/examples/HorizontalExample';
|
||||
import { Sprites } from '~/sprites/Sprites';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { Modal } from '~/containers/dialogs/Modal';
|
||||
import { selectModal } from '~/redux/modal/selectors';
|
||||
import { BlurWrapper } from '~/components/containers/BlurWrapper';
|
||||
|
||||
const mapStateToProps = selectModal;
|
||||
const mapDispatchToProps = {};
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import React, { FC } from "react";
|
||||
import { Card } from "~/components/containers/Card";
|
||||
import * as styles from "./styles.scss";
|
||||
import { Group } from "~/components/containers/Group";
|
||||
import { CellGrid } from "~/components/containers/CellGrid";
|
||||
import { Panel } from "~/components/containers/Panel";
|
||||
import classNames from "classnames";
|
||||
import { Scroll } from "~/components/containers/Scroll";
|
||||
import { Tags } from "~/components/node/Tags";
|
||||
import { Button } from "~/components/input/Button";
|
||||
import { Filler } from "~/components/containers/Filler";
|
||||
import { InputText } from "~/components/input/InputText";
|
||||
import { Icon } from "~/components/input/Icon";
|
||||
import { Grid } from "~/components/containers/Grid";
|
||||
import React, { FC } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Card } from '~/components/containers/Card';
|
||||
import * as styles from './styles.scss';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { CellGrid } from '~/components/containers/CellGrid';
|
||||
import { Panel } from '~/components/containers/Panel';
|
||||
import { Scroll } from '~/components/containers/Scroll';
|
||||
import { Tags } from '~/components/node/Tags';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { Grid } from '~/components/containers/Grid';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
|
@ -48,11 +48,11 @@ const EditorExample: FC<IProps> = () => (
|
|||
|
||||
<Tags
|
||||
tags={[
|
||||
{ title: "Избранный", feature: "red" },
|
||||
{ title: "Плейлист", feature: "green" },
|
||||
{ title: "Просто" },
|
||||
{ title: "+ фото", feature: "black" },
|
||||
{ title: "+ с музыкой", feature: "black" }
|
||||
{ title: 'Избранный', feature: 'red' },
|
||||
{ title: 'Плейлист', feature: 'green' },
|
||||
{ title: 'Просто' },
|
||||
{ title: '+ фото', feature: 'black' },
|
||||
{ title: '+ с музыкой', feature: 'black' }
|
||||
]}
|
||||
/>
|
||||
</Group>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import React, { FC } from "react";
|
||||
import { Card } from "~/components/containers/Card";
|
||||
import * as styles from "./styles.scss";
|
||||
import { Group } from "~/components/containers/Group";
|
||||
import { Padder } from "~/components/containers/Padder";
|
||||
import range from "ramda/es/range";
|
||||
import { Comment } from "~/components/node/Comment";
|
||||
import { NodePanel } from "~/components/node/NodePanel";
|
||||
import { NodeRelated } from "~/components/node/NodeRelated";
|
||||
import { Tags } from "~/components/node/Tags";
|
||||
import { MenuButton } from "~/components/node/MenuButton";
|
||||
import { NodeNoComments } from "~/components/node/NodeNoComments";
|
||||
import { InputText } from "~/components/input/InputText";
|
||||
import React, { FC } from 'react';
|
||||
import range from 'ramda/es/range';
|
||||
import { Card } from '~/components/containers/Card';
|
||||
import * as styles from './styles.scss';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Padder } from '~/components/containers/Padder';
|
||||
import { Comment } from '~/components/node/Comment';
|
||||
import { NodePanel } from '~/components/node/NodePanel';
|
||||
import { NodeRelated } from '~/components/node/NodeRelated';
|
||||
import { Tags } from '~/components/node/Tags';
|
||||
import { MenuButton } from '~/components/node/MenuButton';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
|
@ -55,11 +55,11 @@ const ImageExample: FC<IProps> = () => (
|
|||
|
||||
<Tags
|
||||
tags={[
|
||||
{ title: "Избранный", feature: "red" },
|
||||
{ title: "Плейлист", feature: "green" },
|
||||
{ title: "Просто" },
|
||||
{ title: "+ фото", feature: "black" },
|
||||
{ title: "+ с музыкой", feature: "black" }
|
||||
{ title: 'Избранный', feature: 'red' },
|
||||
{ title: 'Плейлист', feature: 'green' },
|
||||
{ title: 'Просто' },
|
||||
{ title: '+ фото', feature: 'black' },
|
||||
{ title: '+ с музыкой', feature: 'black' }
|
||||
]}
|
||||
/>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react';
|
||||
import { TestGrid } from "~/components/flow/TestGrid";
|
||||
import { TestGrid } from '~/components/flow/TestGrid';
|
||||
|
||||
export const FlowLayout = () => (
|
||||
<div className="default_container content_container">
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import * as React from 'react';
|
||||
import { SidePane } from "~/components/main/SidePane";
|
||||
import { SidePane } from '~/components/main/SidePane';
|
||||
import * as styles from './styles.scss';
|
||||
import { Header } from "~/components/main/Header";
|
||||
import { Header } from '~/components/main/Header';
|
||||
|
||||
export const MainLayout = ({ children }) => {
|
||||
export const MainLayout = ({ children }) => (
|
||||
<div className={styles.wrapper}>
|
||||
<Header />
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<Header />
|
||||
|
||||
<div className={styles.content}>
|
||||
{children}
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as styles from './styles.scss';
|
|||
interface IProps {}
|
||||
|
||||
const NodeLayout: FC<IProps> = () => (
|
||||
<div></div>
|
||||
<div />
|
||||
);
|
||||
|
||||
export { NodeLayout };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue