feat(frontend): style mission-detail sidebar cards as dossier frames
Convert the Campaign, Roster, and Server sidebar cards from Item variant=outline to the TacticalFrame primitive (squared corners, grid texture, corner brackets, classification strip with REF code). The campaign body content is the link; the status badge moves onto the title row with a hover-reveal chevron, matching the Roster rows.
This commit is contained in:
parent
3ac6ebd87d
commit
c0538f902c
1 changed files with 74 additions and 90 deletions
|
|
@ -746,110 +746,94 @@ export default async function MissionDetailPage({ params }: MissionDetailPagePro
|
|||
|
||||
{/* Campaign Card */}
|
||||
{campaign && (
|
||||
<Item variant="outline">
|
||||
<ItemHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<FlagIcon className="size-4 text-muted-foreground" />
|
||||
<ItemTitle>Campaign</ItemTitle>
|
||||
</div>
|
||||
<Link
|
||||
href={`/intelligence/campaigns/${campaign.id}`}
|
||||
className="py-1 text-xs text-muted-foreground hover:text-primary transition-colors"
|
||||
>
|
||||
View
|
||||
</Link>
|
||||
</ItemHeader>
|
||||
<ItemContent>
|
||||
<div className="flex flex-col gap-2">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold">{campaign.name}</h3>
|
||||
<span
|
||||
className={`text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded mt-1 inline-block ${campaign.status === "inProgress" ? "bg-blue-500/20 text-blue-400" : campaign.status === "onHold" ? "bg-amber-500/20 text-amber-400" : "bg-muted text-muted-foreground"}`}
|
||||
>
|
||||
{campaign.status === "inProgress"
|
||||
? "In Progress"
|
||||
: campaign.status === "onHold"
|
||||
? "On Hold"
|
||||
: campaign.status}
|
||||
<TacticalFrame
|
||||
classification="OPERATION // CAMPAIGN"
|
||||
refCode={`REF ${refCodeFrom(campaign.id)}`}
|
||||
grow={false}
|
||||
>
|
||||
<Link
|
||||
href={`/intelligence/campaigns/${campaign.id}`}
|
||||
className="block min-w-0 flex-1 flex-col gap-2 p-4 transition-colors group hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<FlagIcon className="size-4 shrink-0 text-white/60" />
|
||||
<span className="truncate text-sm font-medium text-white">
|
||||
{campaign.name}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground line-clamp-3">{campaign.summary}</p>
|
||||
<span className="inline-flex shrink-0 items-center gap-2">
|
||||
<span className={`self-start inline-block text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded ${campaign.status === "concept" ? "bg-emerald-500/20 text-emerald-400" : campaign.status === "inProgress" ? "bg-blue-500/20 text-blue-400" : campaign.status === "onHold" ? "bg-amber-500/20 text-amber-400" : "bg-emerald-500/20 text-emerald-400"}`}>
|
||||
{campaign.status === "concept" ? "Planning" : campaign.status === "inProgress" ? "Active Deployment" : campaign.status === "onHold" ? "On Hold" : "Concluded"}
|
||||
</span>
|
||||
<ChevronRightIcon className="size-3 text-white/50 opacity-0 group-hover:opacity-100 transition-opacity" />
|
||||
</span>
|
||||
</div>
|
||||
</ItemContent>
|
||||
</Item>
|
||||
<p className="text-xs text-white/60 line-clamp-3">{campaign.summary}</p>
|
||||
</Link>
|
||||
</TacticalFrame>
|
||||
)}
|
||||
|
||||
{/* Sibling Missions */}
|
||||
{siblingMissions.length > 0 && (
|
||||
<Item variant="outline">
|
||||
<ItemHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<CrosshairIcon className="size-4 text-muted-foreground" />
|
||||
<ItemTitle>Other Missions in Campaign</ItemTitle>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<ItemContent>
|
||||
<div className="flex flex-col gap-1.5">
|
||||
{siblingMissions.map((m) => {
|
||||
const mDate = new Date(m.classification.startDateTime);
|
||||
return (
|
||||
<Link
|
||||
key={m.id}
|
||||
href={`/intelligence/missions/${m.id}`}
|
||||
className="flex items-center gap-3 p-1.5 rounded-md hover:bg-muted/50 transition-colors group"
|
||||
>
|
||||
<div className="flex flex-col min-w-0 flex-1">
|
||||
{m.codeName && (
|
||||
<span className="font-mono text-[10px] text-muted-foreground">
|
||||
{m.codeName}
|
||||
</span>
|
||||
)}
|
||||
<span className="text-sm truncate group-hover:text-primary transition-colors">
|
||||
{m.name}
|
||||
<TacticalFrame
|
||||
classification="OPERATION // ROSTER"
|
||||
refCode={`REF ${refCodeFrom(campaign?.id ?? mission.id)}`}
|
||||
grow={false}
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-0.5 p-3">
|
||||
{siblingMissions.map((m) => {
|
||||
return (
|
||||
<Link
|
||||
key={m.id}
|
||||
href={`/intelligence/missions/${m.id}`}
|
||||
className="flex items-center gap-3 rounded-md px-2 py-1.5 text-white/80 transition-colors group hover:bg-muted/50 hover:text-white"
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 flex-col">
|
||||
{m.codeName && (
|
||||
<span className="font-mono text-[10px] text-white/50">
|
||||
{m.codeName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
<span
|
||||
className={`text-[10px] font-semibold uppercase tracking-wider px-1 py-0.5 rounded ${statusColors[m.ownershipAndStatus.status] ?? "bg-muted text-muted-foreground"}`}
|
||||
>
|
||||
{m.ownershipAndStatus.status}
|
||||
</span>
|
||||
<ChevronRightIcon className="size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" />
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</ItemContent>
|
||||
</Item>
|
||||
)}
|
||||
<span className="truncate text-sm font-medium group-hover:text-white">
|
||||
{m.name}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
<span className={`self-start inline-block text-[10px] font-semibold uppercase tracking-wider px-1 py-0.5 rounded ${statusColors[m.ownershipAndStatus.status] ?? "bg-muted text-muted-foreground"}`}>
|
||||
{m.ownershipAndStatus.status}
|
||||
</span>
|
||||
<ChevronRightIcon className="size-3 text-white/50 opacity-0 group-hover:opacity-100 transition-opacity" />
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</TacticalFrame>
|
||||
)}
|
||||
|
||||
{/* Server Details */}
|
||||
{mission.gameDetails?.serverDetails?.serverIp && (
|
||||
<Item variant="outline">
|
||||
<ItemHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<ServerIcon className="size-4 text-muted-foreground" />
|
||||
<ItemTitle>Server</ItemTitle>
|
||||
<TacticalFrame
|
||||
classification="OPERATION // SERVER"
|
||||
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||
grow={false}
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-3 p-4 text-sm">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span className="text-white/60">Address</span>
|
||||
<span className="font-mono text-white">
|
||||
{mission.gameDetails.serverDetails.serverIp}
|
||||
</span>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<ItemContent>
|
||||
<div className="flex flex-col gap-1.5 text-sm">
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Address</span>
|
||||
<span className="font-mono">
|
||||
{mission.gameDetails.serverDetails.serverIp}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Port</span>
|
||||
<span className="font-mono">
|
||||
{mission.gameDetails.serverDetails.serverPort}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span className="text-white/60">Port</span>
|
||||
<span className="font-mono text-white">
|
||||
{mission.gameDetails.serverDetails.serverPort}
|
||||
</span>
|
||||
</div>
|
||||
</ItemContent>
|
||||
</Item>
|
||||
</div>
|
||||
</TacticalFrame>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue