@mundogamernetwork/shared-ui 1.3.6 → 1.3.7
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/locales/de.json +2 -0
- package/locales/en.json +2 -0
- package/locales/pt-BR.json +2 -0
- package/locales/ro.json +2 -0
- package/package.json +1 -1
- package/pages/key-campaigns/index.vue +41 -8
package/locales/de.json
CHANGED
package/locales/en.json
CHANGED
package/locales/pt-BR.json
CHANGED
package/locales/ro.json
CHANGED
package/package.json
CHANGED
|
@@ -75,14 +75,24 @@
|
|
|
75
75
|
</template>
|
|
76
76
|
</div>
|
|
77
77
|
<div class="bar">
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
</
|
|
78
|
+
<select
|
|
79
|
+
class="platform-select sort-mode-select"
|
|
80
|
+
:value="sortMode"
|
|
81
|
+
@change="setSortMode(($event.target as HTMLSelectElement).value as 'recent' | 'popular')"
|
|
82
|
+
>
|
|
83
|
+
<option value="recent">{{ $t("keys.campaigns.sort_recent") }}</option>
|
|
84
|
+
<option value="popular">{{ $t("keys.campaigns.sort_popular") }}</option>
|
|
85
|
+
</select>
|
|
86
|
+
<div class="search-box">
|
|
87
|
+
<input
|
|
88
|
+
type="text"
|
|
89
|
+
v-model="searchTerm"
|
|
90
|
+
:placeholder="$t('keys.campaigns.search_placeholder')"
|
|
91
|
+
/>
|
|
92
|
+
<button type="button">
|
|
93
|
+
<MGIcon icon="search" />
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
86
96
|
</div>
|
|
87
97
|
</div>
|
|
88
98
|
|
|
@@ -405,6 +415,7 @@ const platformList = ref<Array<{ id: number; name: string; slug: string }>>([])
|
|
|
405
415
|
const activeFilter = ref<number | null>(null)
|
|
406
416
|
const activePlatformFilter = ref<number | null>(null)
|
|
407
417
|
const redeemedStatusFilter = ref<number | null>(null)
|
|
418
|
+
const sortMode = ref<"recent" | "popular">("recent")
|
|
408
419
|
|
|
409
420
|
// ------------------------------------------------------------------
|
|
410
421
|
// Data
|
|
@@ -545,6 +556,7 @@ async function loadCampaigns(page = 1) {
|
|
|
545
556
|
per_page: perPage.value,
|
|
546
557
|
sort: "id",
|
|
547
558
|
order: "desc",
|
|
559
|
+
sort_mode: sortMode.value,
|
|
548
560
|
}
|
|
549
561
|
|
|
550
562
|
if (activeFilter.value !== null) params["filter[type_id]"] = activeFilter.value
|
|
@@ -685,6 +697,14 @@ function setPlatformFilter(platformId: number | null) {
|
|
|
685
697
|
loadCampaigns(1)
|
|
686
698
|
}
|
|
687
699
|
|
|
700
|
+
function setSortMode(mode: "recent" | "popular") {
|
|
701
|
+
if (sortMode.value === mode) return
|
|
702
|
+
sortMode.value = mode
|
|
703
|
+
currentPage.value = 1
|
|
704
|
+
hasMoreItems.value = true
|
|
705
|
+
loadCampaigns(1)
|
|
706
|
+
}
|
|
707
|
+
|
|
688
708
|
const loadMoreItems = async () => {
|
|
689
709
|
if (!hasMoreItems.value || loading.value || loadingMore.value) return
|
|
690
710
|
await loadCampaigns(currentPage.value + 1)
|
|
@@ -1095,6 +1115,18 @@ onUnmounted(() => {
|
|
|
1095
1115
|
}
|
|
1096
1116
|
|
|
1097
1117
|
.bar {
|
|
1118
|
+
position: relative;
|
|
1119
|
+
display: flex;
|
|
1120
|
+
align-items: center;
|
|
1121
|
+
gap: 8px;
|
|
1122
|
+
|
|
1123
|
+
.sort-mode-select {
|
|
1124
|
+
flex-shrink: 0;
|
|
1125
|
+
height: 44px;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
.search-box {
|
|
1098
1130
|
position: relative;
|
|
1099
1131
|
display: flex;
|
|
1100
1132
|
width: 339px;
|
|
@@ -1273,6 +1305,7 @@ onUnmounted(() => {
|
|
|
1273
1305
|
flex-direction: column;
|
|
1274
1306
|
gap: 12px;
|
|
1275
1307
|
.bar { width: 100%; }
|
|
1308
|
+
.search-box { flex: 1; width: auto; }
|
|
1276
1309
|
}
|
|
1277
1310
|
.cards {
|
|
1278
1311
|
flex-direction: column;
|