@@ -3,20 +3,51 @@ import {View} from 'react-native';
33import type { BlockingViewProps } from '@components/BlockingViews/BlockingView' ;
44import BlockingView from '@components/BlockingViews/BlockingView' ;
55import Icon from '@components/Icon' ;
6+ import Text from '@components/Text' ;
67import TextBlock from '@components/TextBlock' ;
8+ import TextLink from '@components/TextLink' ;
79import { useMemoizedLazyExpensifyIcons } from '@hooks/useLazyAsset' ;
810import useLocalize from '@hooks/useLocalize' ;
11+ import { useSidebarOrderedReportsActions , useSidebarOrderedReportsState } from '@hooks/useSidebarOrderedReports' ;
912import useTheme from '@hooks/useTheme' ;
1013import useThemeStyles from '@hooks/useThemeStyles' ;
1114import variables from '@styles/variables' ;
15+ import CONST from '@src/CONST' ;
1216import useEmptyLHNIllustration from './useEmptyLHNIllustration' ;
1317
1418function LHNEmptyState ( ) {
1519 const theme = useTheme ( ) ;
1620 const styles = useThemeStyles ( ) ;
1721 const { translate} = useLocalize ( ) ;
1822 const expensifyIcons = useMemoizedLazyExpensifyIcons ( [ 'MagnifyingGlass' , 'Plus' ] ) ;
19- const emptyLHNIllustration = useEmptyLHNIllustration ( ) ;
23+ const emptyLHNIllustration = useEmptyLHNIllustration ( ) as BlockingViewProps ;
24+ const { activeTab} = useSidebarOrderedReportsState ( ) ;
25+ const { setActiveTab} = useSidebarOrderedReportsActions ( ) ;
26+
27+ if ( activeTab === CONST . INBOX_TAB . UNREAD || activeTab === CONST . INBOX_TAB . TODO ) {
28+ const title = activeTab === CONST . INBOX_TAB . UNREAD ? translate ( 'common.emptyLHN.noUnreadChats' ) : translate ( 'common.emptyLHN.noTodos' ) ;
29+ const caughtUpSubtitle = (
30+ < View style = { [ styles . alignItemsCenter , styles . justifyContentCenter ] } >
31+ < Text style = { [ styles . textAlignCenter , styles . textSupporting ] } > { translate ( 'common.emptyLHN.caughtUp' ) } </ Text >
32+ < TextLink
33+ onPress = { ( ) => setActiveTab ( CONST . INBOX_TAB . ALL ) }
34+ style = { [ styles . textStrong , styles . mt5 , styles . ph4 , styles . textAlignCenter ] }
35+ >
36+ { translate ( 'common.emptyLHN.seeAllChats' ) }
37+ </ TextLink >
38+ </ View >
39+ ) ;
40+
41+ return (
42+ < BlockingView
43+ { ...emptyLHNIllustration }
44+ title = { title }
45+ titleStyles = { styles . mb2 }
46+ CustomSubtitle = { caughtUpSubtitle }
47+ accessibilityLabel = { title }
48+ />
49+ ) ;
50+ }
2051
2152 const subtitle = (
2253 < View style = { [ styles . alignItemsCenter , styles . flexRow , styles . justifyContentCenter , styles . flexWrap , styles . textAlignCenter ] } >
@@ -56,7 +87,7 @@ function LHNEmptyState() {
5687
5788 return (
5889 < BlockingView
59- { ...( emptyLHNIllustration as BlockingViewProps ) }
90+ { ...emptyLHNIllustration }
6091 title = { translate ( 'common.emptyLHN.title' ) }
6192 CustomSubtitle = { subtitle }
6293 accessibilityLabel = { translate ( 'common.emptyLHN.title' ) }
0 commit comments