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 Mar 18, 2021
1 parent 59940a7 commit 49a8bd8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 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,11 @@ const componentStyles = createStyleSheet({
export default function TitleGroup(props: Props) {
const { userIds } = props;
return (
<View style={styles.navWrapper}>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
fadingEdgeLength={50}
>
{userIds.map(userId => (
<View key={userId} style={componentStyles.titleAvatar}>
<UserAvatarWithPresenceById
Expand All @@ -34,6 +38,6 @@ export default function TitleGroup(props: Props) {
/>
</View>
))}
</View>
</ScrollView>
);
}

0 comments on commit 49a8bd8

Please sign in to comment.