diff --git a/libs/orders/src/lib/components/stop-orders-table/stop-orders-table.tsx b/libs/orders/src/lib/components/stop-orders-table/stop-orders-table.tsx index dacb40b5f..b273e10ff 100644 --- a/libs/orders/src/lib/components/stop-orders-table/stop-orders-table.tsx +++ b/libs/orders/src/lib/components/stop-orders-table/stop-orders-table.tsx @@ -3,8 +3,8 @@ import { getDateTimeFormat, isNumeric, toBigNum, - useFormatTrigger, } from '@vegaprotocol/utils'; +import { useFormatTrigger } from '@vegaprotocol/react-helpers'; import * as Schema from '@vegaprotocol/types'; import { ActionsDropdown, diff --git a/libs/react-helpers/src/hooks/index.ts b/libs/react-helpers/src/hooks/index.ts index 86f492a1b..6556970fe 100644 --- a/libs/react-helpers/src/hooks/index.ts +++ b/libs/react-helpers/src/hooks/index.ts @@ -15,3 +15,4 @@ export * from './use-previous'; export * from './use-validate'; export { useScript } from './use-script'; export { useUserAgent } from './use-user-agent'; +export { useFormatTrigger } from './use-format-trigger'; diff --git a/libs/utils/src/lib/format/trigger.ts b/libs/react-helpers/src/hooks/use-format-trigger.ts similarity index 89% rename from libs/utils/src/lib/format/trigger.ts rename to libs/react-helpers/src/hooks/use-format-trigger.ts index 3c869da90..3f9b20547 100644 --- a/libs/utils/src/lib/format/trigger.ts +++ b/libs/react-helpers/src/hooks/use-format-trigger.ts @@ -1,7 +1,9 @@ -import { type StopOrder, StopOrderTriggerDirection } from '@vegaprotocol/types'; -import { addDecimalsFormatNumber } from './number'; import { useCallback } from 'react'; -import { useT } from '../use-t'; +import { type StopOrder, StopOrderTriggerDirection } from '@vegaprotocol/types'; +import { addDecimalsFormatNumber } from '@vegaprotocol/utils'; + +// TODO: add real useT func +const useT = () => (str: string) => str; export const useFormatTrigger = () => { const t = useT(); diff --git a/libs/utils/src/lib/format/index.ts b/libs/utils/src/lib/format/index.ts index e3c52efda..17b79b03a 100644 --- a/libs/utils/src/lib/format/index.ts +++ b/libs/utils/src/lib/format/index.ts @@ -3,5 +3,4 @@ export * from './number'; export * from './range'; export * from './size'; export * from './strings'; -export * from './trigger'; export * from './ether'; diff --git a/libs/web3/src/lib/use-vega-transaction-toasts.tsx b/libs/web3/src/lib/use-vega-transaction-toasts.tsx index ac5882991..9caa1a954 100644 --- a/libs/web3/src/lib/use-vega-transaction-toasts.tsx +++ b/libs/web3/src/lib/use-vega-transaction-toasts.tsx @@ -40,9 +40,9 @@ import { formatNumber, toBigNum, truncateByChars, - useFormatTrigger, HALFMAXGOINT64, } from '@vegaprotocol/utils'; +import { useFormatTrigger } from '@vegaprotocol/react-helpers'; import { useAssetsMapProvider } from '@vegaprotocol/assets'; import { useEthWithdrawApprovalsStore } from './use-ethereum-withdraw-approvals-store'; import { DApp, EXPLORER_TX, useLinks } from '@vegaprotocol/environment';