Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions components/Blueprints/Category.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<template>
<div v-if="data && displayedData && displayedData.length > 0" class="flex w-full flex-col items-center justify-center">
<div v-if="data && filteredData && filteredData.length > 0" class="flex w-full flex-col items-center justify-center">
<h2 class="mt-4 text-2xl font-bold transition duration-500">{{ shipType }}s</h2>
<p class="transition duration-500">{{ data.filter((ship) => ship.type === shipType && ship.unlocked).length }}/{{ data.filter((ship) => ship.type === shipType).length }} unlocked</p>
<ClientOnly>
<p class="mb-4 transition duration-500">
{{ getTotalTP(displayedData).toLocaleString() }}
{{ getTotalTP(filteredData).toLocaleString() }}
total Tech Points
</p>
</ClientOnly>
<div class="flex flex-wrap items-stretch justify-center gap-3">
<LazyBlueprintsCard
v-for="ship in displayedData"
v-for="ship in filteredData"
:key="Symbol(ship.name + ship.variant)"
:ship="ship"
:mirror="ship.mirrorTechPoints"
:layout="currentLayout"
:variants="showVariants"
:all-variants="displayedData.filter((s) => ship.name === s.name)"
:all-variants="filteredData.filter((s) => ship.name === s.name)"
:tp="ship.techPoints"
:owner="isOwner"
@tp="(tp) => handleTp(ship, tp)"
Expand All @@ -40,6 +40,7 @@ const props = defineProps<{
const emit = defineEmits<{ modules: [BlueprintSuperCapitalShip] }>();

const userStore = useUserStore();
const filteredData = computed(() => props.displayedData?.filter((ship) => ship.type === props.shipType));

function handleTp(targetShip: BlueprintAllShip, tp: number) {
if (!props.data) return;
Expand Down
2 changes: 1 addition & 1 deletion pages/modules/blueprint-tracker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
:current-layout="currentLayout"
:show-variants="showVariants"
:data="data"
:displayed-data="displayedData.filter((ship) => ship.type === type)"
:displayed-data="displayedData"
@modules="(ship) => (currentShip = ship)"
/>
</div>
Expand Down