Changeset View
Changeset View
Standalone View
Standalone View
native/navigation/community-drawer-item.react.js
// @flow | // @flow | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { View, FlatList, TouchableOpacity } from 'react-native'; | import { View, FlatList, TouchableOpacity } from 'react-native'; | ||||
import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react.js'; | import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react.js'; | ||||
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; | import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; | ||||
import { ExpandButton, ExpandButtonDisabled } from './expand-buttons.react.js'; | import { ExpandButton, ExpandButtonDisabled } from './expand-buttons.react.js'; | ||||
import SubchannelsButton from './subchannels-button.react.js'; | import SubchannelsButton from './subchannels-button.react.js'; | ||||
import ThreadAvatar from '../avatars/thread-avatar.react.js'; | import ThreadAvatar from '../avatars/thread-avatar.react.js'; | ||||
import type { MessageListParams } from '../chat/message-list-types.js'; | import type { MessageListParams } from '../chat/message-list-types.js'; | ||||
import { SingleLine } from '../components/single-line.react.js'; | import { SingleLine } from '../components/single-line.react.js'; | ||||
import InviteLinksButton from '../invite-links/invite-links-button.react.js'; | |||||
import { useStyles } from '../themes/colors.js'; | import { useStyles } from '../themes/colors.js'; | ||||
import type { TextStyle } from '../types/styles.js'; | import type { TextStyle } from '../types/styles.js'; | ||||
import { useShouldRenderAvatars } from '../utils/avatar-utils.js'; | import { useShouldRenderAvatars } from '../utils/avatar-utils.js'; | ||||
export type DrawerItemProps = { | export type DrawerItemProps = { | ||||
+itemData: CommunityDrawerItemData<TextStyle>, | +itemData: CommunityDrawerItemData<TextStyle>, | ||||
+toggleExpanded: (threadID: string) => void, | +toggleExpanded: (threadID: string) => void, | ||||
+expanded: boolean, | +expanded: boolean, | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | <View> | ||||
<TouchableOpacity | <TouchableOpacity | ||||
onPress={onPress} | onPress={onPress} | ||||
style={styles.textTouchableWrapper} | style={styles.textTouchableWrapper} | ||||
onLongPress={onExpandToggled} | onLongPress={onExpandToggled} | ||||
> | > | ||||
{avatar} | {avatar} | ||||
<SingleLine style={labelStyle}>{uiName}</SingleLine> | <SingleLine style={labelStyle}>{uiName}</SingleLine> | ||||
</TouchableOpacity> | </TouchableOpacity> | ||||
<InviteLinksButton community={threadInfo} /> | |||||
</View> | </View> | ||||
{children} | {children} | ||||
</View> | </View> | ||||
); | ); | ||||
} | } | ||||
const unboundStyles = { | const unboundStyles = { | ||||
avatarContainer: { | avatarContainer: { | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |