Skip to content

Commit

Permalink
if deck member, show 'View' button instead of 'Preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
jxjj committed Jan 23, 2025
1 parent 5fd7e67 commit 84b95f2
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions resources/client/pages/CommunityDecks/CommunityDecksIndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,26 @@
<h3 class="text-lg font-bold">{{ deck.name }}</h3>
<p class="text-sm text-stone-400 mb-4">{{ deck.description }}</p>

<div class="flex gap-2 justify-end">
<div v-if="deck.current_user_role" class="flex gap-2 justify-end">
<Button asChild variant="secondary">
<RouterLink
:to="{
name: 'decks.show',
params: { deckId: deck.id },
}"
class="btn btn-primary"
>View</RouterLink
>
</Button>
<Button
v-if="deck.capabilities.canLeave"
@click="leaveDeck(deck.id)"
variant="destructive"
>Leave</Button
>
</div>

<div v-else class="flex gap-2 justify-end">
<Button asChild variant="secondary">
<RouterLink
:to="{
Expand All @@ -34,12 +53,6 @@
@click="joinDeck(deck.id)"
>Join</Button
>
<Button
v-else-if="deck.capabilities.canLeave"
@click="leaveDeck(deck.id)"
variant="destructive"
>Leave</Button
>
</div>
</article>
</li>
Expand Down

0 comments on commit 84b95f2

Please sign in to comment.