Унифицированы экраны, требующие авторизации, в гостевом режиме

This commit is contained in:
mi
2026-07-30 19:47:10 +03:00
parent e24ed9d8ef
commit 1a420eeaf0
7 changed files with 124 additions and 69 deletions
@@ -5,6 +5,7 @@ import { FlatList, Platform, Text, View } from "react-native";
import { useApp } from "../../src/app-context";
import { ChatInputBar } from "../../src/components/ChatInputBar";
import { ChatScreenHeader } from "../../src/components/ChatScreenHeader";
import { GuestAuthGate } from "../../src/components/GuestAuthGate";
import { MessageBubble } from "../../src/components/MessageBubble";
import { ScreenShell } from "../../src/components/ScreenShell";
import { isMessageBlockedError } from "../../src/api";
@@ -179,11 +180,12 @@ export default function ChatScreen() {
if (app.authStatus !== "authenticated") {
return (
<ScreenShell>
<ChatScreenHeader subtitle="Требуется вход" />
<View style={{ flex: 1, padding: spacing.lg, justifyContent: "center" }}>
<Text style={styles.error}>Для просмотра чата требуется авторизация.</Text>
<Button title="На главную" secondary onPress={() => router.replace("/")} />
</View>
<ChatScreenHeader title="Чат" subtitle="Требуется вход" />
<GuestAuthGate
icon="message-circle"
title="Чат доступен после входа"
description="Авторизуйтесь, чтобы переписываться с оператором и получать ответы."
/>
</ScreenShell>
);
}