Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3388019
D8609.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
D8609.diff
View Options
diff --git a/lib/hooks/inline-engagement-text.react.js b/lib/shared/inline-engagement-utils.js
rename from lib/hooks/inline-engagement-text.react.js
rename to lib/shared/inline-engagement-utils.js
--- a/lib/hooks/inline-engagement-text.react.js
+++ b/lib/shared/inline-engagement-utils.js
@@ -2,7 +2,7 @@
import type { ThreadInfo } from '../types/thread-types.js';
-function useInlineEngagementText(threadInfo: ?ThreadInfo): string {
+function getInlineEngagementSidebarText(threadInfo: ?ThreadInfo): string {
if (!threadInfo) {
return '';
}
@@ -10,4 +10,4 @@
return `${repliesCount} ${repliesCount > 1 ? 'replies' : 'reply'}`;
}
-export default useInlineEngagementText;
+export { getInlineEngagementSidebarText };
diff --git a/native/chat/inline-engagement.react.js b/native/chat/inline-engagement.react.js
--- a/native/chat/inline-engagement.react.js
+++ b/native/chat/inline-engagement.react.js
@@ -9,8 +9,8 @@
interpolateNode,
} from 'react-native-reanimated';
-import useInlineEngagementText from 'lib/hooks/inline-engagement-text.react.js';
import type { ReactionInfo } from 'lib/selectors/chat-selectors.js';
+import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js';
import { localIDPrefix } from 'lib/shared/message-utils.js';
import type { MessageInfo } from 'lib/types/message-types.js';
import type { ThreadInfo } from 'lib/types/thread-types.js';
@@ -91,7 +91,7 @@
}
}, [disabled, navigateToThread, sidebarThreadInfo]);
- const repliesText = useInlineEngagementText(sidebarThreadInfo);
+ const repliesText = getInlineEngagementSidebarText(sidebarThreadInfo);
const sidebarStyle = React.useMemo(() => {
const stylesResult = [styles.sidebar];
diff --git a/web/chat/inline-engagement.react.js b/web/chat/inline-engagement.react.js
--- a/web/chat/inline-engagement.react.js
+++ b/web/chat/inline-engagement.react.js
@@ -4,8 +4,8 @@
import * as React from 'react';
import { useModalContext } from 'lib/components/modal-provider.react.js';
-import useInlineEngagementText from 'lib/hooks/inline-engagement-text.react.js';
import type { ReactionInfo } from 'lib/selectors/chat-selectors.js';
+import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js';
import { stringForReactionList } from 'lib/shared/reaction-utils.js';
import type { ThreadInfo } from 'lib/types/thread-types.js';
@@ -23,7 +23,7 @@
function InlineEngagement(props: Props): React.Node {
const { threadInfo, reactions, positioning, label } = props;
const { pushModal, popModal } = useModalContext();
- const repliesText = useInlineEngagementText(threadInfo);
+ const repliesText = getInlineEngagementSidebarText(threadInfo);
const containerClasses = classNames([
css.inlineEngagementContainer,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 12:20 PM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2600911
Default Alt Text
D8609.diff (2 KB)
Attached To
Mode
D8609: [lib/native/web] convert useInlineEngagementText to getInlineEngagmentSidebarText
Attached
Detach File
Event Timeline
Log In to Comment