Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Use Typescript for Badge component #130

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 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
18 changes: 6 additions & 12 deletions lib/components/base/Badge.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span :class="'version-badge ' + color + ' type--' + type">
<span :class="['version-badge', color, `type--${type}`]">
<template v-if="color"> <span class="circle" /> {{ capitalizeString(type) }}</template>

<!-- User roles -->
Expand Down Expand Up @@ -74,7 +74,7 @@
</span>
</template>

<script setup>
<script setup lang="ts">
import {
ModrinthIcon,
ScaleIcon,
Expand Down Expand Up @@ -172,16 +172,10 @@ const messages = defineMessages({
})
const { formatMessage } = useVIntl()

defineProps({
type: {
type: String,
required: true,
},
color: {
type: String,
default: '',
},
})
defineProps<{
type: string | (string & Record<never, never>)
color?: string
}>()
</script>
<style lang="scss" scoped>
.version-badge {
Expand Down