Changed import path.

This commit is contained in:
Mike Cao 2025-02-05 15:59:59 -08:00
parent a62e84f516
commit 8525188e42
365 changed files with 1277 additions and 1267 deletions

View file

@ -1,6 +1,6 @@
import { useEffect } from 'react';
import useStore, { setConfig } from 'store/app';
import { getConfig } from 'app/actions/getConfig';
import useStore, { setConfig } from '@/store/app';
import { getConfig } from '@/app/actions/getConfig';
export function useConfig() {
const { config } = useStore();

View file

@ -1,5 +1,5 @@
import { UseQueryResult } from '@tanstack/react-query';
import useStore, { setUser } from 'store/app';
import useStore, { setUser } from '@/store/app';
import { useApi } from '../useApi';
const selector = (state: { user: any }) => state.user;

View file

@ -1,6 +1,6 @@
import { useTimezone } from 'components/hooks';
import { REALTIME_INTERVAL } from 'lib/constants';
import { RealtimeData } from 'lib/types';
import { useTimezone } from '@/components/hooks';
import { REALTIME_INTERVAL } from '@/lib/constants';
import { RealtimeData } from '@/lib/types';
import { useApi } from '../useApi';
export function useRealtime(websiteId: string) {

View file

@ -1,4 +1,4 @@
import useStore, { setShareToken } from 'store/app';
import useStore, { setShareToken } from '@/store/app';
import { useApi } from '../useApi';
const selector = (state: { shareToken: string }) => state.shareToken;

View file

@ -1,7 +1,7 @@
import { useApi } from '../useApi';
import { usePagedQuery } from '../usePagedQuery';
import useModified from '../useModified';
import { useFilterParams } from 'components/hooks/useFilterParams';
import { useFilterParams } from '@/components/hooks/useFilterParams';
export function useWebsiteSessions(websiteId: string, params?: { [key: string]: string | number }) {
const { get } = useApi();

View file

@ -1,6 +1,6 @@
import { useApi } from '../useApi';
import useModified from '../useModified';
import { useFilterParams } from 'components/hooks/useFilterParams';
import { useFilterParams } from '@/components/hooks/useFilterParams';
export function useWebsiteSessionsWeekly(
websiteId: string,

View file

@ -1,5 +1,5 @@
import { useApi } from '../useApi';
import { useCountryNames, useRegionNames } from 'components/hooks';
import { useCountryNames, useRegionNames } from '@/components/hooks';
import useLocale from '../useLocale';
export function useWebsiteValues({

View file

@ -1,9 +1,9 @@
import { useCallback } from 'react';
import * as reactQuery from '@tanstack/react-query';
import { getClientAuthToken } from 'lib/client';
import { SHARE_TOKEN_HEADER } from 'lib/constants';
import { httpGet, httpPost, httpPut, httpDelete } from 'lib/fetch';
import useStore from 'store/app';
import { getClientAuthToken } from '@/lib/client';
import { SHARE_TOKEN_HEADER } from '@/lib/constants';
import { httpGet, httpPost, httpPut, httpDelete } from '@/lib/fetch';
import useStore from '@/store/app';
const selector = (state: { shareToken: { token?: string } }) => state.shareToken;

View file

@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { httpGet } from 'lib/fetch';
import { httpGet } from '@/lib/fetch';
import enUS from '../../../public/intl/country/en-US.json';
const countryNames = {

View file

@ -1,9 +1,9 @@
import { getMinimumUnit, parseDateRange } from 'lib/date';
import { setItem } from 'lib/storage';
import { DATE_RANGE_CONFIG, DEFAULT_DATE_COMPARE, DEFAULT_DATE_RANGE } from 'lib/constants';
import websiteStore, { setWebsiteDateRange, setWebsiteDateCompare } from 'store/websites';
import appStore, { setDateRange } from 'store/app';
import { DateRange } from 'lib/types';
import { getMinimumUnit, parseDateRange } from '@/lib/date';
import { setItem } from '@/lib/storage';
import { DATE_RANGE_CONFIG, DEFAULT_DATE_COMPARE, DEFAULT_DATE_RANGE } from '@/lib/constants';
import websiteStore, { setWebsiteDateRange, setWebsiteDateCompare } from '@/store/websites';
import appStore, { setDateRange } from '@/store/app';
import { DateRange } from '@/lib/types';
import { useLocale } from './useLocale';
import { useApi } from './useApi';

View file

@ -1,5 +1,5 @@
import { useMessages } from './useMessages';
import { OPERATORS } from 'lib/constants';
import { OPERATORS } from '@/lib/constants';
export function useFilters() {
const { formatMessage, labels } = useMessages();

View file

@ -1,5 +1,5 @@
import useMessages from './useMessages';
import { BROWSERS, OS_NAMES } from 'lib/constants';
import { BROWSERS, OS_NAMES } from '@/lib/constants';
import useLocale from './useLocale';
import useCountryNames from './useCountryNames';
import useLanguageNames from './useLanguageNames';

View file

@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { httpGet } from 'lib/fetch';
import { httpGet } from '@/lib/fetch';
import enUS from '../../../public/intl/language/en-US.json';
const languageNames = {

View file

@ -1,9 +1,9 @@
import { useEffect } from 'react';
import { httpGet } from 'lib/fetch';
import { setItem } from 'lib/storage';
import { LOCALE_CONFIG } from 'lib/constants';
import { getDateLocale, getTextDirection } from 'lib/lang';
import useStore, { setLocale } from 'store/app';
import { httpGet } from '@/lib/fetch';
import { setItem } from '@/lib/storage';
import { LOCALE_CONFIG } from '@/lib/constants';
import { getDateLocale, getTextDirection } from '@/lib/lang';
import useStore, { setLocale } from '@/store/app';
import { useForceUpdate } from './useForceUpdate';
import enUS from '../../../public/intl/country/en-US.json';

View file

@ -1,5 +1,5 @@
import { useIntl, FormattedMessage } from 'react-intl';
import { messages, labels } from 'components/messages';
import { messages, labels } from '@/components/messages';
export function useMessages(): any {
const intl = useIntl();

View file

@ -1,4 +1,4 @@
import useStore from 'store/modified';
import useStore from '@/store/modified';
export function useModified(key?: string) {
const modified = useStore(state => state?.[key]);

View file

@ -1,6 +1,6 @@
import { useMemo } from 'react';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { buildUrl } from 'lib/url';
import { buildUrl } from '@/lib/url';
export function useNavigation(): {
pathname: string;

View file

@ -1,6 +1,6 @@
import { UseQueryOptions } from '@tanstack/react-query';
import { useState } from 'react';
import { PageResult, PageParams, PagedQueryResult } from 'lib/types';
import { PageResult, PageParams, PagedQueryResult } from '@/lib/types';
import { useApi } from './useApi';
import { useNavigation } from './useNavigation';

View file

@ -1,7 +1,7 @@
import { useEffect, useMemo } from 'react';
import useStore, { setTheme } from 'store/app';
import { getItem, setItem } from 'lib/storage';
import { DEFAULT_THEME, THEME_COLORS, THEME_CONFIG } from 'lib/constants';
import useStore, { setTheme } from '@/store/app';
import { getItem, setItem } from '@/lib/storage';
import { DEFAULT_THEME, THEME_COLORS, THEME_CONFIG } from '@/lib/constants';
import { colord } from 'colord';
const selector = (state: { theme: string }) => state.theme;

View file

@ -1,7 +1,7 @@
import { setItem } from 'lib/storage';
import { TIMEZONE_CONFIG } from 'lib/constants';
import { setItem } from '@/lib/storage';
import { TIMEZONE_CONFIG } from '@/lib/constants';
import { formatInTimeZone, zonedTimeToUtc, utcToZonedTime } from 'date-fns-tz';
import useStore, { setTimezone } from 'store/app';
import useStore, { setTimezone } from '@/store/app';
const selector = (state: { timezone: string }) => state.timezone;