mirror of
https://github.com/umami-software/umami.git
synced 2026-02-24 22:45:36 +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,11 +1,10 @@
|
|||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { FormRow } from 'react-basics';
|
||||
import { parseDateRange } from 'lib/date';
|
||||
import DateFilter from 'components/input/DateFilter';
|
||||
import WebsiteSelect from 'components/input/WebsiteSelect';
|
||||
import { useMessages, useTeamUrl } from 'components/hooks';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
|
||||
export interface BaseParametersProps {
|
||||
showWebsiteSelect?: boolean;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { REPORT_PARAMETERS } from 'lib/constants';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { Form, FormRow, Menu, Item } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState, useMemo } from 'react';
|
||||
import { Form, FormRow, Item, Flexbox, Dropdown, Button } from 'react-basics';
|
||||
import { useMessages, useFilters, useFormat, useLocale } from 'components/hooks';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { Menu, Item, Form, FormRow } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import styles from './FieldSelectForm.module.css';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { Loading } from 'react-basics';
|
||||
import { subDays } from 'date-fns';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { ReactNode } from 'react';
|
||||
import { Icon, TooltipPopup } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import { CSSProperties, ReactNode } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import styles from './PopupForm.module.css';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
'use client';
|
||||
import styles from './ReportBody.module.css';
|
||||
import { useContext } from 'react';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
|
||||
export function ReportBody({ children }) {
|
||||
const { report } = useContext(ReportContext);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
'use client';
|
||||
import FunnelReport from '../funnel/FunnelReport';
|
||||
import EventDataReport from '../event-data/EventDataReport';
|
||||
import InsightsReport from '../insights/InsightsReport';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { Icon, LoadingButton, InlineEditField, useToasts } from 'react-basics';
|
||||
import { useMessages, useApi, useNavigation, useTeamUrl } from 'components/hooks';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
import styles from './ReportHeader.module.css';
|
||||
import { REPORT_TYPES } from 'lib/constants';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
'use client';
|
||||
import styles from './ReportMenu.module.css';
|
||||
import { useContext } from 'react';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
|
||||
export function ReportMenu({ children }) {
|
||||
const { report } = useContext(ReportContext);
|
||||
|
|
|
|||
|
|
@ -1,20 +1,22 @@
|
|||
'use client';
|
||||
import { createContext, ReactNode } from 'react';
|
||||
import { Loading } from 'react-basics';
|
||||
import classNames from 'classnames';
|
||||
import { useReport } from 'components/hooks';
|
||||
import styles from './Report.module.css';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export const ReportContext = createContext(null);
|
||||
|
||||
export interface ReportProps {
|
||||
export function ReportPage({
|
||||
reportId,
|
||||
defaultParameters,
|
||||
children,
|
||||
className,
|
||||
}: {
|
||||
reportId: string;
|
||||
defaultParameters: { [key: string]: any };
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Report({ reportId, defaultParameters, children, className }: ReportProps) {
|
||||
}) {
|
||||
const report = useReport(reportId, defaultParameters);
|
||||
|
||||
if (!report) {
|
||||
|
|
@ -28,4 +30,4 @@ export function Report({ reportId, defaultParameters, children, className }: Rep
|
|||
);
|
||||
}
|
||||
|
||||
export default Report;
|
||||
export default ReportPage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue