Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3501701
D6598.id22083.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6598.id22083.diff
View Options
diff --git a/native/chat/chat.react.js b/native/chat/chat.react.js
--- a/native/chat/chat.react.js
+++ b/native/chat/chat.react.js
@@ -29,7 +29,6 @@
threadIsPending,
threadMembersWithoutAddedAshoat,
} from 'lib/shared/thread-utils';
-import { firstLine } from 'lib/utils/string-utils';
import KeyboardAvoidingView from '../components/keyboard-avoiding-view.react';
import SWMansionIcon from '../components/swmansion-icon.react';
@@ -64,6 +63,7 @@
import ThreadSettings from './settings/thread-settings.react';
import ThreadScreenPruner from './thread-screen-pruner.react';
import ThreadSettingsButton from './thread-settings-button.react';
+import ThreadSettingsHeaderTitle from './thread-settings-header-title.react';
const unboundStyles = {
keyboardAvoidingView: {
@@ -240,7 +240,13 @@
headerBackTitleVisible: false,
};
const threadSettingsOptions = ({ route }) => ({
- headerTitle: firstLine(route.params.threadInfo.uiName),
+ // eslint-disable-next-line react/display-name
+ headerTitle: props => (
+ <ThreadSettingsHeaderTitle
+ threadInfo={route.params.threadInfo}
+ {...props}
+ />
+ ),
headerBackTitleVisible: false,
});
const deleteThreadOptions = {
diff --git a/native/chat/thread-settings-header-title.react.js b/native/chat/thread-settings-header-title.react.js
new file mode 100644
--- /dev/null
+++ b/native/chat/thread-settings-header-title.react.js
@@ -0,0 +1,27 @@
+// @flow
+
+import {
+ HeaderTitle,
+ type HeaderTitleInputProps,
+} from '@react-navigation/elements';
+import * as React from 'react';
+
+import type { ThreadInfo } from 'lib/types/thread-types';
+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';
+import { firstLine } from 'lib/utils/string-utils';
+
+type Props = {
+ +threadInfo: ThreadInfo,
+ ...HeaderTitleInputProps,
+};
+function ThreadSettingsHeaderTitle(props: Props): React.Node {
+ const { threadInfo, ...rest } = props;
+ const { uiName } = useResolvedThreadInfo(threadInfo);
+ return <HeaderTitle {...rest}>{firstLine(uiName)}</HeaderTitle>;
+}
+
+const MemoizedThreadSettingsHeaderTitle: React.ComponentType<Props> = React.memo<Props>(
+ ThreadSettingsHeaderTitle,
+);
+
+export default MemoizedThreadSettingsHeaderTitle;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 3:47 AM (17 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2683443
Default Alt Text
D6598.id22083.diff (2 KB)
Attached To
Mode
D6598: [native] Introduce ThreadSettingsHeaderTitle for fetching ENS names
Attached
Detach File
Event Timeline
Log In to Comment