1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

optimized imports

This commit is contained in:
Fedor Katurov 2022-07-20 16:10:05 +07:00
parent 946a78a7ef
commit bdf803a70c
22 changed files with 33 additions and 80 deletions

View file

@ -1,9 +1,6 @@
import { useMemo } from 'react';
import { adjustHue } from 'color2k';
import { generateGradientFromColor, normalizeBrightColor } from '~/utils/color';
import { stringToColour } from '~/utils/dom';
import { generateGradientFromColor } from '~/utils/color';
export const useColorGradientFromString = (
val?: string,

View file

@ -6,10 +6,15 @@ import { IComment } from '~/types';
import { showErrorToast } from '~/utils/errors/showToast';
export const useNodeComments = (nodeId: number, fallbackData?: IComment[]) => {
const { comments, isLoading, onLoadMoreComments, hasMore, data, mutate, isLoadingMore } = useGetComments(
nodeId,
fallbackData
);
const {
comments,
isLoading,
onLoadMoreComments,
hasMore,
data,
mutate,
isLoadingMore,
} = useGetComments(nodeId, fallbackData);
const onDelete = useCallback(
async (id: IComment['id'], isLocked: boolean) => {

View file

@ -1,13 +1,10 @@
import { useCallback, useMemo } from 'react';
import useSWRInfinite, { SWRInfiniteKeyLoader } from 'swr/infinite';
import { getLabNodes } from '~/api/lab';
import { apiGetNotes } from '~/api/notes';
import { ApiGetNotesRequest } from '~/api/notes/types';
import { useAuth } from '~/hooks/auth/useAuth';
import { useUser } from '~/hooks/auth/useUser';
import { GetLabNodesRequest, ILabNode, LabNodesSort } from '~/types/lab';
import { GetLabNodesRequest, ILabNode } from '~/types/lab';
import { flatten, uniqBy } from '~/utils/ramda';
const DEFAULT_COUNT = 20;