Skip to content

Commit

Permalink
fix: make "Adopt probe" button a link
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Dec 21, 2024
1 parent 19986ae commit 77e0d5c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
25 changes: 14 additions & 11 deletions components/AddCredits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@
outlined
label="Adopt probe"
/>
<Button
v-else-if="step2Completed"
size="small"
severity="secondary"
outlined
label="Adopt probe"
class="text-primary !opacity-100"
@click="$emit('adopt-a-probe')"
/>
<Button v-else size="small" label="Adopt probe" @click="$emit('adopt-a-probe')"/>

<NuxtLink v-else-if="step2Completed" to="/probes">
<Button
size="small"
severity="secondary"
outlined
label="Adopt probe"
class="text-primary !opacity-100"
/>
</NuxtLink>
<NuxtLink v-else to="/probes">
<Button size="small" label="Adopt probe"/>
</NuxtLink>
</div>
</div>
</div>
Expand Down Expand Up @@ -156,7 +159,7 @@
const auth = useAuth();
const user = auth.getUser as User;
defineEmits([ 'cancel', 'adopt-a-probe' ]);
defineEmits([ 'cancel' ]);
const { data: adoptionsExists } = await useAsyncData('gp_adopted_probes_exist', async () => {
const adoptions = await $directus.request(readItems('gp_adopted_probes', {
Expand Down
12 changes: 1 addition & 11 deletions pages/credits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,7 @@
content-class="!p-0"
class="w-[700px]"
>
<AddCredits @cancel="creditsDialog = false" @adopt-a-probe="adoptProbeDialog = true"/>
</GPDialog>

<GPDialog
v-model:visible="adoptProbeDialog"
header="Adopt a probe"
content-class="!p-0"
>
<AdoptProbe @cancel="adoptProbeDialog = false" @adopted="refreshNuxtData"/>
<AddCredits @cancel="creditsDialog = false"/>
</GPDialog>
</div>
</template>
Expand Down Expand Up @@ -203,6 +195,4 @@
// CREDITS DIALOG
const creditsDialog = ref(false);
const adoptProbeDialog = ref(false);
</script>
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
class="w-[700px]"
@after-hide="afterCreditsHide"
>
<AddCredits @cancel="creditsDialog = false" @adopt-a-probe="adoptProbeDialog = true"/>
<AddCredits @cancel="creditsDialog = false"/>
</GPDialog>
</div>
</template>
Expand Down

0 comments on commit 77e0d5c

Please sign in to comment.