fix(chat): constrain image viewer width

This commit is contained in:
2026-06-30 10:58:57 +08:00
parent caf77efb32
commit f352dbdffa
3 changed files with 25 additions and 16 deletions
@@ -2,6 +2,7 @@
import { useRouter } from "next/navigation";
import { MobileShell } from "@/app/_components/core";
import { ROUTE_BUILDERS, ROUTES } from "@/router/routes";
import { useAuthState } from "@/stores/auth/auth-context";
import { useChatDispatch, useChatState } from "@/stores/chat/chat-context";
@@ -40,25 +41,33 @@ export function ChatImageViewerScreen({
if (!message) {
return (
<main className={styles.emptyScreen}>
<button type="button" className={styles.backButton} onClick={handleClose}>
Back to chat
</button>
<p className={styles.emptyText}>
{chatState.historyLoaded ? "Image not found." : "Loading image..."}
</p>
</main>
<MobileShell background="#0d0b14">
<main className={styles.emptyScreen}>
<button
type="button"
className={styles.backButton}
onClick={handleClose}
>
Back to chat
</button>
<p className={styles.emptyText}>
{chatState.historyLoaded ? "Image not found." : "Loading image..."}
</p>
</main>
</MobileShell>
);
}
return (
<>
<FullscreenImageViewer
imageUrl={message.imageUrl ?? ""}
imagePaywalled={message.imagePaywalled === true}
onUnlockImagePaywall={handleUnlockImagePaywall}
onClose={handleClose}
/>
<MobileShell background="#000000">
<FullscreenImageViewer
imageUrl={message.imageUrl ?? ""}
imagePaywalled={message.imagePaywalled === true}
onUnlockImagePaywall={handleUnlockImagePaywall}
onClose={handleClose}
/>
</MobileShell>
<HistoryUnlockDialog
open={chatState.unlockHistoryPromptVisible}
lockedCount={chatState.lockedHistoryCount}