Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32257986
D8852.1765243093.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8852.1765243093.diff
View Options
diff --git a/web/markdown/markdown-chat-mention.react.js b/web/markdown/markdown-chat-mention.react.js
new file mode 100644
--- /dev/null
+++ b/web/markdown/markdown-chat-mention.react.js
@@ -0,0 +1,22 @@
+// @flow
+
+import * as React from 'react';
+
+import css from './markdown.css';
+
+type MarkdownChatMentionProps = {
+ +hasAccessToChat: boolean,
+ +text: string,
+};
+
+function MarkdownChatMention(props: MarkdownChatMentionProps): React.Node {
+ const { hasAccessToChat, text } = props;
+
+ if (!hasAccessToChat) {
+ return text;
+ }
+
+ return <a className={css.chatMention}>{text}</a>;
+}
+
+export default MarkdownChatMention;
diff --git a/web/markdown/markdown.css b/web/markdown/markdown.css
--- a/web/markdown/markdown.css
+++ b/web/markdown/markdown.css
@@ -70,6 +70,14 @@
div.markdown a {
text-decoration: underline;
}
+div.markdown a.chatMention {
+ text-decoration: none;
+ color: inherit;
+ font-weight: bold;
+}
+div.lightBackground a.chatMention {
+ color: black;
+}
div.lightBackground a {
color: #2a5db0;
}
@@ -87,7 +95,8 @@
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}
-span.spoiler a {
+span.spoiler a,
+span.spoiler a.chatMention {
pointer-events: none;
color: var(--spoiler-text-color);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 9, 1:18 AM (13 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5851891
Default Alt Text
D8852.1765243093.diff (1 KB)
Attached To
Mode
D8852: [web] Introduce markdown component for chat mentions
Attached
Detach File
Event Timeline
Log In to Comment