chore: market build app
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { computed, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useMarketStore } from "../stores/market";
|
||||
|
||||
@@ -10,6 +10,7 @@ defineEmits<{
|
||||
const marketStore = useMarketStore();
|
||||
const { userBets } = storeToRefs(marketStore);
|
||||
const loading = computed(() => marketStore.isLoading);
|
||||
const isWonBetsExpanded = ref(false);
|
||||
|
||||
const totalBetAmount = computed(() => {
|
||||
return userBets.value.reduce((sum, bet) => sum + bet.amount, 0);
|
||||
@@ -116,11 +117,12 @@ const totalWinnings = computed(() => {
|
||||
|
||||
<!-- Winning Bets -->
|
||||
<div v-if="winningBets.length > 0">
|
||||
<h3 class="text-xl font-bold mb-4 flex items-center gap-2">
|
||||
<button @click="isWonBetsExpanded = !isWonBetsExpanded" class="text-xl font-bold mb-4 flex items-center gap-2 cursor-pointer hover:opacity-70 transition-opacity">
|
||||
<i :class="['mdi', isWonBetsExpanded ? 'mdi-chevron-down' : 'mdi-chevron-right']"></i>
|
||||
<i class="mdi mdi-check-circle text-success"></i>
|
||||
Won Bets ({{ winningBets.length }})
|
||||
</h3>
|
||||
<div class="space-y-4">
|
||||
</button>
|
||||
<div v-if="isWonBetsExpanded" class="space-y-4">
|
||||
<div
|
||||
v-for="bet in winningBets"
|
||||
:key="bet.uuid"
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import type { ObjectivResultOut, LeaderboardEntryOut } from '@/api/types.gen'
|
||||
|
||||
export interface Objective {
|
||||
objectiv_id: string
|
||||
display_string: string
|
||||
first_seen_at: string | null
|
||||
count: number
|
||||
max_count: number
|
||||
seed: string | null
|
||||
points_per_objectiv: number
|
||||
total_points: number
|
||||
}
|
||||
export type Objective = ObjectivResultOut
|
||||
|
||||
interface UserInfo {
|
||||
username: string
|
||||
@@ -21,15 +13,6 @@ interface UserInfo {
|
||||
isStaff: boolean
|
||||
}
|
||||
|
||||
interface LeaderboardEntry {
|
||||
rank: number
|
||||
username: string
|
||||
total_score: number
|
||||
objectives_count: number
|
||||
deaths_count: number
|
||||
is_staff: boolean
|
||||
}
|
||||
|
||||
export const useNoitaStore = defineStore('noita', () => {
|
||||
// State
|
||||
const userInfo = ref<UserInfo>({
|
||||
@@ -41,7 +24,7 @@ export const useNoitaStore = defineStore('noita', () => {
|
||||
isStaff: false,
|
||||
})
|
||||
const objectives = ref<Objective[]>([])
|
||||
const leaderboard = ref<LeaderboardEntry[]>([])
|
||||
const leaderboard = ref<LeaderboardEntryOut[]>([])
|
||||
const isLoadingLeaderboard = ref(false)
|
||||
const isUploading = ref(false)
|
||||
const error = ref<string>('')
|
||||
|
||||
Reference in New Issue
Block a user