Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3719749
D9393.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D9393.diff
View Options
diff --git a/native/chat/text-message.react.js b/native/chat/text-message.react.js
--- a/native/chat/text-message.react.js
+++ b/native/chat/text-message.react.js
@@ -63,6 +63,7 @@
+chatContext: ?ChatContextType,
// MarkdownContext
+isLinkModalActive: boolean,
+ +isUserProfileBottomSheetActive: boolean,
+canEditMessage: boolean,
+canTogglePins: boolean,
};
@@ -89,6 +90,7 @@
overlayContext,
chatContext,
isLinkModalActive,
+ isUserProfileBottomSheetActive,
canCreateSidebarFromMessage,
canEditMessage,
canTogglePins,
@@ -185,9 +187,19 @@
const {
message,
- props: { verticalBounds, isLinkModalActive },
+ props: {
+ verticalBounds,
+ isLinkModalActive,
+ isUserProfileBottomSheetActive,
+ },
} = this;
- if (!message || !verticalBounds || isLinkModalActive) {
+
+ if (
+ !message ||
+ !verticalBounds ||
+ isLinkModalActive ||
+ isUserProfileBottomSheetActive
+ ) {
return;
}
@@ -251,7 +263,11 @@
const markdownContext = React.useContext(MarkdownContext);
invariant(markdownContext, 'markdownContext should be set');
- const { linkModalActive, clearMarkdownContextData } = markdownContext;
+ const {
+ linkModalActive,
+ userProfileBottomSheetActive,
+ clearMarkdownContextData,
+ } = markdownContext;
const key = messageKey(props.item.messageInfo);
@@ -259,6 +275,8 @@
// default to false. The likely situation where the former statement
// evaluates to null is when the thread is opened for the first time.
const isLinkModalActive = linkModalActive[key] ?? false;
+ const isUserProfileBottomSheetActive =
+ userProfileBottomSheetActive[key] ?? false;
const canCreateSidebarFromMessage = useCanCreateSidebarFromMessage(
props.item.threadInfo,
@@ -287,6 +305,7 @@
overlayContext={overlayContext}
chatContext={chatContext}
isLinkModalActive={isLinkModalActive}
+ isUserProfileBottomSheetActive={isUserProfileBottomSheetActive}
canEditMessage={canEditMessage}
canTogglePins={canTogglePins}
/>
diff --git a/native/markdown/markdown-context-provider.react.js b/native/markdown/markdown-context-provider.react.js
--- a/native/markdown/markdown-context-provider.react.js
+++ b/native/markdown/markdown-context-provider.react.js
@@ -13,6 +13,11 @@
[key: string]: boolean,
}>({});
+ const [userProfileBottomSheetActive, setUserProfileBottomSheetActive] =
+ React.useState<{
+ [key: string]: boolean,
+ }>({});
+
const [spoilerRevealed, setSpoilerRevealed] = React.useState<{
[key: string]: {
[key: number]: boolean,
@@ -21,6 +26,7 @@
const clearMarkdownContextData = React.useCallback(() => {
setLinkModalActive({});
+ setUserProfileBottomSheetActive({});
setSpoilerRevealed({});
}, []);
@@ -28,6 +34,8 @@
() => ({
setLinkModalActive,
linkModalActive,
+ userProfileBottomSheetActive,
+ setUserProfileBottomSheetActive,
setSpoilerRevealed,
spoilerRevealed,
clearMarkdownContextData,
@@ -35,6 +43,8 @@
[
setLinkModalActive,
linkModalActive,
+ setUserProfileBottomSheetActive,
+ userProfileBottomSheetActive,
setSpoilerRevealed,
spoilerRevealed,
clearMarkdownContextData,
diff --git a/native/markdown/markdown-context.js b/native/markdown/markdown-context.js
--- a/native/markdown/markdown-context.js
+++ b/native/markdown/markdown-context.js
@@ -7,6 +7,8 @@
export type MarkdownContextType = {
+setLinkModalActive: SetState<{ [key: string]: boolean }>,
+linkModalActive: { [key: string]: boolean },
+ +setUserProfileBottomSheetActive: SetState<{ [key: string]: boolean }>,
+ +userProfileBottomSheetActive: { [key: string]: boolean },
+setSpoilerRevealed: SetState<{ [key: string]: { [key: number]: boolean } }>,
+spoilerRevealed: { [key: string]: { [key: number]: boolean } },
+clearMarkdownContextData: () => void,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 9, 11:51 AM (9 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2834312
Default Alt Text
D9393.diff (3 KB)
Attached To
Mode
D9393: [native] introduce userProfileBottomSheetActive state to markdown context
Attached
Detach File
Event Timeline
Log In to Comment