diff --git a/web/modals/threads/color-selector.react.js b/web/modals/threads/color-selector.react.js index 74c5f9dd0..d66ddf3f6 100644 --- a/web/modals/threads/color-selector.react.js +++ b/web/modals/threads/color-selector.react.js @@ -1,73 +1,33 @@ // @flow 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'; type ColorSelectorProps = { +currentColor: string, +onColorSelection: (hex: string) => void, }; function ColorSelector(props: ColorSelectorProps): React.Node { const { currentColor, onColorSelection } = props; - return ( -
- - - - - - - - - - -
+ const colorSelectorButtons = React.useMemo( + () => + selectedThreadColors.map(color => ( + + )), + [currentColor, onColorSelection], ); + + return
{colorSelectorButtons}
; } export default ColorSelector;