ui: inform guests of restricted interfaces

This commit is contained in:
Evan Carroll 2026-01-19 00:38:37 -06:00
parent 1f922f8221
commit 39750c1d82
8 changed files with 137 additions and 49 deletions

View file

@ -12,6 +12,7 @@ use chattyness_db::models::{AvatarWithPaths, InventoryItem};
#[cfg(feature = "hydrate")]
use chattyness_db::ws_messages::ClientMessage;
use super::modals::GuestLockedOverlay;
use super::ws_client::WsSenderStorage;
#[cfg(feature = "hydrate")]
use crate::utils::normalize_asset_path;
@ -216,6 +217,7 @@ fn RenderedPreview(#[prop(into)] avatar: Signal<Option<AvatarWithPaths>>) -> imp
/// - `realm_slug`: Current realm slug for API calls
/// - `on_avatar_update`: Callback when avatar is updated
/// - `ws_sender`: WebSocket sender for broadcasting avatar changes
/// - `is_guest`: Whether the current user is a guest (shows locked overlay)
#[component]
pub fn AvatarEditorPopup(
#[prop(into)] open: Signal<bool>,
@ -224,7 +226,11 @@ pub fn AvatarEditorPopup(
#[prop(into)] realm_slug: Signal<String>,
on_avatar_update: Callback<AvatarWithPaths>,
ws_sender: WsSenderStorage,
/// Whether the current user is a guest. Guests see a locked overlay.
#[prop(optional, into)]
is_guest: Option<Signal<bool>>,
) -> impl IntoView {
let is_guest = is_guest.unwrap_or_else(|| Signal::derive(|| false));
// Tab state
let (active_tab, set_active_tab) = signal(EditorTab::BaseLayers);
@ -798,6 +804,11 @@ pub fn AvatarEditorPopup(
</div>
</div>
</div>
// Guest locked overlay
<Show when=move || is_guest.get()>
<GuestLockedOverlay />
</Show>
</div>
// Context menu