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} />