fix(chat): constrain image viewer width
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user