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:
parent
946a78a7ef
commit
bdf803a70c
22 changed files with 33 additions and 80 deletions
|
@ -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,
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue