diff --git a/src/components/uploadForm/Select/index.tsx b/src/components/Form/Select/index.tsx similarity index 100% rename from src/components/uploadForm/Select/index.tsx rename to src/components/Form/Select/index.tsx diff --git a/src/components/uploadForm/Select/main.css b/src/components/Form/Select/main.css similarity index 100% rename from src/components/uploadForm/Select/main.css rename to src/components/Form/Select/main.css diff --git a/src/components/lists/Card/index.tsx b/src/components/lists/Card/index.tsx index f7b3b15..93f323c 100644 --- a/src/components/lists/Card/index.tsx +++ b/src/components/lists/Card/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { IData } from '../../../types'; +import { IData } from 'types'; import './main.css'; diff --git a/src/components/navigation/Header/index.tsx b/src/components/navigation/Header/index.tsx index 59eafab..9fe7bf5 100644 --- a/src/components/navigation/Header/index.tsx +++ b/src/components/navigation/Header/index.tsx @@ -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'; diff --git a/src/components/navigation/Header/utils.ts b/src/components/navigation/Header/utils.ts index 5011e27..9f38683 100644 --- a/src/components/navigation/Header/utils.ts +++ b/src/components/navigation/Header/utils.ts @@ -1,4 +1,4 @@ -import { IFilterQuery } from '../../../types'; +import { IFilterQuery } from 'types'; const genName = ( searchQuery: IFilterQuery, diff --git a/src/components/navigation/Logotype/index.tsx b/src/components/navigation/Logotype/index.tsx index 30ccf27..dfe6dbc 100644 --- a/src/components/navigation/Logotype/index.tsx +++ b/src/components/navigation/Logotype/index.tsx @@ -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'; diff --git a/src/components/navigation/Navbar/handlers.ts b/src/components/navigation/Navbar/handlers.ts index c0c7143..f8a04b3 100644 --- a/src/components/navigation/Navbar/handlers.ts +++ b/src/components/navigation/Navbar/handlers.ts @@ -1,5 +1,5 @@ import { Dispatch, RefObject, SetStateAction } from 'react'; -import { IFilterQuery } from '../../../types'; +import { IFilterQuery } from 'types'; const handleFiltersButton = ( filtersCollapsed: boolean, diff --git a/src/components/navigation/Navbar/index.tsx b/src/components/navigation/Navbar/index.tsx index a8e4d0a..4f29ebe 100644 --- a/src/components/navigation/Navbar/index.tsx +++ b/src/components/navigation/Navbar/index.tsx @@ -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, diff --git a/src/components/navigation/Navbar/utils.ts b/src/components/navigation/Navbar/utils.ts index 625b3dc..3933526 100644 --- a/src/components/navigation/Navbar/utils.ts +++ b/src/components/navigation/Navbar/utils.ts @@ -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)) { diff --git a/src/views/Admin/LogInForm/index.tsx b/src/views/Admin/LogInForm/index.tsx index e231bc1..3bfc978 100644 --- a/src/views/Admin/LogInForm/index.tsx +++ b/src/views/Admin/LogInForm/index.tsx @@ -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'; diff --git a/src/views/Admin/UploadForm/index.tsx b/src/views/Admin/UploadForm/index.tsx index 07efacd..f97eeb0 100644 --- a/src/views/Admin/UploadForm/index.tsx +++ b/src/views/Admin/UploadForm/index.tsx @@ -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>; token: string | null; - setToken: Dispatch>; }; -const UploadForm: React.FC = ({ setLoading, token, setToken }) => { +const UploadForm: React.FC = ({ setLoading, token }) => { const { push: historyPush } = useHistory(); useEffect(() => { diff --git a/src/views/Admin/UploadForm/handlers.ts b/src/views/Admin/handlers.ts similarity index 88% rename from src/views/Admin/UploadForm/handlers.ts rename to src/views/Admin/handlers.ts index e628a38..53b62f0 100644 --- a/src/views/Admin/UploadForm/handlers.ts +++ b/src/views/Admin/handlers.ts @@ -1,5 +1,5 @@ import { Dispatch, SetStateAction } from 'react'; -import { IErrorStatus } from '../types'; +import { IErrorStatus } from './types'; const handleLoginError = ( err: ErrorEvent, diff --git a/src/views/Admin/index.tsx b/src/views/Admin/index.tsx index 7b2c4df..4bffce9 100644 --- a/src/views/Admin/index.tsx +++ b/src/views/Admin/index.tsx @@ -67,7 +67,6 @@ const Admin: React.FC = ({ token, setToken, setLoading }) => { diff --git a/tsconfig.json b/tsconfig.json index 651e753..91e8f93 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "es5", + "baseUrl": "src", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,