mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Fixed 'use client' usage.
This commit is contained in:
parent
be5592446a
commit
f7151a880e
208 changed files with 323 additions and 385 deletions
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { ErrorInfo, ReactNode } from 'react';
|
||||
import { ErrorBoundary as Boundary } from 'react-error-boundary';
|
||||
import { Button } from 'react-basics';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import useStore, { setConfig } from 'store/app';
|
||||
import { useApi } from './useApi';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
import { useState, Dispatch, SetStateAction } from 'react';
|
||||
import { useApi } from './useApi';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useStore, { setUser } from 'store/app';
|
||||
import useApi from './useApi';
|
||||
import { UseQueryResult } from '@tanstack/react-query';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { produce } from 'immer';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useApi } from './useApi';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import useFilterQuery from './useFilterQuery';
|
||||
import useModified from 'store/modified';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useStore, { setShareToken } from 'store/app';
|
||||
import useApi from './useApi';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
|
||||
export function useTeam(teamId: string) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import useFilterQuery from './useFilterQuery';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import useFilterQuery from './useFilterQuery';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import useFilterQuery from './useFilterQuery';
|
||||
import { useLogin } from 'components/hooks';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
|
||||
export function useUser(userId: string, options?: { [key: string]: any }) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import useFilterQuery from './useFilterQuery';
|
||||
import useModified from 'store/modified';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
|
||||
export function useWebsite(websiteId: string, options?: { [key: string]: any }) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useApi from './useApi';
|
||||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useApi } from './useApi';
|
||||
import { useFilterQuery } from './useFilterQuery';
|
||||
import { useLogin } from './useLogin';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export function useDocumentClick(handler: (event: MouseEvent) => any) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useEffect, useCallback, KeyboardEvent } from 'react';
|
||||
|
||||
export function useEscapeKey(handler: (event: KeyboardEvent) => void) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useMessages } from './useMessages';
|
||||
import { OPERATORS } from 'lib/constants';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
export function useForceUpdate() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import useMessages from './useMessages';
|
||||
import { BROWSERS } from 'lib/constants';
|
||||
import useLocale from './useLocale';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import { httpGet, setItem } from 'next-basics';
|
||||
import { LOCALE_CONFIG } from 'lib/constants';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useIntl, FormattedMessage } from 'react-intl';
|
||||
import { messages, labels } from 'components/messages';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useMemo } from 'react';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { buildUrl } from 'next-basics';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
|
||||
export function useSticky({ enabled = true, threshold = 1 }) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
export function useTeamUrl(): {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import useStore, { setTheme } from 'store/app';
|
||||
import { getItem, setItem } from 'next-basics';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState, useCallback } from 'react';
|
||||
import { getTimezone } from 'lib/date';
|
||||
import { getItem, setItem } from 'next-basics';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { Icon, Modal, Dropdown, Item, Text, Flexbox } from 'react-basics';
|
||||
import { endOfYear, isSameDay } from 'date-fns';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export function LogoutButton({
|
|||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
return (
|
||||
<Link href="/src/app/logout/logout">
|
||||
<Link href="/src/app/logout/LogoutPage">
|
||||
<TooltipPopup label={formatMessage(labels.logout)} position={tooltipPosition}>
|
||||
<Button variant="quiet">
|
||||
<Icon>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { Key } from 'react';
|
||||
import { Text, Icon, Button, Popup, Menu, Item, PopupTrigger, Flexbox } from 'react-basics';
|
||||
import classNames from 'classnames';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState, Key } from 'react';
|
||||
import { Dropdown, Item } from 'react-basics';
|
||||
import { useWebsite, useWebsites, useMessages } from 'components/hooks';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
'use client';
|
||||
import { ReactNode } from 'react';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import SideNav from 'components/layout/SideNav';
|
||||
import styles from './SettingsLayout.module.css';
|
||||
import styles from './MenuLayout.module.css';
|
||||
|
||||
export function SettingsLayout({ items = [], children }: { items: any[]; children: ReactNode }) {
|
||||
export function MenuLayout({ items = [], children }: { items: any[]; children: ReactNode }) {
|
||||
const pathname = usePathname();
|
||||
const cloudMode = !!process.env.cloudMode;
|
||||
|
||||
|
|
@ -22,4 +21,4 @@ export function SettingsLayout({ items = [], children }: { items: any[]; childre
|
|||
);
|
||||
}
|
||||
|
||||
export default SettingsLayout;
|
||||
export default MenuLayout;
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { ReactNode } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Banner, Loading } from 'react-basics';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue