[www] remove subrooms from public template

This commit is contained in:
Devin Zuczek
2026-09-22 16:31:43 -04:00
parent 01f64f78af
commit c6bda1fc6a
+28 -24
View File
@@ -2045,9 +2045,9 @@ function RoomPage({
/** /**
* A room as anyone sees it: the same hero the owner's page draws, with the creator linked * A room as anyone sees it: the same hero the owner's page draws, with the creator linked
* to their profile in place of the upload control, then the room's public facts, the * to their profile in place of the upload control, then the room's public facts and the
* photos players took in it, and its subrooms — read-only, since nothing here is the * photos players took in it — read-only, since nothing here is the viewer's to change.
* viewer's to change. * Staff also see its subrooms; the owner gets them on their own page instead.
*/ */
function PublicRoomView({ function PublicRoomView({
room, room,
@@ -2131,27 +2131,31 @@ function PublicRoomView({
)} )}
</section> </section>
<section className="card"> {/* Staff only: a visitor has no use for the room's internals. The owner sees them on
<h2>Subrooms</h2> their own page (RoomDetail), never this one. */}
{subRooms.length === 0 ? ( {isAdmin() && (
<p className="muted">This room has no subrooms.</p> <section className="card">
) : ( <h2>Subrooms</h2>
<ul className="subrooms"> {subRooms.length === 0 ? (
{subRooms.map((sub) => ( <p className="muted">This room has no subrooms.</p>
<li className="subroom" key={sub.SubRoomId}> ) : (
<div className="room-head"> <ul className="subrooms">
<span className="subroom-name">{sub.Name}</span> {subRooms.map((sub) => (
<VisibilityBadge accessibility={sub.Accessibility} /> <li className="subroom" key={sub.SubRoomId}>
</div> <div className="room-head">
<p className="subroom-meta"> <span className="subroom-name">{sub.Name}</span>
Up to {sub.MaxPlayers} player{sub.MaxPlayers === 1 ? '' : 's'} <VisibilityBadge accessibility={sub.Accessibility} />
{sub.IsSandbox ? ' · sandbox' : ''} </div>
</p> <p className="subroom-meta">
</li> Up to {sub.MaxPlayers} player{sub.MaxPlayers === 1 ? '' : 's'}
))} {sub.IsSandbox ? ' · sandbox' : ''}
</ul> </p>
)} </li>
</section> ))}
</ul>
)}
</section>
)}
{/* Staff only, and cosmetic: hidden for everyone else, but `rooms` checks the token's {/* Staff only, and cosmetic: hidden for everyone else, but `rooms` checks the token's
role itself on the DELETE. */} role itself on the DELETE. */}