Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add default empty state text (#7212)

authored by

Samuel Newman and committed by
GitHub
8f7a6e5f aeb78daf

+22 -12
+22 -12
src/view/com/lists/MyLists.tsx
··· 8 8 ViewStyle, 9 9 } from 'react-native' 10 10 import {AppBskyGraphDefs as GraphDefs} from '@atproto/api' 11 - import {Trans} from '@lingui/macro' 11 + import {msg} from '@lingui/macro' 12 + import {useLingui} from '@lingui/react' 12 13 13 14 import {usePalette} from '#/lib/hooks/usePalette' 14 15 import {cleanError} from '#/lib/strings/errors' ··· 42 43 }) { 43 44 const pal = usePalette('default') 44 45 const t = useTheme() 46 + const {_} = useLingui() 45 47 const moderationOpts = useModerationOpts() 46 48 const [isPTRing, setIsPTRing] = React.useState(false) 47 49 const {data, isFetching, isFetched, isError, error, refetch} = ··· 63 65 return items 64 66 }, [isError, isEmpty, isFetched, isFetching, moderationOpts, data]) 65 67 68 + let emptyText 69 + switch (filter) { 70 + case 'curate': 71 + emptyText = _( 72 + msg`Public, sharable lists which can be used to drive feeds.`, 73 + ) 74 + break 75 + case 'mod': 76 + emptyText = _( 77 + msg`Public, sharable lists of users to mute or block in bulk.`, 78 + ) 79 + break 80 + default: 81 + emptyText = _(msg`You have no lists.`) 82 + break 83 + } 84 + 66 85 // events 67 86 // = 68 87 ··· 108 127 maxWidth: 200, 109 128 }, 110 129 ]}> 111 - {filter === 'curate' && ( 112 - <Trans> 113 - Public, sharable lists which can be used to drive feeds. 114 - </Trans> 115 - )} 116 - {filter === 'mod' && ( 117 - <Trans> 118 - Public, sharable lists of users to mute or block in bulk. 119 - </Trans> 120 - )} 130 + {emptyText} 121 131 </Text> 122 132 </View> 123 133 ) ··· 149 159 </View> 150 160 ) 151 161 }, 152 - [t, renderItem, error, onRefresh, filter], 162 + [t, renderItem, error, onRefresh, emptyText], 153 163 ) 154 164 155 165 if (inline) {