Skip to content

Commit

Permalink
Navigation: Update nav to use ScrollView.
Browse files Browse the repository at this point in the history
Updates TitleGroup to use ScrollView instead of View
so that the avatars in nav bar don't overflow and can
be scrolled to view.

Fixes: zulip#3700
  • Loading branch information
im-adithya committed Apr 6, 2021
1 parent 1836c09 commit 725d29e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/title/TitleGroup.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* @flow strict-local */

import React from 'react';
import { View } from 'react-native';
import { ScrollView, View } from 'react-native';

import type { UserId } from '../types';
import * as NavigationService from '../nav/NavigationService';
import styles, { createStyleSheet } from '../styles';
import { createStyleSheet } from '../styles';
import { UserAvatarWithPresenceById } from '../common/UserAvatarWithPresence';
import { navigateToAccountDetails } from '../nav/navActions';

Expand All @@ -22,7 +22,8 @@ const componentStyles = createStyleSheet({
export default function TitleGroup(props: Props) {
const { userIds } = props;
return (
<View style={styles.navWrapper}>
/* fadingEdgeLength is an android-only prop used to fade the edges so that they don't end abruptly */
<ScrollView horizontal showsHorizontalScrollIndicator={false} fadingEdgeLength={50}>
{userIds.map(userId => (
<View key={userId} style={componentStyles.titleAvatar}>
<UserAvatarWithPresenceById
Expand All @@ -34,6 +35,6 @@ export default function TitleGroup(props: Props) {
/>
</View>
))}
</View>
</ScrollView>
);
}

0 comments on commit 725d29e

Please sign in to comment.