Page MenuHomePhabricator

D13275.id44035.diff
No OneTemporary

D13275.id44035.diff

diff --git a/native/chat/message-list-container.react.js b/native/chat/message-list-container.react.js
--- a/native/chat/message-list-container.react.js
+++ b/native/chat/message-list-container.react.js
@@ -18,6 +18,7 @@
useExistingThreadInfoFinder,
} from 'lib/shared/thread-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import { threadTypeIsThick } from 'lib/types/thread-types-enum.js';
import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js';
import { pinnedMessageCountText } from 'lib/utils/message-pinning-utils.js';
@@ -160,10 +161,23 @@
let searchComponent = null;
if (searching) {
const { userInfoInputArray, genesisThreadInfo } = this.props;
+ const childThreadType = pendingThreadType(
+ userInfoInputArray.length,
+ true,
+ );
// It's technically possible for the client to be missing the Genesis
// ThreadInfo when it first opens up (before the server delivers it)
let parentThreadHeader;
- if (genesisThreadInfo) {
+ if (threadTypeIsThick(childThreadType)) {
+ parentThreadHeader = (
+ <ParentThreadHeader
+ childThreadType={pendingThreadType(
+ userInfoInputArray.length,
+ false,
+ )}
+ />
+ );
+ } else if (genesisThreadInfo) {
parentThreadHeader = (
<ParentThreadHeader
parentThreadInfo={genesisThreadInfo}
diff --git a/native/chat/parent-thread-header.react.js b/native/chat/parent-thread-header.react.js
--- a/native/chat/parent-thread-header.react.js
+++ b/native/chat/parent-thread-header.react.js
@@ -14,7 +14,7 @@
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +parentThreadInfo: ThreadInfo,
+ +parentThreadInfo?: ThreadInfo,
+childThreadType: ThreadType,
};
function ParentThreadHeader(props: Props): React.Node {
@@ -26,9 +26,24 @@
const navigateToThread = useNavigateToThread();
const onPressParentThread = React.useCallback(() => {
+ if (!parentThreadInfo) {
+ return;
+ }
navigateToThread({ threadInfo: parentThreadInfo });
}, [parentThreadInfo, navigateToThread]);
+ let parentThreadButton;
+ if (parentThreadInfo) {
+ parentThreadButton = (
+ <>
+ <Text style={styles.within}>within</Text>
+ <Button onPress={onPressParentThread}>
+ <CommunityPill community={parentThreadInfo} />
+ </Button>
+ </>
+ );
+ }
+
return (
<View style={styles.container}>
<ScrollView
@@ -40,10 +55,7 @@
threadType={childThreadType}
color={threadVisibilityColor}
/>
- <Text style={styles.within}>within</Text>
- <Button onPress={onPressParentThread}>
- <CommunityPill community={parentThreadInfo} />
- </Button>
+ {parentThreadButton}
</ScrollView>
</View>
);

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 5:31 PM (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2695531
Default Alt Text
D13275.id44035.diff (2 KB)

Event Timeline