diff --git a/src/components/TableTag/presets.tsx b/src/components/TableTag/presets.tsx index 3647e0f..1846879 100644 --- a/src/components/TableTag/presets.tsx +++ b/src/components/TableTag/presets.tsx @@ -40,8 +40,8 @@ export const TAG_PRESETS = { color: 'rgb(146, 64, 14)', }, gray: { - color: 'rgb(71, 84, 103)', - bgColor: 'rgb(248, 250, 252)', - borderColor: 'rgba(15, 23, 42, 0.08)', + color: 'rgb(71, 84, 103)', + bgColor: 'rgb(248, 250, 252)', + borderColor: 'rgba(15, 23, 42, 0.08)', }, } as const; diff --git a/src/hooks/useVirtualList.tsx b/src/hooks/useVirtualList.tsx index fdd04b9..d019b08 100644 --- a/src/hooks/useVirtualList.tsx +++ b/src/hooks/useVirtualList.tsx @@ -1,51 +1,46 @@ -import { useCallback, useMemo, useRef, useState } from "react"; +import { useCallback, useMemo, useRef, useState } from 'react'; type Options = { - /** высота одного элемента в px (фиксированная) */ - itemHeight: number; - /** высота контейнера в px (видимая область) */ - containerHeight: number; - /** сколько элементов рендерить дополнительно сверху/снизу */ - overscan?: number; + /** высота одного элемента в px (фиксированная) */ + itemHeight: number; + /** высота контейнера в px (видимая область) */ + containerHeight: number; + /** сколько элементов рендерить дополнительно сверху/снизу */ + overscan?: number; }; export function useVirtualList(items: T[], options: Options) { - const { itemHeight, containerHeight, overscan = 5 } = options; + const { itemHeight, containerHeight, overscan = 5 } = options; - const [scrollTop, setScrollTop] = useState(0); - const ref = useRef(null); + const [scrollTop, setScrollTop] = useState(0); + const ref = useRef(null); - const totalHeight = items.length * itemHeight; + const totalHeight = items.length * itemHeight; - const startIndex = Math.max( - 0, - Math.floor(scrollTop / itemHeight) - overscan, - ); + const startIndex = Math.max(0, Math.floor(scrollTop / itemHeight) - overscan); - const endIndex = Math.min( - items.length, - Math.ceil((scrollTop + containerHeight) / itemHeight) + overscan, - ); + const endIndex = Math.min(items.length, Math.ceil((scrollTop + containerHeight) / itemHeight) + overscan); - const visibleItems = useMemo( - () => items.slice(startIndex, endIndex).map((item, i) => ({ - item, - index: startIndex + i, - })), - [items, startIndex, endIndex], - ); + const visibleItems = useMemo( + () => + items.slice(startIndex, endIndex).map((item, i) => ({ + item, + index: startIndex + i, + })), + [items, startIndex, endIndex], + ); - const offsetY = startIndex * itemHeight; + const offsetY = startIndex * itemHeight; - const onScroll = useCallback((e: React.UIEvent) => { - setScrollTop(e.currentTarget.scrollTop); - }, []); + const onScroll = useCallback((e: React.UIEvent) => { + setScrollTop(e.currentTarget.scrollTop); + }, []); - return { - ref, - onScroll, - visibleItems, - totalHeight, - offsetY, - }; -} \ No newline at end of file + return { + ref, + onScroll, + visibleItems, + totalHeight, + offsetY, + }; +} diff --git a/src/services/api/directories/catalogue_jur.ts b/src/services/api/directories/catalogue_jur.ts index c84de06..9b1d30a 100644 --- a/src/services/api/directories/catalogue_jur.ts +++ b/src/services/api/directories/catalogue_jur.ts @@ -10,7 +10,7 @@ import type { import { LE_PAGE } from './company_groups'; export async function fetchCatalogueJur(params: GetCatalogueJurPropsI) { - const res = await api.get>('/directories/legal-entities', {limit:LE_PAGE, offset:0, ...params}); + const res = await api.get>('/directories/legal-entities', { limit: LE_PAGE, offset: 0, ...params }); return res; } diff --git a/src/widgets/CatalogueJurForm/CatalogueJurForm.tsx b/src/widgets/CatalogueJurForm/CatalogueJurForm.tsx index ccf1364..bd865e0 100644 --- a/src/widgets/CatalogueJurForm/CatalogueJurForm.tsx +++ b/src/widgets/CatalogueJurForm/CatalogueJurForm.tsx @@ -54,7 +54,7 @@ export const CatalogueJurForm: React.FC = ({ open, onCancel, onOk, jurId } catch (e) { if (e instanceof ApiError) { notification.error({ description: e.message }); - } + } } finally { setInitialDataLoading(false); } diff --git a/src/widgets/CatalogueJurTable/CatalogueJurTable.tsx b/src/widgets/CatalogueJurTable/CatalogueJurTable.tsx index edb5b12..9311884 100644 --- a/src/widgets/CatalogueJurTable/CatalogueJurTable.tsx +++ b/src/widgets/CatalogueJurTable/CatalogueJurTable.tsx @@ -243,7 +243,7 @@ export function CatalogueJurTable({ outside_group, tabsComponent }: CatalogueJur - {(relatedGroupFilter?.id && !outside_group) && ( + {relatedGroupFilter?.id && !outside_group && (