diff --git a/src/screens/Messages/List/index.tsx b/src/screens/Messages/List/index.tsx index 6de0ca0b..2427840b 100644 --- a/src/screens/Messages/List/index.tsx +++ b/src/screens/Messages/List/index.tsx @@ -14,16 +14,20 @@ import {useListConvos} from '#/state/queries/messages/list-converations' import {List} from '#/view/com/util/List' import {ViewHeader} from '#/view/com/util/ViewHeader' import {CenteredView} from '#/view/com/util/Views' -import {atoms as a, useBreakpoints, useTheme} from '#/alf' +import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {DialogControlProps, useDialogControl} from '#/components/Dialog' import {MessagesNUX} from '#/components/dms/MessagesNUX' import {NewChat} from '#/components/dms/NewChatDialog' import {useRefreshOnFocus} from '#/components/hooks/useRefreshOnFocus' +import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as Retry} from '#/components/icons/ArrowRotateCounterClockwise' +import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo' +import {Message_Stroke2_Corner0_Rounded as Message} from '#/components/icons/Message' import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus' import {SettingsSliderVertical_Stroke2_Corner0_Rounded as SettingsSlider} from '#/components/icons/SettingsSlider' import {Link} from '#/components/Link' -import {ListFooter, ListMaybePlaceholder} from '#/components/Lists' +import {ListFooter} from '#/components/Lists' +import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' import {ClipClopGate} from '../gate' import {ChatListItem} from './ChatListItem' @@ -82,14 +86,13 @@ export function MessagesScreen({navigation, route}: Props) { isFetchingNextPage, hasNextPage, fetchNextPage, + isError, error, refetch, } = useListConvos({refetchInterval: 15_000}) useRefreshOnFocus(refetch) - const isError = !!error - const conversations = useMemo(() => { if (data?.pages) { return data.pages.flatMap(page => page.convos) @@ -133,34 +136,88 @@ export function MessagesScreen({navigation, route}: Props) { return ( - {gtMobile ? ( - + + + {gtMobile ? ( - - ) : ( - - )} - {!isError && } - )} - errorMessage={cleanError(error)} - onRetry={isError ? refetch : undefined} - hideBackButton - /> + + {isLoading ? ( + + + + ) : ( + <> + {isError ? ( + <> + + + + Whoops! + + + {cleanError(error)} + + + + + + ) : ( + <> + + + + Nothing here + + + You have no conversations yet. Start one! + + + + )} + + )} + + + {!isLoading && !isError && ( + + )} ) }