|
1 | 1 | <script lang="ts" setup> |
2 | | -import { Status, StatusType } from '@injectivelabs/utils' |
3 | | -import { PointsPeriod } from '@/types' |
4 | | -
|
5 | | -const { $onError } = useNuxtApp() |
6 | | -const pointsStore = usePointsStore() |
7 | | -const sharedWalletStore = useSharedWalletStore() |
8 | | -
|
9 | | -const selectedPeriod = ref(PointsPeriod.Day) |
10 | | -const status = reactive(new Status(StatusType.Loading)) |
11 | | -const fetchStatus = reactive(new Status(StatusType.Idle)) |
12 | | -
|
13 | | -function fetchAccountPoints() { |
14 | | - fetchStatus.setLoading() |
15 | | -
|
16 | | - const action = |
17 | | - selectedPeriod.value === PointsPeriod.Day |
18 | | - ? pointsStore.fetchAccountDailyPoints |
19 | | - : pointsStore.fetchAccountWeeklyPoints |
20 | | -
|
21 | | - action() |
22 | | - .catch($onError) |
23 | | - .finally(() => fetchStatus.setIdle()) |
24 | | -} |
25 | | -
|
26 | | -onWalletConnected(() => { |
27 | | - status.setLoading() |
28 | | -
|
29 | | - Promise.all([ |
30 | | - pointsStore.fetchAccountPointsStat(), |
31 | | - pointsStore.fetchAccountDailyPoints() |
32 | | - ]) |
33 | | - .catch($onError) |
34 | | - .finally(() => status.setIdle()) |
35 | | -}) |
36 | | -
|
37 | | -useIntervalFn(() => { |
38 | | - if (!sharedWalletStore.isUserConnected) { |
39 | | - return |
40 | | - } |
41 | | -
|
42 | | - return Promise.all([ |
43 | | - pointsStore.fetchAccountPointsStat(), |
44 | | - selectedPeriod.value === PointsPeriod.Day |
45 | | - ? pointsStore.fetchAccountDailyPoints() |
46 | | - : pointsStore.fetchAccountWeeklyPoints() |
47 | | - ]) |
48 | | -}, 60 * 1000) |
| 2 | +// Points disabled in this build. |
49 | 3 | </script> |
50 | 4 |
|
51 | 5 | <template> |
52 | | - <div |
53 | | - class="pt-12 pb-32 px-40 max-xs:pt-8 max-xs:px-4 max-xs:pb-16 max-xl:pt-12 max-xl:px-12 max-xl:pb-24 max-3xl:px-40 max-w-[1400px] 5xl:max-w-[90%] mx-auto" |
54 | | - > |
55 | | - <div class="flex flex-col gap-4 max-xs:gap-1"> |
56 | | - <h1 class="text-3xl max-xs:text-2xl">{{ $t('points.title') }}</h1> |
57 | | - <p class="text-base tracking-wide max-xs:text-sm"> |
58 | | - {{ $t('points.description') }} |
59 | | - </p> |
60 | | - </div> |
61 | | - |
62 | | - <PartialsPointsStats /> |
63 | | - |
64 | | - <div class="flex gap-6 max-lg:flex-col max-lg:items-center"> |
65 | | - <USkeleton |
66 | | - v-if="fetchStatus.isLoading()" |
67 | | - class="flex-1 w-full max-lg:basis-52" |
68 | | - /> |
69 | | - <PartialsPointsTable |
70 | | - v-else |
71 | | - v-model="selectedPeriod" |
72 | | - v-bind="{ |
73 | | - isDailyPeriod: selectedPeriod === PointsPeriod.Day |
74 | | - }" |
75 | | - @update:model-value="fetchAccountPoints" |
76 | | - /> |
77 | | - |
78 | | - <PartialsPointsScoreCard /> |
| 6 | + <UContainer class="py-16"> |
| 7 | + <div class="text-center py-24"> |
| 8 | + <h1 class="text-4xl lg:text-6xl font-bold">Points Unavailable</h1> |
| 9 | + <p class="text-lg mt-4">This feature is not available in this build.</p> |
79 | 10 | </div> |
80 | | - </div> |
| 11 | + </UContainer> |
81 | 12 | </template> |
0 commit comments