forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MainTabsScreen: Add Users icon to bottom nav
Fixes: zulip#5495
- Loading branch information
Showing
3 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* @flow strict-local */ | ||
|
||
import React, { useCallback } from 'react'; | ||
import type { Node } from 'react'; | ||
|
||
import type { UserOrBot } from '../types'; | ||
import { useSelector, useDispatch } from '../react-redux'; | ||
import UserList from './UserList'; | ||
import { getUsers, getPresence } from '../selectors'; | ||
import { navigateBack, doNarrow } from '../actions'; | ||
import { useNavigation } from '../react-navigation'; | ||
import { AccountDetailsScreen } from '../account-info/AccountDetailsScreen'; | ||
|
||
type Props = $ReadOnly<{| | ||
filter: string, | ||
|}>; | ||
|
||
export default function UsersProfileCard(props: Props): Node { | ||
const { filter } = props; | ||
const dispatch = useDispatch(); | ||
const users = useSelector(getUsers); | ||
const presences = useSelector(getPresence); | ||
|
||
const navigation = useNavigation(); | ||
const handleUserNarrow = useCallback( | ||
(user: UserOrBot) => { | ||
navigation.push('account-details', {userId: user.user_id}); | ||
}, | ||
[navigation], | ||
); | ||
|
||
return ( | ||
<UserList users={users} filter={filter} presences={presences} onPress={handleUserNarrow} /> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* @flow strict-local */ | ||
import React, { useState } from 'react'; | ||
import type { Node } from 'react'; | ||
import { View } from 'react-native'; | ||
import { SafeAreaView } from 'react-native-safe-area-context'; | ||
|
||
import type { RouteProp } from '../react-navigation'; | ||
import type { AppNavigationProp } from '../nav/AppNavigator'; | ||
import Screen from '../common/Screen'; | ||
import UsersProfileCard from './UsersProfileCard'; | ||
|
||
type Props = $ReadOnly<{| | ||
navigation: AppNavigationProp<'users'>, | ||
route: op<'users', void>, | ||
|}>; | ||
|
||
export default function UsersInfoScreen(props: Props): Node { | ||
return ( | ||
<SafeAreaView mode="padding" edges={['top']} style={{flex: 1}} scrollEnabled={false}> | ||
<UsersProfileCard filter="" /> | ||
</SafeAreaView> | ||
); | ||
} |