Modules import improvements

This commit is contained in:
Dmitriy Shishkov 2020-09-22 20:23:01 +05:00
parent 7960974e6b
commit 04c340bfd1
No known key found for this signature in database
GPG Key ID: D76D70029F55183E
14 changed files with 20 additions and 21 deletions

View File

@ -1,5 +1,5 @@
import React from 'react';
import { IData } from '../../../types';
import { IData } from 'types';
import './main.css';

View File

@ -2,7 +2,7 @@ import React, { Dispatch, SetStateAction } from 'react';
import { motion } from 'framer-motion';
import { useLocation } from 'react-router-dom';
import { IFilterQuery, ILoadingState } from '../../../types';
import { IFilterQuery, ILoadingState } from 'types';
import './main.css';
import Logotype from '../Logotype';
import { genName } from './utils';

View File

@ -1,4 +1,4 @@
import { IFilterQuery } from '../../../types';
import { IFilterQuery } from 'types';
const genName = (
searchQuery: IFilterQuery,

View File

@ -1,8 +1,8 @@
import React, { Dispatch, SetStateAction } from 'react';
import { Link } from 'react-router-dom';
import { emptyQuery } from '../Navbar/utils';
import { IFilterQuery } from '../../../types';
import { emptyQuery } from 'components/navigation/Navbar/utils';
import { IFilterQuery } from 'types';
import LogoImage from './logo.png';
import './main.css';

View File

@ -1,5 +1,5 @@
import { Dispatch, RefObject, SetStateAction } from 'react';
import { IFilterQuery } from '../../../types';
import { IFilterQuery } from 'types';
const handleFiltersButton = (
filtersCollapsed: boolean,

View File

@ -10,9 +10,9 @@ import { motion } from 'framer-motion';
import './main.css';
import FilterIcon from './filter.svg';
import SearchIcon from './search.svg';
import { IFilterQuery } from '../../../types';
import { useFocus } from '../../../utils';
import Logotype from '../Logotype';
import { IFilterQuery } from 'types';
import { useFocus } from 'utils';
import Logotype from 'components/navigation/Logotype';
import {
filtersVariants,
navVariants,

View File

@ -1,5 +1,5 @@
import { Dispatch, SetStateAction } from 'react';
import { IFilterQuery } from '../../../types';
import { IFilterQuery } from 'types';
const queryIsEmpty = (q: IFilterQuery): boolean => {
for (const value of Object.values(q)) {

View File

@ -1,10 +1,10 @@
import React, { Dispatch, SetStateAction, useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
import { ILoadingState } from '../../../types';
import { handleFormSubmit } from '../utils';
import { IErrorStatus } from '../types';
import { handleLoginError } from '../UploadForm/handlers';
import { ILoadingState } from 'types';
import { handleFormSubmit } from 'views/Admin/utils';
import { IErrorStatus } from 'views/Admin/types';
import { handleLoginError } from 'views/Admin/handlers';
import { handleSuccessfulLogin } from './handlers';
import './main.css';

View File

@ -1,19 +1,18 @@
import React, { Dispatch, SetStateAction, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import Select from '../../../components/uploadForm/Select';
import { ILoadingState } from '../../../types';
import { handleFormSubmit } from '../utils';
import Select from 'components/Form/Select';
import { ILoadingState } from 'types';
import { handleFormSubmit } from 'views/Admin/utils';
import selectOptions from './selectOptions.json';
import './main.css';
type props = {
setLoading: Dispatch<SetStateAction<ILoadingState>>;
token: string | null;
setToken: Dispatch<SetStateAction<string | null>>;
};
const UploadForm: React.FC<props> = ({ setLoading, token, setToken }) => {
const UploadForm: React.FC<props> = ({ setLoading, token }) => {
const { push: historyPush } = useHistory();
useEffect(() => {

View File

@ -1,5 +1,5 @@
import { Dispatch, SetStateAction } from 'react';
import { IErrorStatus } from '../types';
import { IErrorStatus } from './types';
const handleLoginError = (
err: ErrorEvent,

View File

@ -67,7 +67,6 @@ const Admin: React.FC<props> = ({ token, setToken, setLoading }) => {
<UploadForm
setLoading={setLoading}
token={token}
setToken={setToken}
/>
</Route>
<Route path={`${path}/l`}>

View File

@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"baseUrl": "src",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,