From 4821d407a7ce8344e74d1bbbd9c56028801d9b67 Mon Sep 17 00:00:00 2001 From: Lukas Corona <33840479+lukascorona@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:58:59 +0100 Subject: [PATCH] feat: Ability to set list color indicator (#1033) Closes #840 --- .../components/ColorPicker/ColorPicker.jsx | 52 +++++ .../ColorPicker/ColorPicker.module.scss | 40 ++++ client/src/components/ColorPicker/index.js | 3 + client/src/components/LabelsStep/Editor.jsx | 23 +- .../components/LabelsStep/Editor.module.scss | 39 ---- client/src/components/List/ActionsStep.jsx | 198 +++++++++++------- client/src/components/List/List.jsx | 37 +++- client/src/components/List/List.module.scss | 5 + .../ProjectSettingsModal/BackgroundPane.jsx | 27 +-- client/src/constants/ListColors.js | 12 ++ client/src/containers/ListContainer.js | 3 +- client/src/locales/de-DE/core.js | 2 + client/src/locales/en-GB/core.js | 2 + client/src/locales/en-US/core.js | 2 + client/src/models/List.js | 1 + client/src/styles.module.scss | 42 ++++ server/api/controllers/lists/update.js | 7 +- server/api/models/List.js | 19 ++ .../20250131202710_add_list_color.js | 17 ++ 19 files changed, 365 insertions(+), 166 deletions(-) create mode 100644 client/src/components/ColorPicker/ColorPicker.jsx create mode 100644 client/src/components/ColorPicker/ColorPicker.module.scss create mode 100644 client/src/components/ColorPicker/index.js create mode 100644 client/src/constants/ListColors.js create mode 100644 server/db/migrations/20250131202710_add_list_color.js diff --git a/client/src/components/ColorPicker/ColorPicker.jsx b/client/src/components/ColorPicker/ColorPicker.jsx new file mode 100644 index 00000000..58a12710 --- /dev/null +++ b/client/src/components/ColorPicker/ColorPicker.jsx @@ -0,0 +1,52 @@ +import classNames from 'classnames'; +import camelCase from 'lodash/camelCase'; +import upperFirst from 'lodash/upperFirst'; +import PropTypes from 'prop-types'; +import React from 'react'; +import { Button } from 'semantic-ui-react'; +import { useTranslation } from 'react-i18next'; + +import globalStyles from '../../styles.module.scss'; +import styles from './ColorPicker.module.scss'; + +const ColorPicker = React.memo(({ current, onChange, colors, allowDeletion }) => { + const { t } = useTranslation(); + return ( + <> +
+ {colors.map((color) => ( +
+ {current && allowDeletion && ( +