Добавление ts-prune и общего скрипта проверки

This commit is contained in:
2020-12-29 16:07:49 +03:00
parent 534fa35485
commit 7e9d8abd9c
10 changed files with 184 additions and 33 deletions

View File

@ -21,5 +21,3 @@ export const PAGE_TITLE = {
[PageType.Settings]: 'Settings',
[PageType.SigIn]: 'SigIn',
};
export const UTC_DATE_FORMAT = '';

View File

@ -1,25 +0,0 @@
import {useCallback, useEffect, useRef} from 'react';
export const useOutsideClick = <T extends HTMLElement>(callback: EventListener) => {
const container = useRef<T>(null);
const handleEvent = useCallback((e: Event) => {
if (container.current && e.target !== null) {
if (!container.current.contains(e.target as Node)) {
callback(e);
}
}
}, [callback]);
useEffect(() => {
document.addEventListener('mousedown', handleEvent, true);
document.addEventListener('touchstart', handleEvent, true);
return () => {
document.removeEventListener('mousedown', handleEvent, true);
document.removeEventListener('touchstart', handleEvent, true);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return container;
};

View File

@ -1 +1 @@
export {default as Page} from './Page';
export {default} from './Page';

View File

@ -1,7 +1,7 @@
import React from 'react';
import {Route} from 'react-router-dom';
import {ROUTES} from '_consts/common';
import Page from './components/page/Page';
import Page from './components/page';
export default (
<Route component={Page} path={ROUTES.CALENDAR} exact />

View File

@ -3,7 +3,7 @@ import {FolderType, Icon, TaskStatus} from '_enums/common';
import {Folder, Tag, Task} from '_types/common';
// Псевдоданные
export const TagList: Tag[] = [
const TagList: Tag[] = [
{id: '33', name: 'Tag', color: '#2fc036'},
{id: '66', name: 'Tag', color: '#2fc036'},
{id: '77', name: 'Tag', color: '#2fc036'},
@ -21,7 +21,7 @@ export const TaskList: Task[] = [
{id: v4(), title: 'Title number 1', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress, folder: '4'},
{id: v4(), title: 'Title number 2', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress, folder: '4'},
{id: v4(), title: 'Title number 3', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress, folder: '6'},
{id: v4(), title: 'Title number 4', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress, tags: ['33', '77']},
{id: v4(), title: 'Title number 4', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress, tags: TagList.map(t => t.id)},
{id: v4(), title: 'Title number 5', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress},
{id: v4(), title: 'Title number 6', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress},
{id: v4(), title: 'Title number 7', body: 'Description', created_at: '2019-01-01T13:00', icon: Icon.Apple, status: TaskStatus.Progress, folder: '4'},