[Chat] Empty state for native (#10603)

This commit is contained in:
Samuel Newman
2026-05-26 20:01:10 +03:00
committed by GitHub
parent 1113686e30
commit afa6a98349
+18 -5
View File
@@ -132,6 +132,19 @@ export function MessagesScreenInner({navigation, route}: Props) {
[navigation], [navigation],
) )
const openChatControl = useCallback(() => {
newChatControl.open()
}, [newChatControl])
const requireEmailVerification = useRequireEmailVerification()
const wrappedOpenChatControl = requireEmailVerification(openChatControl, {
instructions: [
<Trans key="new-chat">
Before you can message another user, you must first verify your email.
</Trans>,
],
})
if (isWithinSplitView) { if (isWithinSplitView) {
return ( return (
<> <>
@@ -144,7 +157,7 @@ export function MessagesScreenInner({navigation, route}: Props) {
button={{ button={{
label: l`New chat`, label: l`New chat`,
text: l`New chat`, text: l`New chat`,
onPress: newChatControl.open, onPress: wrappedOpenChatControl,
size: 'small', size: 'small',
color: 'primary', color: 'primary',
icon: MessagePlusIcon, icon: MessagePlusIcon,
@@ -344,11 +357,11 @@ export function ChatList({
/> />
) : ( ) : (
<EmptyState <EmptyState
message={l`No chats yet`} message={l`Say hi to someone`}
icon={InboxLargeIcon} icon={BubbleSmileIcon}
iconSize="4xl"
textStyle={t.atoms.text} textStyle={t.atoms.text}
iconColor={t.atoms.text.color} iconColor={t.atoms.text.color}
iconSize="4xl"
button={{ button={{
label: l`New chat`, label: l`New chat`,
text: l`New chat`, text: l`New chat`,
@@ -357,7 +370,7 @@ export function ChatList({
color: 'primary', color: 'primary',
icon: MessagePlusIcon, icon: MessagePlusIcon,
}} }}
style={web([a.h_full, a.justify_center, {paddingBottom: 120}])} style={[a.h_full, {paddingTop: '20%'}]}
/> />
)} )}
</> </>