61
61
active-hover-color =" transparent"
62
62
>
63
63
<app-sidebar-item-content
64
+ v-if =" false"
64
65
v-button
65
66
icon =" star-16"
66
67
title =" Vote on Survey!"
97
98
</template >
98
99
99
100
<script lang="ts">
100
- import Theme from ' @soramitsu/soramitsu-js-ui /lib/types/Theme' ;
101
+ import Theme from ' @soramitsu-ui/ui-vue2 /lib/types/Theme' ;
101
102
import { Component , Mixins , Prop } from ' vue-property-decorator' ;
102
103
103
104
import TranslationMixin from ' @/components/mixins/TranslationMixin' ;
@@ -113,7 +114,7 @@ import {
113
114
FaucetLink ,
114
115
} from ' @/consts' ;
115
116
import { StakingPageNames } from ' @/modules/staking/consts' ;
116
- import { getter , state } from ' @/store/decorators' ;
117
+ import { getter , mutation , state } from ' @/store/decorators' ;
117
118
118
119
import AppInfoPopper from ' ./AppInfoPopper.vue' ;
119
120
import AppSidebarItemContent from ' ./SidebarItemContent.vue' ;
@@ -131,11 +132,14 @@ export default class AppMenu extends Mixins(TranslationMixin) {
131
132
132
133
@state .settings .faucetUrl faucetUrl! : string ;
133
134
@state .router .loading pageLoading! : boolean ;
135
+ @state .settings .menuCollapsed collapsed! : boolean ;
136
+
137
+ @getter .settings .orderBookEnabled private orderBookEnabled! : boolean ;
134
138
@getter .libraryTheme private libraryTheme! : Theme ;
135
139
136
- readonly FaucetLink = FaucetLink ;
140
+ @ mutation . settings . setMenuCollapsed private setMenuCollapsed ! : ( collapsed : boolean ) => void ;
137
141
138
- collapsed = false ;
142
+ readonly FaucetLink = FaucetLink ;
139
143
140
144
get collapseIcon(): string {
141
145
return this .collapsed ? ' arrows-chevron-right-24' : ' arrows-chevron-left-24' ;
@@ -150,6 +154,9 @@ export default class AppMenu extends Mixins(TranslationMixin) {
150
154
}
151
155
152
156
get sidebarMenuItems(): Array <SidebarMenuItemLink > {
157
+ if (! this .orderBookEnabled ) {
158
+ return SidebarMenuGroups .filter (({ title }) => title !== PageNames .OrderBook );
159
+ }
153
160
return SidebarMenuGroups ;
154
161
}
155
162
@@ -183,8 +190,8 @@ export default class AppMenu extends Mixins(TranslationMixin) {
183
190
}
184
191
185
192
collapseMenu(e ? : PointerEvent ) {
186
- ((e ?.target as HTMLElement ) .closest (' #collapse-button' ) as HTMLElement ) .blur ();
187
- this .collapsed = ! this .collapsed ;
193
+ ((e ?.target as HTMLElement | null )? .closest ?. (' #collapse-button' ) as HTMLElement | null )? .blur ();
194
+ this .setMenuCollapsed ( ! this .collapsed ) ;
188
195
}
189
196
}
190
197
</script >
@@ -204,6 +211,10 @@ export default class AppMenu extends Mixins(TranslationMixin) {
204
211
}
205
212
}
206
213
214
+ .collapse-button {
215
+ pointer-events : none ;
216
+ }
217
+
207
218
& :hover ,
208
219
& :focus {
209
220
box-shadow : 20px 20px 60px 0px #0000001a ;
@@ -213,6 +224,10 @@ export default class AppMenu extends Mixins(TranslationMixin) {
213
224
display : initial ;
214
225
}
215
226
}
227
+
228
+ .collapse-button {
229
+ pointer-events : all ;
230
+ }
216
231
}
217
232
}
218
233
}
@@ -286,9 +301,6 @@ export default class AppMenu extends Mixins(TranslationMixin) {
286
301
& :focus {
287
302
background-color : unset !important ;
288
303
}
289
- i .el-icon-bank-card {
290
- width : 28px ; // to avoid issue with paddings
291
- }
292
304
}
293
305
}
294
306
</style >
@@ -346,6 +358,7 @@ export default class AppMenu extends Mixins(TranslationMixin) {
346
358
347
359
@include large-mobile (true) {
348
360
position : fixed ;
361
+ right : 0 ;
349
362
350
363
& .visible {
351
364
visibility : visible ;
@@ -368,10 +381,6 @@ export default class AppMenu extends Mixins(TranslationMixin) {
368
381
}
369
382
}
370
383
371
- @include large-mobile (true) {
372
- right : 0 ;
373
- }
374
-
375
384
@include large-mobile {
376
385
visibility : visible ;
377
386
position : relative ;
@@ -409,6 +418,8 @@ export default class AppMenu extends Mixins(TranslationMixin) {
409
418
flex : 1 ;
410
419
flex-flow : column nowrap ;
411
420
justify-content : space-between ;
421
+ max-width : $sidebar-max-width ;
422
+ padding-right : $inner-spacing-mini ; // for shadow
412
423
}
413
424
}
414
425
}
@@ -480,4 +491,3 @@ export default class AppMenu extends Mixins(TranslationMixin) {
480
491
}
481
492
}
482
493
</style >
483
- @/modules/staking/demeter/consts
0 commit comments