Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3534625
D3181.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
D3181.diff
View Options
diff --git a/web/chat/chat-thread-list-item-menu.react.js b/web/chat/chat-thread-list-item-menu.react.js
--- a/web/chat/chat-thread-list-item-menu.react.js
+++ b/web/chat/chat-thread-list-item-menu.react.js
@@ -1,6 +1,5 @@
// @flow
-import classNames from 'classnames';
import * as React from 'react';
import {
@@ -17,6 +16,7 @@
useDispatchActionPromise,
} from 'lib/utils/action-utils';
+import Button from '../components/button.react';
import SWMansionIcon from '../SWMansionIcon.react';
import css from './chat-thread-list.css';
@@ -74,24 +74,22 @@
}`;
const menuIconSize = renderStyle === 'chat' ? 24 : 16;
+
+ let btn;
+ if (menuVisible) {
+ btn = (
+ <Button variant="toggle_read" onClick={toggleUnreadStatus}>
+ {toggleUnreadStatusButtonText}
+ </Button>
+ );
+ }
+
return (
<div className={css.menu} onMouseLeave={hideMenu}>
<button onClick={toggleMenu}>
<SWMansionIcon icon="menu-vertical" size={menuIconSize} />
</button>
- <div
- className={classNames(css.menuContent, {
- [css.menuContentVisible]: menuVisible,
- })}
- >
- <ul>
- <li>
- <button onClick={toggleUnreadStatus}>
- {toggleUnreadStatusButtonText}
- </button>
- </li>
- </ul>
- </div>
+ <div>{btn}</div>
</div>
);
}
diff --git a/web/chat/chat-thread-list.css b/web/chat/chat-thread-list.css
--- a/web/chat/chat-thread-list.css
+++ b/web/chat/chat-thread-list.css
@@ -145,6 +145,7 @@
.menu {
position: relative;
display: flex;
+ padding: 5px;
justify-content: flex-end;
}
.menu > button {
@@ -172,16 +173,7 @@
border-radius: 5px;
box-shadow: 1px 1px 5px 2px #00000022;
}
-.menuContentVisible {
- display: block;
-}
-.menuContent ul {
- list-style: none;
-}
-.menuContent li:not(:last-child) {
- border-bottom: 1px solid #dddddd;
-}
-.menuContent button {
+button.menuContent {
border: none;
cursor: pointer;
padding: 10px;
diff --git a/web/components/button.css b/web/components/button.css
--- a/web/components/button.css
+++ b/web/components/button.css
@@ -32,3 +32,16 @@
border-radius: 50%;
padding: 0;
}
+
+.unread {
+ background: var(--unread-btn-bg);
+ color: var(--fg);
+ position: absolute;
+ z-index: 1;
+ font-size: var(--xs-font-12);
+ font-weight: var(--semi-bold);
+ top: 0;
+ right: 25px;
+ width: max-content;
+ padding: 10px;
+}
diff --git a/web/components/button.react.js b/web/components/button.react.js
--- a/web/components/button.react.js
+++ b/web/components/button.react.js
@@ -8,7 +8,7 @@
type Props = {
+onClick: (event: SyntheticEvent<HTMLButtonElement>) => void,
+children: React.Node,
- +variant?: 'primary' | 'secondary' | 'danger' | 'round',
+ +variant?: 'primary' | 'secondary' | 'danger' | 'round' | 'toggle_read',
+type?: string,
+disabled?: boolean,
+className?: string,
diff --git a/web/theme.css b/web/theme.css
--- a/web/theme.css
+++ b/web/theme.css
@@ -1,6 +1,6 @@
:root {
- /* Never use color values defined here directly in CSS. Add color variables to "Color Theme" below
-
+ /* Never use color values defined here directly in CSS. Add color variables to "Color Theme" below
+
The reason we never use color values defined here directly in CSS is
1. It makes changing themes from light / dark / user generated impossible.
@@ -101,4 +101,5 @@
--thread-ancestor-keyserver-border: var(--shades-black-70);
--thread-ancestor-color-light: var(--shades-white-70);
--thread-ancestor-color-dark: var(--shades-black-100);
+ --unread-btn-bg: var(--shades-black-80);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 12:46 PM (11 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2706841
Default Alt Text
D3181.diff (3 KB)
Attached To
Mode
D3181: [web] [darkmode] unread button
Attached
Detach File
Event Timeline
Log In to Comment