Skip to content

Commit

Permalink
feat: add v6 support tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Jan 9, 2024
1 parent a4891b8 commit f852a6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion resources/components/tag.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts"></script>

<template>
<div class="rounded-full bg-base4 px-2 py-0.2 text-sm font-content">
<div
class="flex items-center justify-center rounded-full bg-base4 px-2 py-0.2 text-sm font-content"
>
<slot />
</div>
</template>
10 changes: 8 additions & 2 deletions resources/pages/home/components/package_card.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue'
import { Link } from '@inertiajs/vue3'
import Tag from '@/components/tag.vue'
Expand All @@ -7,9 +8,11 @@ import PackageLogo from '@/components/package_logo.vue'
import PackageStats from '@/components/package_stats.vue'
import AdonisIcon from '@/components/icons/adonis_icon.vue'
defineProps<{
const props = defineProps<{
package: PackageInfo
}>()
const isV6Compatible = computed(() => props.package.compatibility?.adonis.includes('^6'))
</script>

<template>
Expand All @@ -19,7 +22,10 @@ defineProps<{
target="_blank"
>
<div class="w-full flex items-center justify-between">
<Tag data-testid="package-category">{{ package.category }}</Tag>
<div class="flex gap-2">
<Tag data-testid="package-category">{{ package.category }}</Tag>
<Tag v-if="isV6Compatible" class="bg-primary bg-opacity70">V6 support</Tag>
</div>
<i
class="i-icon-park-outline-share inline-block text-xs text-base10 opacity-0 transition duration-500 hover:text-white group-hover:opacity-100"
/>
Expand Down

0 comments on commit f852a6a

Please sign in to comment.