Skip to content

Commit

Permalink
UISACQCOMP-179: Export useExchangeRateValue hook for reusability pu…
Browse files Browse the repository at this point in the history
…rposes (#757)
alisher-epam authored and NikitaSedyx committed Feb 21, 2024
1 parent c1a1408 commit 8e42322
Showing 7 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
* Add min and max number validation. Refs UISACQCOMP-176.
* Support location-restricted funds in POLs. Refs UISACQCOMP-177.
* Allow order template to hide Currency and exchange rate fields. Refs UISACQCOMP-178.
* Export `useExchangeRateValue` hook for reusability purposes. Refs UISACQCOMP-179.

## [5.0.0](https://github.com/folio-org/stripes-acq-components/tree/v5.0.0) (2023-10-12)
[Full Changelog](https://github.com/folio-org/stripes-acq-components/compare/v4.0.2...v5.0.0)
2 changes: 1 addition & 1 deletion lib/ExchangeRateValue/ExchangeRateValue.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import {
Loading,
} from '@folio/stripes/components';

import { useExchangeRateValue } from './useExchangeRateValue';
import { useExchangeRateValue } from '../hooks';

const ExchangeRateValue = ({
component,
4 changes: 2 additions & 2 deletions lib/ExchangeRateValue/ExchangeRateValue.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { render } from '@testing-library/react';

import { useExchangeRateValue } from './useExchangeRateValue';
import { useExchangeRateValue } from '../hooks';
import ExchangeRateValue from './ExchangeRateValue';

jest.mock('./useExchangeRateValue', () => {
jest.mock('../hooks', () => {
return {
useExchangeRateValue: jest.fn(),
};
1 change: 1 addition & 0 deletions lib/hooks/index.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ export * from './useAsyncDebounce';
export * from './useCampuses';
export * from './useCategories';
export * from './useEventEmitter';
export * from './useExchangeRateValue';
export * from './useFunds';
export * from './useInstanceHoldings';
export * from './useInstitutions';
1 change: 1 addition & 0 deletions lib/hooks/useExchangeRateValue/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { useExchangeRateValue } from './useExchangeRateValue';
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { useQuery } from 'react-query';

import { useOkapiKy } from '@folio/stripes/core';

import { EXCHANGE_RATE_API } from '../constants';
import { EXCHANGE_RATE_API } from '../../constants';

export const useExchangeRateValue = (exchangeFrom, exchangeTo, manualExchangeRate) => {
const ky = useOkapiKy();
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { QueryClient, QueryClientProvider } from 'react-query';
import { renderHook } from '@testing-library/react-hooks';

0 comments on commit 8e42322

Please sign in to comment.