UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

15 lines (14 loc) 1.17 kB
import React from 'react'; import { ConnectionStatus } from './ConnectionStatus'; import { CustomNotification } from './CustomNotification'; import { useTranslationContext } from '../../context/TranslationContext'; export const MessageListNotifications = (props) => { const { hasNewMessages, isMessageListScrolledToBottom, isNotAtLatestMessageSet, MessageNotification, notifications, scrollToBottom, threadList, unreadCount, } = props; const { t } = useTranslationContext('MessageListNotifications'); return (React.createElement("div", { className: 'str-chat__list-notifications' }, notifications.map((notification) => (React.createElement(CustomNotification, { active: true, key: notification.id, type: notification.type }, notification.text))), React.createElement(ConnectionStatus, null), React.createElement(MessageNotification, { isMessageListScrolledToBottom: isMessageListScrolledToBottom, onClick: scrollToBottom, showNotification: hasNewMessages || isNotAtLatestMessageSet, threadList: threadList, unreadCount: unreadCount }, isNotAtLatestMessageSet ? t('Latest Messages') : t('New Messages!')))); };