Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33307758
D6598.1768799502.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6598.1768799502.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
Mon, Jan 19, 5:11 AM (17 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5954508
Default Alt Text
D6598.1768799502.diff (2 KB)
Attached To
Mode
D6598: [native] Introduce ThreadSettingsHeaderTitle for fetching ENS names
Attached
Detach File
Event Timeline
Log In to Comment