[Chat] Add chat disabled banner (#10573)

This commit is contained in:
Samuel Newman
2026-05-29 22:46:15 +03:00
committed by GitHub
parent b0708dcefb
commit d0ad7819bf
5 changed files with 137 additions and 51 deletions
+13 -8
View File
@@ -10,6 +10,7 @@ import {isNetworkError} from '#/lib/strings/errors'
import {logger} from '#/logger'
import {useCreateGroupChat} from '#/state/queries/messages/create-group-chat'
import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members'
import {useChatActorStatusQuery} from '#/state/queries/messages/get-status'
import {FAB} from '#/view/com/util/fab/FAB'
import {useTheme} from '#/alf'
import * as Dialog from '#/components/Dialog'
@@ -30,6 +31,8 @@ export function NewChat({
const {t: l} = useLingui()
const ax = useAnalytics()
const requireEmailVerification = useRequireEmailVerification()
const {data: chatStatus} = useChatActorStatusQuery()
const chatDisabled = !!chatStatus?.chatDisabled
const isGroupChatEnabled = ax.features.enabled(ax.features.GroupChatsEnable)
@@ -153,14 +156,16 @@ export function NewChat({
return (
<>
<FAB
testID="newChatFAB"
onPress={wrappedOnPress}
icon={<NewChatIcon size="lg" fill={t.palette.white} />}
accessibilityRole="button"
accessibilityLabel={l`New chat`}
accessibilityHint=""
/>
{!chatDisabled && (
<FAB
testID="newChatFAB"
onPress={wrappedOnPress}
icon={<NewChatIcon size="lg" fill={t.palette.white} />}
accessibilityRole="button"
accessibilityLabel={l`New chat`}
accessibilityHint=""
/>
)}
<Dialog.Outer
control={control}
testID="newChatDialog"