Page MenuHomePhorge

D8845.1765358923.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D8845.1765358923.diff

diff --git a/native/markdown/markdown-chat-mention.react.js b/native/markdown/markdown-chat-mention.react.js
new file mode 100644
--- /dev/null
+++ b/native/markdown/markdown-chat-mention.react.js
@@ -0,0 +1,33 @@
+// @flow
+
+import * as React from 'react';
+import { Text, StyleSheet } from 'react-native';
+
+import { useMarkdownOnPressUtils } from './markdown-utils.js';
+
+type TextProps = React.ElementConfig<typeof Text>;
+type Props = {
+ +hasAccessToChat: boolean,
+ +children: React.Node,
+ ...TextProps,
+};
+function MarkdownChatMention(props: Props): React.Node {
+ const { hasAccessToChat, ...rest } = props;
+ const { isRevealed, onLongPressHandler } = useMarkdownOnPressUtils();
+ const shouldBePressable = hasAccessToChat ? isRevealed : false;
+ return (
+ <Text
+ onLongPress={shouldBePressable ? onLongPressHandler : null}
+ style={styles.mention}
+ {...rest}
+ />
+ );
+}
+
+const styles = StyleSheet.create({
+ mention: {
+ fontWeight: 'bold',
+ },
+});
+
+export default MarkdownChatMention;

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 10, 9:28 AM (16 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5862878
Default Alt Text
D8845.1765358923.diff (1 KB)

Event Timeline