mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
adjust Location component to optionally enable context menu
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<ContextMenu>
|
||||
<ContextMenuTrigger as-child>
|
||||
<component :is="enableContextMenu ? ContextMenu : Passthrough">
|
||||
<component :is="enableContextMenu ? ContextMenuTrigger : Passthrough" as-child>
|
||||
<div class="cursor-pointer">
|
||||
<div v-if="!text" class="text-transparent">-</div>
|
||||
<div v-show="text" class="flex items-center">
|
||||
@@ -39,8 +39,8 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</ContextMenuTrigger>
|
||||
<ContextMenuContent v-if="parsedLocation.isRealInstance && parsedLocation.worldId">
|
||||
</component>
|
||||
<ContextMenuContent v-if="enableContextMenu && parsedLocation.isRealInstance && parsedLocation.worldId">
|
||||
<WorldActionMenuItems
|
||||
:can-open-instance-in-game="canOpenInstanceInGame"
|
||||
:show-share="true"
|
||||
@@ -51,7 +51,7 @@
|
||||
@self-invite="handleNewInstanceSelfInvite"
|
||||
@show-previous-instances="handleShowPreviousInstances" />
|
||||
</ContextMenuContent>
|
||||
</ContextMenu>
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -83,6 +83,8 @@
|
||||
import WorldActionMenuItems from './WorldActionMenuItems.vue';
|
||||
import { accessTypeLocaleKeyMap } from '../shared/constants';
|
||||
|
||||
const Passthrough = (_, { slots }) => slots.default?.();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const { cachedWorlds } = useWorldStore();
|
||||
@@ -115,6 +117,10 @@
|
||||
isOpenPreviousInstanceInfoDialog: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
enableContextMenu: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
:location="item.location"
|
||||
:hint="item.worldName"
|
||||
:grouphint="item.groupName"
|
||||
enable-context-menu
|
||||
disable-tooltip />
|
||||
</template>
|
||||
<template v-else-if="item.type === 'Online'">
|
||||
@@ -73,6 +74,7 @@
|
||||
:location="item.location"
|
||||
:hint="item.worldName"
|
||||
:grouphint="item.groupName"
|
||||
enable-context-menu
|
||||
disable-tooltip />
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
:location="item.location"
|
||||
:hint="item.worldName"
|
||||
:grouphint="item.groupName"
|
||||
enable-context-menu
|
||||
disable-tooltip />
|
||||
</template>
|
||||
<template v-else-if="item.type === 'OnPlayerJoined'">
|
||||
@@ -104,6 +105,7 @@
|
||||
class="inline [&>div]:inline-flex"
|
||||
:location="item.location"
|
||||
:hint="item.worldName"
|
||||
enable-context-menu
|
||||
disable-tooltip />
|
||||
<span v-else class="text-muted-foreground">{{ item.worldName || '' }}</span>
|
||||
</template>
|
||||
|
||||
@@ -42,6 +42,7 @@ const expandedRow = ({ row }) => {
|
||||
<Location
|
||||
location={original.previousLocation}
|
||||
class="inline-block"
|
||||
enableContextMenu
|
||||
/>
|
||||
<Badge variant="secondary" class="ml-1 w-fit">
|
||||
{timeToText(original.time)}
|
||||
@@ -57,6 +58,7 @@ const expandedRow = ({ row }) => {
|
||||
location={original.location}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -70,6 +72,7 @@ const expandedRow = ({ row }) => {
|
||||
location={original.location}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
/>
|
||||
<Badge variant="secondary" class="ml-1 w-fit">
|
||||
{timeToText(original.time)}
|
||||
@@ -85,6 +88,7 @@ const expandedRow = ({ row }) => {
|
||||
location={original.location}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
/>
|
||||
</div>
|
||||
) : null;
|
||||
@@ -323,6 +327,7 @@ export const columns = [
|
||||
location={original.location}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
disableTooltip
|
||||
/>
|
||||
</div>
|
||||
@@ -336,6 +341,7 @@ export const columns = [
|
||||
location={original.location}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
disableTooltip
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
class="friend-card__location flex w-full overflow-hidden leading-[1.3] wrap-break-word text-center"
|
||||
:location="friend.ref?.location"
|
||||
:traveling="friend.ref?.travelingToLocation"
|
||||
enable-context-menu
|
||||
link />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -137,6 +137,7 @@ export const createColumns = ({ getCreatedAt, onDelete, onDeletePrompt }) => {
|
||||
location={original.location}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -149,6 +150,7 @@ export const createColumns = ({ getCreatedAt, onDelete, onDeletePrompt }) => {
|
||||
location={original.instanceId}
|
||||
hint={original.worldName}
|
||||
grouphint={original.groupName}
|
||||
enableContextMenu
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user