another update
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
|
||||
import { ContentMetadata } from "@/lib/omniRecommendation";
|
||||
import LazyLoadedImage from "./lazyLoadedImage";
|
||||
import { ContextMenu, ContextMenuContent, ContextMenuSeparator, ContextMenuTrigger } from "./ui/context-menu";
|
||||
import {
|
||||
ContextMenu,
|
||||
ContextMenuContent,
|
||||
ContextMenuSeparator,
|
||||
ContextMenuTrigger
|
||||
} from "./ui/context-menu";
|
||||
import { ContextMenuItem } from "@radix-ui/react-context-menu";
|
||||
import React from "react";
|
||||
|
||||
@@ -18,40 +23,76 @@ export const GameCard = React.memo(function GameCard({ game }: GameCardProps) {
|
||||
<div className="overflow-hidden">
|
||||
{game.primaryMediaAsset ? (
|
||||
<LazyLoadedImage
|
||||
imgId={'GameThumbnail_'+game.rootPlaceId.toString()}
|
||||
imgId={
|
||||
"GameThumbnail_" +
|
||||
game.rootPlaceId.toString()
|
||||
}
|
||||
alt={game.name}
|
||||
className="object-cover w-full h-full"
|
||||
className="object-fill w-full h-full"
|
||||
/>
|
||||
) : (
|
||||
<div className="w-full h-full flex items-center justify-center bg-muted">
|
||||
<span className="text-muted-foreground">{":("}</span>
|
||||
<span className="text-muted-foreground">
|
||||
{":("}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="bg-base flex right-2 bottom-2 absolute rounded-lg p-1 py-0">
|
||||
<div className="text-blue bg-base font-mono flex right-2 bottom-2 absolute rounded-lg px-2 py-1">
|
||||
{game.playerCount.toLocaleString()}
|
||||
</div>
|
||||
</div>
|
||||
</ContextMenuTrigger>
|
||||
<ContextMenuContent className="w-64 p-2 space-y-1">
|
||||
<ContextMenuItem disabled className="text-xs text-muted-foreground">
|
||||
<ContextMenuContent className="max-w-[512px] p-2 space-y-1">
|
||||
<ContextMenuItem
|
||||
disabled
|
||||
className="text-s font-bold text-muted-foreground"
|
||||
>
|
||||
{game.name}
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem disabled className="text-xs text-muted-foreground">
|
||||
{Math.round((game.totalUpVotes/(game.totalUpVotes+game.totalDownVotes))*100)}% rating - {game.playerCount.toLocaleString()} playing
|
||||
<ContextMenuItem
|
||||
disabled
|
||||
className="text-xs text-subtext0 text-muted-foreground"
|
||||
>
|
||||
{Math.round(
|
||||
(game.totalUpVotes /
|
||||
(game.totalUpVotes + game.totalDownVotes)) *
|
||||
100
|
||||
)}
|
||||
% rating - {game.playerCount.toLocaleString()} playing
|
||||
</ContextMenuItem>
|
||||
<ContextMenuSeparator/>
|
||||
<ContextMenuItem
|
||||
disabled
|
||||
className="pb-1 text-xs text-subtext0 text-muted-foreground"
|
||||
>
|
||||
{game.ageRecommendationDisplayName || ""}
|
||||
</ContextMenuItem>
|
||||
<ContextMenuSeparator />
|
||||
<ContextMenuItem>
|
||||
<a href={`https://roblox.com/games/${game.rootPlaceId}`}>Open URL</a>
|
||||
<a href={`https://roblox.com/games/${game.rootPlaceId}`}>
|
||||
Open URL
|
||||
</a>
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem onClick={()=>{window.location.href = (`roblox://placeId=${game.rootPlaceId}`)}}>
|
||||
<ContextMenuItem
|
||||
onClick={() => {
|
||||
window.location.href = `roblox://placeId=${game.rootPlaceId}`;
|
||||
}}
|
||||
>
|
||||
Play
|
||||
</ContextMenuItem>
|
||||
<ContextMenuSeparator/>
|
||||
<ContextMenuItem onClick={()=>{navigator.clipboard.writeText(`${game.rootPlaceId}`)}}>
|
||||
<ContextMenuSeparator />
|
||||
<ContextMenuItem
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(`${game.rootPlaceId}`);
|
||||
}}
|
||||
>
|
||||
Copy rootPlaceId
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem onClick={()=>{navigator.clipboard.writeText(`${game.universeId}`)}}>
|
||||
<ContextMenuItem
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(`${game.universeId}`);
|
||||
}}
|
||||
>
|
||||
Copy universeId
|
||||
</ContextMenuItem>
|
||||
</ContextMenuContent>
|
||||
|
||||
Reference in New Issue
Block a user