Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3727607
D3660.id11205.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3660.id11205.diff
View Options
diff --git a/web/modals/threads/color-selector-button.css b/web/modals/threads/color-selector-button.css
new file mode 100644
--- /dev/null
+++ b/web/modals/threads/color-selector-button.css
@@ -0,0 +1,23 @@
+div.container {
+ height: 48px;
+ width: 48px;
+ border-radius: 48px;
+ cursor: pointer;
+ align-items: center;
+ justify-content: center;
+ display: flex;
+ transition: 150ms;
+}
+
+div.active,
+div.container:hover {
+ background-color: var(--shades-black-80);
+ transition: 150ms;
+}
+
+div.colorSplotch {
+ height: 32px;
+ width: 32px;
+ border-radius: 32px;
+ cursor: pointer;
+}
diff --git a/web/modals/threads/color-selector-button.react.js b/web/modals/threads/color-selector-button.react.js
new file mode 100644
--- /dev/null
+++ b/web/modals/threads/color-selector-button.react.js
@@ -0,0 +1,34 @@
+// @flow
+
+import classNames from 'classnames';
+import * as React from 'react';
+
+import css from './color-selector-button.css';
+
+type ColorSelectorButtonProps = {
+ +color: string,
+ +active: boolean,
+};
+function ColorSelectorButton(props: ColorSelectorButtonProps): React.Node {
+ const { color, active } = props;
+
+ const containerClassName = classNames({
+ [css.container]: true,
+ [css.active]: active,
+ });
+
+ const colorSplotchStyle = React.useMemo(
+ () => ({
+ backgroundColor: color,
+ }),
+ [color],
+ );
+
+ return (
+ <div className={containerClassName}>
+ <div className={css.colorSplotch} style={colorSplotchStyle} />
+ </div>
+ );
+}
+
+export default ColorSelectorButton;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 9, 8:54 PM (11 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2839586
Default Alt Text
D3660.id11205.diff (1 KB)
Attached To
Mode
D3660: [web] Introduce `ColorSelectorButton` component with basic styling
Attached
Detach File
Event Timeline
Log In to Comment