Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit f30610a

Browse files
committed
new prop 'ChartMode' added to fix issue with chart type and granularity icons
1 parent 51b6d26 commit f30610a

File tree

2 files changed

+39
-79
lines changed

2 files changed

+39
-79
lines changed

src/botPage/view/Dialogs/Chart.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import {
22
SmartChart,
33
setSmartChartsPublicPath,
4-
ChartTypes,
54
StudyLegend,
65
Views,
7-
Timeperiod,
86
DrawTools,
97
Share,
10-
CrosshairToggle,
11-
ChartSize,
8+
ChartMode,
129
} from 'smartcharts-beta';
1310
import React, { PureComponent } from 'react';
1411
import { translate } from '../../../common/i18n';
@@ -121,14 +118,14 @@ class ChartContent extends PureComponent {
121118

122119
renderControls = () => (
123120
<React.Fragment>
124-
<CrosshairToggle enabled={false} />
125-
<ChartTypes enabled={true} onChange={chartType => this.setState({ chartType })} />
126-
<Timeperiod enabled={true} onChange={granularity => this.setState({ granularity })} />
127-
<StudyLegend />
121+
<ChartMode
122+
onChartType={chartType => this.setState({ chartType })}
123+
onGranularity={granularity => this.setState({ granularity })}
124+
/>
125+
<StudyLegend searchInputClassName="data-hj-whitelist" />
128126
<DrawTools />
129-
<Views />
127+
<Views searchInputClassName="data-hj-whitelist" />
130128
<Share />
131-
<ChartSize />
132129
</React.Fragment>
133130
);
134131

@@ -151,19 +148,18 @@ class ChartContent extends PureComponent {
151148

152149
return (
153150
<SmartChart
154-
id={this.chartId}
151+
barriers={barriers}
152+
chartControlsWidgets={this.renderControls}
155153
chartType={this.state.chartType}
156154
granularity={this.state.granularity}
157-
symbol={this.state.symbol}
155+
id={this.chartId}
158156
isMobile={false}
159-
topWidgets={this.renderTopWidgets}
160-
chartControlsWidgets={this.renderControls}
161157
requestAPI={this.requestAPI.bind(this)}
162-
requestSubscribe={this.requestSubscribe.bind(this)}
163158
requestForget={this.requestForget.bind(this)}
164-
barriers={barriers}
159+
requestSubscribe={this.requestSubscribe.bind(this)}
165160
settings={this.settings}
166-
enabledNavigationWidget={false}
161+
symbol={this.state.symbol}
162+
topWidgets={this.renderTopWidgets}
167163
/>
168164
);
169165
}

static/css/_chart.scss

Lines changed: 26 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,28 @@
1-
// .smartcharts-mobile {
2-
// font-size: 10px;
1+
.cq-chart-control-bottom .cq-chart-controls .ciq-menu .cq-menu-dropdown.cq-menu-dropdown-enter-done, .cq-chart-control-bottom .cq-chart-controls .ciq-menu .cq-menu-dropdown.cq-menu-dropdown-enter-active {
2+
transform: translateX(-40%) translateY(0em);
3+
}
34

4-
// /*
5-
// chart controls should still
6-
// be visible when its dropdown shows up.
7-
// */
8-
// .ciq-period,
9-
// .cq-download,
10-
// .ciq-views,
11-
// .ciq-drawtools,
12-
// .ciq-studies,
13-
// .cq-chart-setting,
14-
// .ciq-draw-tools,
15-
// .cq-comparison-new,
16-
// .ciq-chart-types {
17-
// .cq-menu-overlay {
18-
// height: calc(100% - 40px);
19-
// }
20-
// }
5+
.ciq-list .ciq-list-item {
6+
font-size: 0.8em;
7+
}
218

22-
// .cq-modal-dropdown {
23-
// position: absolute !important;
24-
// }
25-
26-
// .drag-price > .price {
27-
// font-size: 10px;
28-
// padding: 1px 5px;
29-
// }
30-
31-
// .ic-icon > svg {
32-
// box-sizing: content-box !important;
33-
// }
34-
35-
// .cq-chart-controls {
36-
// .cq-menu-btn > .cq-toggle {
37-
// padding: 0.35em 0em !important;
38-
// }
39-
40-
// .cq-chart-size > :first-child {
41-
// margin-right: 2em !important;
42-
// }
43-
44-
// .ic-icon-with-sub {
45-
// &:hover .ic-subtitle {
46-
// visibility: visible;
47-
// }
48-
// .ic-subtitle {
49-
// visibility: hidden;
50-
// width: 60px;
51-
// color: #fff !important;
52-
// background: #15212d;
53-
// padding: 5px 0;
54-
// border-radius: 5px;
55-
// position: absolute;
56-
// z-index: 1;
57-
// bottom: 40px;
58-
// left: -15px;
59-
// display: block;
60-
// margin-bottom: 5px;
61-
// }
62-
// }
63-
// }
64-
// }
9+
.cq-categorical-display {
10+
.cq-item,
11+
.cq-active-item,
12+
.empty-category,
13+
.cq-filter,
14+
.cq-lookup-input>input,
15+
.category-title,
16+
.empty-category {
17+
font-size: 0.8em;
18+
}
19+
.category-title {
20+
font-weight: bold;
21+
}
22+
.empty-category {
23+
padding: 0 0.8em 0.8em;
24+
}
25+
.category.category-has-subtitle {
26+
padding-top: 4em
27+
}
28+
}

0 commit comments

Comments
 (0)