Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sharknoon committed Nov 25, 2024
1 parent 89bdb00 commit 706fa4d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions components/informations/ProjectProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ const { status, data } = await useLazyFetch<Progress>("/api/v1/progress");
const currentMouseOver = ref<number>();
const tileProgress = computed(() =>
[
const tileProgress = computed(() => {
const progress = [
{
classes: "bg-success text-bg-success",
styles: "border-radius: 50rem 0 0 50rem;",
styles: "",
text: "finished",
progress: data?.value?.finished.length ?? 0,
},
Expand All @@ -105,18 +105,24 @@ const tileProgress = computed(() =>
},
{
classes: "bg-warning text-bg-warning",
styles: "border-radius: 0 50rem 50rem 0;",
styles: "",
text: "available-in-stock",
progress: data?.value?.availableInStock.length ?? 0,
},
{
classes: "bg-info text-bg-info",
styles: "border-radius: 0 50rem 50rem 0;",
styles: "",
text: "available-out-of-stock",
progress: data?.value?.availableOutOfStock.length ?? 0,
},
].filter((p) => p.progress > 0),
);
].filter((p) => p.progress > 0);
// Add border radius to first and last element
if (progress.length > 0) {
progress[0].styles = "border-radius: 50rem 0 0 50rem;";
progress[progress.length - 1].styles = "border-radius: 0 50rem 50rem 0;";
}
return progress;
});
</script>
<style scoped>
.v-enter-active,
Expand Down

0 comments on commit 706fa4d

Please sign in to comment.