Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3358180
D3702.id11366.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
D3702.id11366.diff
View Options
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -95,7 +95,9 @@
'575757': 10,
};
-const selectedThreadColors = Object.keys(selectedThreadColorsObj);
+const selectedThreadColors: $ReadOnlyArray<string> = Object.keys(
+ selectedThreadColorsObj,
+);
export type SelectedThreadColors = $Keys<typeof selectedThreadColorsObj>;
function generateRandomColor(): string {
@@ -1420,4 +1422,5 @@
removeMemberFromThread,
switchMemberAdminRoleInThread,
getAvailableThreadMemberActions,
+ selectedThreadColors,
};
diff --git a/web/modals/threads/color-selector.react.js b/web/modals/threads/color-selector.react.js
--- a/web/modals/threads/color-selector.react.js
+++ b/web/modals/threads/color-selector.react.js
@@ -2,6 +2,8 @@
import * as React from 'react';
+import { selectedThreadColors } from 'lib/shared/thread-utils';
+
import ColorSelectorButton from './color-selector-button.react';
import css from './color-selector.css';
@@ -16,54 +18,54 @@
<div className={css.container}>
<div className={css.row}>
<ColorSelectorButton
- color="4B87AA"
+ color={selectedThreadColors[0]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="5C9F5F"
+ color={selectedThreadColors[1]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="B8753D"
+ color={selectedThreadColors[2]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="AA4B4B"
+ color={selectedThreadColors[3]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="6D49AB"
+ color={selectedThreadColors[4]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
</div>
<div className={css.row}>
<ColorSelectorButton
- color="C85000"
+ color={selectedThreadColors[5]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="008F83"
+ color={selectedThreadColors[6]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="648CAA"
+ color={selectedThreadColors[7]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="57697F"
+ color={selectedThreadColors[8]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
<ColorSelectorButton
- color="575757"
+ color={selectedThreadColors[9]}
currentColor={currentColor}
onColorSelection={onColorSelection}
/>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 3:36 AM (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577909
Default Alt Text
D3702.id11366.diff (3 KB)
Attached To
Mode
D3702: [web] Pull colors in `ColorSelector` from `selectedThreadColors`
Attached
Detach File
Event Timeline
Log In to Comment