add DeprecationAlert component

This commit is contained in:
pa
2026-03-01 15:30:12 +09:00
parent 05bebed2c1
commit 18e3f48329
4 changed files with 46 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<template>
<Alert variant="warning" class="mb-4">
<MessageSquareWarning class="text-lg" />
<AlertTitle>{{ t('common.feature_relocated.title') }}</AlertTitle>
<AlertDescription>
<i18n-t keypath="common.feature_relocated.description" tag="span">
<template #feature>
<strong>{{ featureName }}</strong>
</template>
</i18n-t>
</AlertDescription>
</Alert>
</template>
<script setup>
import { MessageSquareWarning } from 'lucide-vue-next';
import { useI18n } from 'vue-i18n';
import { Alert, AlertDescription, AlertTitle } from './ui/alert';
const { t } = useI18n();
defineProps({
featureName: {
type: String,
required: true
}
});
</script>

View File

@@ -1019,6 +1019,9 @@
@click="getUserFavoriteWorlds(userDialog.id)">
</Button> -->
<template v-if="userDialog.userFavoriteWorlds && userDialog.userFavoriteWorlds.length > 0">
<DeprecationAlert
v-if="userDialog.ref.id === currentUser.id"
:feature-name="t('nav_tooltip.favorite_worlds')" />
<TabsUnderline
v-model="favoriteWorldsTab"
:items="favoriteWorldTabs"
@@ -1073,6 +1076,9 @@
</template>
<template #Avatars>
<DeprecationAlert
v-if="userDialog.ref.id === currentUser.id"
:feature-name="t('nav_tooltip.my_avatars')" />
<div style="display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center">
<Button
@@ -1259,6 +1265,7 @@
import { toast } from 'vue-sonner';
import { useI18n } from 'vue-i18n';
import DeprecationAlert from '@/components/DeprecationAlert.vue';
import VueJsonPretty from 'vue-json-pretty';
import {
@@ -1334,14 +1341,12 @@
{ value: 'Info', label: t('dialog.user.info.header') },
{ value: 'Groups', label: t('dialog.user.groups.header') },
{ value: 'Worlds', label: t('dialog.user.worlds.header') },
{ value: 'favorite-worlds', label: t('dialog.user.favorite_worlds.header') },
{ value: 'Avatars', label: t('dialog.user.avatars.header') },
{ value: 'JSON', label: t('dialog.user.json.header') }
];
if (userDialog.value.id !== currentUser.value.id) {
if (!currentUser.value.hasSharedConnectionsOptOut) {
tabs.splice(1, 0, { value: 'mutual', label: t('dialog.user.mutual_friends.header') });
}
tabs.splice(3, 0, { value: 'favorite-worlds', label: t('dialog.user.favorite_worlds.header') });
if (userDialog.value.id !== currentUser.value.id && !currentUser.value.hasSharedConnectionsOptOut) {
tabs.splice(1, 0, { value: 'mutual', label: t('dialog.user.mutual_friends.header') });
}
return tabs;
});

View File

@@ -11,7 +11,9 @@ export const alertVariants = cva(
variant: {
default: 'bg-card text-card-foreground',
destructive:
'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90'
'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',
warning:
'border-amber-500/50 text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/30 [&>svg]:text-current *:data-[slot=alert-description]:text-amber-600/90 dark:*:data-[slot=alert-description]:text-amber-400/90'
}
},
defaultVariants: {