Добавление ts-prune и общего скрипта проверки
This commit is contained in:
@ -21,5 +21,3 @@ export const PAGE_TITLE = {
|
||||
[PageType.Settings]: 'Settings',
|
||||
[PageType.SigIn]: 'SigIn',
|
||||
};
|
||||
|
||||
export const UTC_DATE_FORMAT = '';
|
||||
|
||||
@ -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;
|
||||
};
|
||||
@ -1 +1 @@
|
||||
export {default as Page} from './Page';
|
||||
export {default} from './Page';
|
||||
|
||||
@ -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 />
|
||||
|
||||
@ -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'},
|
||||
|
||||
Reference in New Issue
Block a user