File tree Expand file tree Collapse file tree 4 files changed +30
-14
lines changed Expand file tree Collapse file tree 4 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -129,14 +129,16 @@ const OrderFormSection: React.FC = () => {
129
129
/>
130
130
</ FormField >
131
131
< Options visible = { orderFormView . addlOptionsVisible } >
132
- < FormField label = { l ( 'durationLabel' ) } >
133
- < FormSelect
134
- label = { l ( 'durationLabel' ) }
135
- value = { orderFormView . duration . toString ( ) }
136
- onChange = { v => orderFormView . setDuration ( parseInt ( v ) as LeaseDuration ) }
137
- options = { orderFormView . durationOptions }
138
- />
139
- </ FormField >
132
+ { orderFormView . durationVisible && (
133
+ < FormField label = { l ( 'durationLabel' ) } >
134
+ < FormSelect
135
+ label = { l ( 'durationLabel' ) }
136
+ value = { orderFormView . duration . toString ( ) }
137
+ onChange = { v => orderFormView . setDuration ( parseInt ( v ) as LeaseDuration ) }
138
+ options = { orderFormView . durationOptions }
139
+ />
140
+ </ FormField >
141
+ ) }
140
142
< FormField label = { l ( 'minChanSizeLabel' ) } error = { orderFormView . minChanSizeError } >
141
143
< FormInputNumber
142
144
label = { l ( 'minChanSizeLabel' ) }
Original file line number Diff line number Diff line change @@ -34,12 +34,16 @@ const BatchControls: React.FC = () => {
34
34
return (
35
35
< Wrapper >
36
36
< div >
37
- < Title > { l ( 'markets' ) } </ Title >
38
- < BadgeList
39
- options = { batchesView . marketOptions }
40
- value = { batchesView . selectedMarket }
41
- onChange = { batchesView . changeMarket }
42
- />
37
+ { batchesView . showMarketBadges && (
38
+ < >
39
+ < Title > { l ( 'markets' ) } </ Title >
40
+ < BadgeList
41
+ options = { batchesView . marketOptions }
42
+ value = { batchesView . selectedMarket }
43
+ onChange = { batchesView . changeMarket }
44
+ />
45
+ </ >
46
+ ) }
43
47
</ div >
44
48
< ViewMode >
45
49
< BarChart size = "large" onClick = { handleViewChart } />
Original file line number Diff line number Diff line change @@ -88,6 +88,11 @@ export default class BatchesView {
88
88
} ) ) ;
89
89
}
90
90
91
+ /** determines if the market badges should be visible above the chart */
92
+ get showMarketBadges ( ) {
93
+ return this . _store . batchStore . leaseDurations . size > 1 ;
94
+ }
95
+
91
96
//
92
97
// Actions
93
98
//
Original file line number Diff line number Diff line change @@ -95,6 +95,11 @@ export default class OrderFormView {
95
95
return [ current , ...durations ] ;
96
96
}
97
97
98
+ /** determines if the lease duration field should be visible */
99
+ get durationVisible ( ) {
100
+ return this . _store . batchStore . leaseDurations . size > 1 ;
101
+ }
102
+
98
103
/** the chosen duration or the value selected in the batch store */
99
104
get derivedDuration ( ) {
100
105
return this . duration || this . _store . batchStore . selectedLeaseDuration ;
You can’t perform that action at this time.
0 commit comments