diff --git a/src/helpers/index.ts b/src/helpers/index.ts index 140a5ea..b55216d 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -1,2 +1,3 @@ export * from './global' export * from './proxies' +export * from './time' diff --git a/src/signals/global.ts b/src/helpers/time.ts similarity index 63% rename from src/signals/global.ts rename to src/helpers/time.ts index b10ea87..0f87049 100644 --- a/src/signals/global.ts +++ b/src/helpers/time.ts @@ -1,5 +1,4 @@ -import dayjs from 'dayjs' -import { locale } from '~/i18n' +import dayjs, { locale } from 'dayjs' export const formatTimeFromNow = (time: number | string) => dayjs(time).locale(locale()).fromNow() diff --git a/src/pages/Connections.tsx b/src/pages/Connections.tsx index b55075e..405b5a0 100644 --- a/src/pages/Connections.tsx +++ b/src/pages/Connections.tsx @@ -37,6 +37,7 @@ import { } from '~/components' import DocumentTitle from '~/components/DocumentTitle' import { CONNECTIONS_TABLE_ACCESSOR_KEY } from '~/constants' +import { formatTimeFromNow } from '~/helpers' import { useI18n } from '~/i18n' import { allConnections, @@ -45,7 +46,6 @@ import { connectionsTableColumnVisibility, connectionsTableSize, endpoint, - formatTimeFromNow, quickFilterRegex, setConnectionsTableColumnOrder, setConnectionsTableColumnVisibility, diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index fa98d88..e33ca97 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -17,12 +17,12 @@ import { import DocumentTitle from '~/components/DocumentTitle' import { filterProxiesByAvailability, + formatTimeFromNow, sortProxiesByOrderingType, } from '~/helpers' import { useI18n } from '~/i18n' import { endpoint, - formatTimeFromNow, hideUnAvailableProxies, iconHeight, iconMarginRight, diff --git a/src/pages/Rules.tsx b/src/pages/Rules.tsx index 8737c45..c8a804a 100644 --- a/src/pages/Rules.tsx +++ b/src/pages/Rules.tsx @@ -4,9 +4,9 @@ import { matchSorter } from 'match-sorter' import { twMerge } from 'tailwind-merge' import { Button } from '~/components' import DocumentTitle from '~/components/DocumentTitle' -import { useStringBooleanMap } from '~/helpers' +import { formatTimeFromNow, useStringBooleanMap } from '~/helpers' import { useI18n } from '~/i18n' -import { endpoint, formatTimeFromNow, useRules } from '~/signals' +import { endpoint, useRules } from '~/signals' import { Rule, RuleProvider } from '~/types' enum ActiveTab { diff --git a/src/signals/index.ts b/src/signals/index.ts index 7680896..2e37a89 100644 --- a/src/signals/index.ts +++ b/src/signals/index.ts @@ -1,6 +1,5 @@ export * from './config' export * from './connections' -export * from './global' export * from './proxies' export * from './request' export * from './rules'