Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add messaging placeholder #541

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/components/Messaging/SearchRecipientsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ViewStyle,
} from 'react-native';
import { GiftedAvatar, User as GiftedUser } from 'react-native-gifted-chat';
import { Button, Divider, List, Searchbar } from 'react-native-paper';
import { Button, Divider, List, Searchbar, Text } from 'react-native-paper';
import { tID } from '../TrackTile/common/testID';
import { useStyles, useUser } from '../../hooks';
import { createStyles, useIcons } from '../BrandConfigProvider';
Expand Down Expand Up @@ -77,6 +77,16 @@ export const SearchRecipientsModal = ({
clearIcon={ClearList}
testID={tID('search-bar')}
/>
{others.length < 1 && (
<View>
<Text style={{ textAlign: 'center' }}>
{t(
'no-recipients-message',
'No available message recipients. \nYou must be added to a messaging group to use this feature. Ask your administrator for more information.',
)}
</Text>
</View>
)}
<ScrollView
scrollEventThrottle={400}
contentContainerStyle={styles.scrollView}
Expand Down
12 changes: 12 additions & 0 deletions src/screens/MessageScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ export function MessageScreen<ParamList extends ParamListBase>({
</TouchableOpacity>
</Swipeable>
))}
{!conversations?.length && !isLoading && (
<Swipeable>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if I try to swipe this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since no swipeable left or right props are passed, nothing happens.

<List.Item
titleStyle={styles.listItemText}
title={t('no-direct-messages', 'No message history.')}
style={styles.listItemView}
description={t('no-direct-messages', 'New messages appear here.')}
descriptionStyle={styles.listItemSubtitleText}
/>
<Divider style={styles.listItemDividerView} />
</Swipeable>
)}
{isLoading ? (
<ActivityIndicatorView />
) : (
Expand Down
Loading