Fix error messages for empty results

This commit is contained in:
Jackson Harper
2024-08-27 16:05:00 +08:00
parent c6d978e379
commit 137052ec82
3 changed files with 8 additions and 3 deletions

View File

@ -76,9 +76,9 @@ export function HighlightsContainer(): JSX.Element {
}}
>
{!isLoading && highlights.length < 1 && (
<Box css={{ width: '100%' }}>
<HStack css={{ width: '100%' }} alignment="center">
<EmptyLibrary folder="highlights" />
</Box>
</HStack>
)}
{highlights.map((highlight) => {
return (

View File

@ -77,6 +77,10 @@ const Subtitle = (props: EmptyLibraryProps) => {
)
const titleText = (folder: string | undefined) => {
switch (folder) {
case 'home':
return 'All your newly saved items and subscriptions will appear in your home section.'
case 'inbox':
return 'Items you have saved using the mobile apps and browser extensions, along with subscriptions you have moved into your library will appear here'
case 'highlights':
return 'Highlight text while reading to start building your highlights library.'
case 'trash':
@ -116,6 +120,7 @@ export const EmptyLibrary = (props: EmptyLibraryProps) => {
height: '100%',
pb: '100px',
px: '25px',
maxWidth: '520px',
color: '$thLibraryMenuSecondary',
minHeight: `calc(100vh - ${DEFAULT_HEADER_HEIGHT})`,
}}

View File

@ -956,7 +956,7 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element {
{!showItems && props.fetchItemsError && <FetchItemsError />}
{!showItems && !props.fetchItemsError && props.items.length <= 0 && (
<EmptyLibrary
folder={props.folder}
folder={props.folder ?? 'home'}
onAddLinkClicked={() => {
props.setShowAddLinkModal(true)
}}