Skip to content

Commit

Permalink
Merge pull request #46 from CharlesCNorton/patch-2
Browse files Browse the repository at this point in the history
feat: Додати кольорове кодування до оцінки активності
  • Loading branch information
opengs authored Sep 6, 2024
2 parents 9a825b8 + c4dd28f commit 4536447
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/pages/dashboard/ActivenessScoreComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,26 @@
<div class="text-caption text-uppercase text-bold text-grey">
{{ $t("dashboard.activeness.score") }}
</div>
<div class="text-subtitle1 text-bold">{{ score }}</div>
<div :class="['text-subtitle1', 'text-bold', scoreColorClass]">{{ score }}</div>
</div>
</q-card>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
import { onMounted, ref, computed } from 'vue';
const score = ref(0);
const scoreColorClass = computed(() => {
if (score.value > 75) {
return 'text-green';
} else if (score.value > 50) {
return 'text-yellow';
} else {
return 'text-red';
}
});
async function loadActivenessScore() {
const response = await window.activenessAPI.getMyStats();
score.value = response.score;
Expand Down

0 comments on commit 4536447

Please sign in to comment.