@oanda/labs-order-book-widget 1.0.171 → 1.0.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1356 -0
- package/dist/main/OrderBookWidget/ChartWithData.js +2 -4
- package/dist/main/OrderBookWidget/ChartWithData.js.map +1 -1
- package/dist/main/OrderBookWidget/Main.js +1 -1
- package/dist/main/OrderBookWidget/Main.js.map +1 -1
- package/dist/main/OrderBookWidget/OrderBookWidget.js +12 -17
- package/dist/main/OrderBookWidget/OrderBookWidget.js.map +1 -1
- package/dist/main/OrderBookWidget/components/Chart/Chart.js +1 -1
- package/dist/main/OrderBookWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/OrderBookWidget/ChartWithData.js +3 -3
- package/dist/module/OrderBookWidget/ChartWithData.js.map +1 -1
- package/dist/module/OrderBookWidget/Main.js +3 -3
- package/dist/module/OrderBookWidget/Main.js.map +1 -1
- package/dist/module/OrderBookWidget/OrderBookWidget.js +14 -19
- package/dist/module/OrderBookWidget/OrderBookWidget.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/Chart.js +3 -3
- package/dist/module/OrderBookWidget/components/Chart/Chart.js.map +1 -1
- package/package.json +3 -3
- package/src/OrderBookWidget/ChartWithData.tsx +3 -3
- package/src/OrderBookWidget/Main.tsx +3 -3
- package/src/OrderBookWidget/OrderBookWidget.tsx +17 -20
- package/src/OrderBookWidget/components/Chart/Chart.tsx +3 -3
- package/test/Main.test.tsx +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useEffect
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
2
|
import ReactEChartsCore from 'echarts-for-react/lib/core';
|
|
3
3
|
import * as echarts from 'echarts/core';
|
|
4
4
|
import { CustomChart } from 'echarts/charts';
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
DatasetComponent,
|
|
15
15
|
} from 'echarts/components';
|
|
16
16
|
import {
|
|
17
|
-
Theme,
|
|
17
|
+
Theme, useLayoutProvider, colorPalette, getChartTheme, Size,
|
|
18
18
|
} from '@oanda/labs-widget-common';
|
|
19
19
|
import { useLocale } from '@oanda/mono-i18n';
|
|
20
20
|
import { getResponsiveOption, getOption } from './getOption';
|
|
@@ -38,7 +38,7 @@ echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
|
|
|
38
38
|
|
|
39
39
|
export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
40
40
|
const { lang } = useLocale();
|
|
41
|
-
const { isDark, size } =
|
|
41
|
+
const { isDark, size } = useLayoutProvider();
|
|
42
42
|
const isDesktop = size === Size.DESKTOP;
|
|
43
43
|
|
|
44
44
|
const echartRef = useRef(null);
|
package/test/Main.test.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { render } from '@testing-library/react';
|
|
6
6
|
import { MockedProvider } from '@apollo/client/testing';
|
|
7
|
-
import {
|
|
7
|
+
import { MockLayoutProvider } from '@oanda/labs-widget-common';
|
|
8
8
|
import { Main } from '../src/OrderBookWidget/Main';
|
|
9
9
|
import { getOrderPositionBooks } from '../src/gql/getOrderPositionBooks';
|
|
10
10
|
import { BookType, Division } from '../src/gql/types/graphql';
|
|
@@ -67,9 +67,9 @@ describe('Main component', () => {
|
|
|
67
67
|
it('should render tool component', async () => {
|
|
68
68
|
const { findByTestId } = render(
|
|
69
69
|
<MockedProvider mocks={mocks}>
|
|
70
|
-
<
|
|
70
|
+
<MockLayoutProvider>
|
|
71
71
|
<Main division={Division.Oc} />
|
|
72
|
-
</
|
|
72
|
+
</MockLayoutProvider>
|
|
73
73
|
</MockedProvider>,
|
|
74
74
|
);
|
|
75
75
|
|
|
@@ -81,9 +81,9 @@ describe('Main component', () => {
|
|
|
81
81
|
it('should render widget component', async () => {
|
|
82
82
|
const { findByTestId, queryAllByTestId } = render(
|
|
83
83
|
<MockedProvider mocks={mocks}>
|
|
84
|
-
<
|
|
84
|
+
<MockLayoutProvider>
|
|
85
85
|
<Main division={Division.Oc} instrument={InstrumentId.EUR_AUD} />
|
|
86
|
-
</
|
|
86
|
+
</MockLayoutProvider>
|
|
87
87
|
</MockedProvider>,
|
|
88
88
|
);
|
|
89
89
|
|