lfqian commited on
Commit
29b7ad4
·
1 Parent(s): 1d1ea93

Align asset tabs to left and match LiveView asset order (BTC, ETH, BMRN, TSLA)

Browse files
Files changed (1) hide show
  1. src/components/AssetsFilter.vue +14 -3
src/components/AssetsFilter.vue CHANGED
@@ -24,7 +24,18 @@ export default {
24
  emits: ['update:modelValue'],
25
  computed: {
26
  availableAssets() {
27
- return this.assetOptions.sort((a, b) => a.label.localeCompare(b.label)) || []
 
 
 
 
 
 
 
 
 
 
 
28
  },
29
  selectedAsset() {
30
  const selected = this.modelValue || []
@@ -68,9 +79,9 @@ export default {
68
  }
69
 
70
  .assets-filter-toolbar {
71
- padding: 1rem;
72
  display: flex;
73
- justify-content: center;
74
  align-items: center;
75
  }
76
 
 
24
  emits: ['update:modelValue'],
25
  computed: {
26
  availableAssets() {
27
+ // Keep the same order as LiveView: BTC, ETH, BMRN, TSLA
28
+ const order = ['BTC', 'ETH', 'BMRN', 'TSLA']
29
+ const sorted = [...(this.assetOptions || [])]
30
+ sorted.sort((a, b) => {
31
+ const indexA = order.indexOf(a.value)
32
+ const indexB = order.indexOf(b.value)
33
+ if (indexA === -1 && indexB === -1) return a.label.localeCompare(b.label)
34
+ if (indexA === -1) return 1
35
+ if (indexB === -1) return -1
36
+ return indexA - indexB
37
+ })
38
+ return sorted
39
  },
40
  selectedAsset() {
41
  const selected = this.modelValue || []
 
79
  }
80
 
81
  .assets-filter-toolbar {
82
+ padding: 1rem 1rem 0.5rem 1rem;
83
  display: flex;
84
+ justify-content: flex-start;
85
  align-items: center;
86
  }
87