Skip to content

Commit fa52bff

Browse files
committed
fix:warning style changed and unintended chars erased
1 parent bfd9550 commit fa52bff

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

app/components/LicenseDisplay.vue

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
<script setup lang="ts">
2-
import { parseLicenseExpression } from '#shared/utils/spdx'
2+
import { parseLicenseExpression } from "#shared/utils/spdx";
33
4-
import { useLicenseChanges } from '~/composables/useLicenseChanges'
5-
import { useI18n } from 'vue-i18n'
4+
import { useLicenseChanges } from "~/composables/useLicenseChanges";
5+
import { useI18n } from "vue-i18n";
66
77
const props = defineProps<{
8-
license: string
9-
packageName?: string
10-
}>()
8+
license: string;
9+
packageName?: string;
10+
}>();
1111
12-
const { t } = useI18n()
12+
const { t } = useI18n();
1313
14-
const tokens = computed(() => parseLicenseExpression(props.license))
15-
const licenseChanges = useLicenseChanges(() => props.packageName)
14+
const tokens = computed(() => parseLicenseExpression(props.license));
15+
const licenseChanges = useLicenseChanges(() => props.packageName);
1616
17-
const changes = computed(() => licenseChanges.data.value?.changes ?? [])
17+
const changes = computed(() => licenseChanges.data.value?.changes ?? []);
1818
1919
const licenseChangeText = computed(() =>
2020
changes.value
21-
.map(item =>
22-
t('package.versions.license_change_item', {
21+
.map((item) =>
22+
t("package.versions.license_change_item", {
2323
from: item.from,
2424
to: item.to,
2525
version: item.version,
2626
}),
2727
)
28-
.join('; '),
29-
)
28+
.join("; "),
29+
);
3030
31-
const hasAnyValidLicense = computed(() => tokens.value.some(t => t.type === 'license' && t.url))
31+
const hasAnyValidLicense = computed(() =>
32+
tokens.value.some((t) => t.type === "license" && t.url),
33+
);
3234
</script>
3335

3436
<template>
@@ -42,19 +44,24 @@ const hasAnyValidLicense = computed(() => tokens.value.some(t => t.type === 'lic
4244
class="link-subtle"
4345
:title="$t('package.license.view_spdx')"
4446
>
45-
{{ token.value }}!!
47+
{{ token.value }}
4648
</a>
4749
<span v-else-if="token.type === 'license'">{{ token.value }}</span>
48-
<span v-else-if="token.type === 'operator'" class="text-4xs">{{ token.value }}</span>
50+
<span v-else-if="token.type === 'operator'" class="text-4xs">{{
51+
token.value
52+
}}</span>
4953
</template>
5054
<span
5155
v-if="hasAnyValidLicense"
5256
class="i-lucide:scale w-3.5 h-3.5 text-fg-subtle flex-shrink-0 self-center"
5357
aria-hidden="true"
5458
/>
5559
</span>
56-
<div v-if="changes.length > 0" class="text-red-500 flex justify-start items-center gap-x-1">
57-
<p>change!</p>
60+
<div
61+
v-if="changes.length > 0"
62+
class="border border-amber-600/40 bg-amber-500/10 rounded-lg inline-flex justify-start items-center mt-1 gap-x-1 py-[2px] px-[3px]"
63+
>
64+
<p class="text-md text-amber-800 dark:text-amber-400">changed</p>
5865
<TooltipApp interactive position="top">
5966
<span
6067
tabindex="0"

0 commit comments

Comments
 (0)