// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; import {intlShape} from 'react-intl'; import {Text, View} from 'react-native'; import Svg, { Ellipse, G, Path, Defs, ClipPath, Rect, } from 'react-native-svg'; import {useSelector} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {makeStyleSheetFromTheme} from '@utils/theme'; import type {Theme} from '@mm-redux/types/preferences'; import type {GlobalState} from '@mm-redux/types/store'; type Props = { intl: typeof intlShape; isUnreads: boolean; } function EmptyState({intl, isUnreads}: Props) { const theme = useSelector((state: GlobalState) => getTheme(state)); const style = getStyleSheet(theme); let title; let subTitle; if (isUnreads) { title = intl.formatMessage({ id: 'global_threads.emptyUnreads.title', defaultMessage: 'No unread threads', }); subTitle = intl.formatMessage({ id: 'global_threads.emptyUnreads.message', defaultMessage: "Looks like you're all caught up.", }); } else { title = intl.formatMessage({ id: 'global_threads.emptyThreads.title', defaultMessage: 'No followed threads yet', }); subTitle = intl.formatMessage({ id: 'global_threads.emptyThreads.message', defaultMessage: 'Any threads you are mentioned in or have participated in will show here along with any threads you have followed.', }); } return ( {title} {subTitle} ); } const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { container: { alignItems: 'center', flexGrow: 1, justifyContent: 'center', }, textContainer: { padding: 32, }, title: { color: theme.centerChannelColor, fontSize: 20, fontWeight: '600', textAlign: 'center', }, subTitle: { color: theme.centerChannelColor, fontSize: 16, fontWeight: '400', lineHeight: 24, marginTop: 16, textAlign: 'center', }, }; }); export default EmptyState;