mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-29 11:43:48 +02:00
add DeprecationAlert component
This commit is contained in:
29
src/components/DeprecationAlert.vue
Normal file
29
src/components/DeprecationAlert.vue
Normal 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>
|
||||||
@@ -1019,6 +1019,9 @@
|
|||||||
@click="getUserFavoriteWorlds(userDialog.id)">
|
@click="getUserFavoriteWorlds(userDialog.id)">
|
||||||
</Button> -->
|
</Button> -->
|
||||||
<template v-if="userDialog.userFavoriteWorlds && userDialog.userFavoriteWorlds.length > 0">
|
<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
|
<TabsUnderline
|
||||||
v-model="favoriteWorldsTab"
|
v-model="favoriteWorldsTab"
|
||||||
:items="favoriteWorldTabs"
|
:items="favoriteWorldTabs"
|
||||||
@@ -1073,6 +1076,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #Avatars>
|
<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; justify-content: space-between">
|
||||||
<div style="display: flex; align-items: center">
|
<div style="display: flex; align-items: center">
|
||||||
<Button
|
<Button
|
||||||
@@ -1259,6 +1265,7 @@
|
|||||||
import { toast } from 'vue-sonner';
|
import { toast } from 'vue-sonner';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import DeprecationAlert from '@/components/DeprecationAlert.vue';
|
||||||
import VueJsonPretty from 'vue-json-pretty';
|
import VueJsonPretty from 'vue-json-pretty';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -1334,14 +1341,12 @@
|
|||||||
{ value: 'Info', label: t('dialog.user.info.header') },
|
{ value: 'Info', label: t('dialog.user.info.header') },
|
||||||
{ value: 'Groups', label: t('dialog.user.groups.header') },
|
{ value: 'Groups', label: t('dialog.user.groups.header') },
|
||||||
{ value: 'Worlds', label: t('dialog.user.worlds.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: 'Avatars', label: t('dialog.user.avatars.header') },
|
||||||
{ value: 'JSON', label: t('dialog.user.json.header') }
|
{ value: 'JSON', label: t('dialog.user.json.header') }
|
||||||
];
|
];
|
||||||
if (userDialog.value.id !== currentUser.value.id) {
|
if (userDialog.value.id !== currentUser.value.id && !currentUser.value.hasSharedConnectionsOptOut) {
|
||||||
if (!currentUser.value.hasSharedConnectionsOptOut) {
|
tabs.splice(1, 0, { value: 'mutual', label: t('dialog.user.mutual_friends.header') });
|
||||||
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') });
|
|
||||||
}
|
}
|
||||||
return tabs;
|
return tabs;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ export const alertVariants = cva(
|
|||||||
variant: {
|
variant: {
|
||||||
default: 'bg-card text-card-foreground',
|
default: 'bg-card text-card-foreground',
|
||||||
destructive:
|
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: {
|
defaultVariants: {
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
"common": {
|
"common": {
|
||||||
"no_data": "No data",
|
"no_data": "No data",
|
||||||
"no_matching_records": "No matching records",
|
"no_matching_records": "No matching records",
|
||||||
|
"feature_relocated": {
|
||||||
|
"title": "Deprecation Notice",
|
||||||
|
"description": "This feature will be removed in a future update. Please use {feature} instead."
|
||||||
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"open": "Open",
|
"open": "Open",
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
|
|||||||
Reference in New Issue
Block a user