Fixed 'use client' usage.

This commit is contained in:
Mike Cao 2024-02-05 23:59:33 -08:00
parent be5592446a
commit f7151a880e
208 changed files with 323 additions and 385 deletions

View file

@ -1,4 +1,3 @@
'use client';
import * as reactQuery from '@tanstack/react-query';
import { useApi as nextUseApi } from 'next-basics';
import { getClientAuthToken } from 'lib/client';

View file

@ -1,4 +1,3 @@
'use client';
import { useEffect } from 'react';
import useStore, { setConfig } from 'store/app';
import { useApi } from './useApi';

View file

@ -1,4 +1,3 @@
'use client';
import { UseQueryOptions } from '@tanstack/react-query';
import { useState, Dispatch, SetStateAction } from 'react';
import { useApi } from './useApi';

View file

@ -1,4 +1,3 @@
'use client';
import useStore, { setUser } from 'store/app';
import useApi from './useApi';
import { UseQueryResult } from '@tanstack/react-query';

View file

@ -1,4 +1,3 @@
'use client';
import { produce } from 'immer';
import { useCallback, useEffect, useState } from 'react';
import { useApi } from './useApi';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import useFilterQuery from './useFilterQuery';
import useModified from 'store/modified';

View file

@ -1,4 +1,3 @@
'use client';
import useStore, { setShareToken } from 'store/app';
import useApi from './useApi';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
export function useTeam(teamId: string) {

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import useFilterQuery from './useFilterQuery';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import useFilterQuery from './useFilterQuery';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import useFilterQuery from './useFilterQuery';
import { useLogin } from 'components/hooks';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
export function useUser(userId: string, options?: { [key: string]: any }) {

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import useFilterQuery from './useFilterQuery';
import useModified from 'store/modified';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
export function useWebsite(websiteId: string, options?: { [key: string]: any }) {

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import { UseQueryOptions } from '@tanstack/react-query';

View file

@ -1,4 +1,3 @@
'use client';
import useApi from './useApi';
import { UseQueryOptions } from '@tanstack/react-query';

View file

@ -1,4 +1,3 @@
'use client';
import { useApi } from './useApi';
import { useFilterQuery } from './useFilterQuery';
import { useLogin } from './useLogin';

View file

@ -1,4 +1,3 @@
'use client';
import { useState, useEffect } from 'react';
import { httpGet } from 'next-basics';
import enUS from '../../../public/intl/country/en-US.json';

View file

@ -1,4 +1,3 @@
'use client';
import { getMinimumUnit, parseDateRange } from 'lib/date';
import { setItem } from 'next-basics';
import { DATE_RANGE_CONFIG, DEFAULT_DATE_RANGE } from 'lib/constants';

View file

@ -1,4 +1,3 @@
'use client';
import { useEffect } from 'react';
export function useDocumentClick(handler: (event: MouseEvent) => any) {

View file

@ -1,4 +1,3 @@
'use client';
import { useEffect, useCallback, KeyboardEvent } from 'react';
export function useEscapeKey(handler: (event: KeyboardEvent) => void) {

View file

@ -1,4 +1,3 @@
'use client';
import { useMessages } from './useMessages';
import { OPERATORS } from 'lib/constants';

View file

@ -1,4 +1,3 @@
'use client';
import { useCallback, useState } from 'react';
export function useForceUpdate() {

View file

@ -1,4 +1,3 @@
'use client';
import useMessages from './useMessages';
import { BROWSERS } from 'lib/constants';
import useLocale from './useLocale';

View file

@ -1,4 +1,3 @@
'use client';
import { useState, useEffect } from 'react';
import { httpGet } from 'next-basics';
import enUS from '../../../public/intl/language/en-US.json';

View file

@ -1,4 +1,3 @@
'use client';
import { useEffect } from 'react';
import { httpGet, setItem } from 'next-basics';
import { LOCALE_CONFIG } from 'lib/constants';

View file

@ -1,4 +1,3 @@
'use client';
import { useIntl, FormattedMessage } from 'react-intl';
import { messages, labels } from 'components/messages';

View file

@ -1,4 +1,3 @@
'use client';
import { useMemo } from 'react';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { buildUrl } from 'next-basics';

View file

@ -1,4 +1,3 @@
'use client';
import { useState, useEffect, useRef } from 'react';
export function useSticky({ enabled = true, threshold = 1 }) {

View file

@ -1,4 +1,3 @@
'use client';
import { usePathname } from 'next/navigation';
export function useTeamUrl(): {

View file

@ -1,4 +1,3 @@
'use client';
import { useEffect } from 'react';
import useStore, { setTheme } from 'store/app';
import { getItem, setItem } from 'next-basics';

View file

@ -1,4 +1,3 @@
'use client';
import { useState, useCallback } from 'react';
import { getTimezone } from 'lib/date';
import { getItem, setItem } from 'next-basics';