Page MenuHomePhabricator

D3660.id11299.diff
No OneTemporary

D3660.id11299.diff

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: 24px;
+ cursor: pointer;
+ align-items: center;
+ justify-content: center;
+ display: flex;
+ transition: 150ms;
+}
+
+div.active,
+div.container:hover {
+ background-color: var(--color-selector-active-bg);
+ transition: 150ms;
+}
+
+div.colorSplotch {
+ height: 32px;
+ width: 32px;
+ border-radius: 16px;
+ 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,33 @@
+// @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, {
+ [css.active]: active,
+ });
+
+ const colorSplotchStyle = React.useMemo(
+ () => ({
+ backgroundColor: color,
+ }),
+ [color],
+ );
+
+ return (
+ <div className={containerClassName}>
+ <div className={css.colorSplotch} style={colorSplotchStyle} />
+ </div>
+ );
+}
+
+export default ColorSelectorButton;
diff --git a/web/theme.css b/web/theme.css
--- a/web/theme.css
+++ b/web/theme.css
@@ -138,4 +138,5 @@
--label-default-color: var(--shades-white-80);
--subchannels-modal-color: var(--shades-black-60);
--subchannels-modal-color-hover: var(--shades-white-100);
+ --color-selector-active-bg: var(--shades-black-80);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 8:19 PM (10 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2838988
Default Alt Text
D3660.id11299.diff (1 KB)

Event Timeline