mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
fix: Use circle icon to display list color
This commit is contained in:
parent
be58e5b0bd
commit
e67790d84f
10 changed files with 82 additions and 31 deletions
|
@ -29,8 +29,8 @@ const ColorPicker = React.memo(({ current, onChange, colors, allowDeletion }) =>
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{allowDeletion && (
|
{current && allowDeletion && (
|
||||||
<Button fluid value={undefined} onClick={onChange} content={t('action.deleteColor')} />
|
<Button fluid value={undefined} onClick={onChange} content={t('action.removeColor')} />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -106,6 +106,11 @@ const ActionsStep = React.memo(
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
<Menu.Item className={styles.menuItem} onClick={hanndleEditColorClick}>
|
||||||
|
{t('action.editColor', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Item className={styles.menuItem} onClick={handleAddCardClick}>
|
<Menu.Item className={styles.menuItem} onClick={handleAddCardClick}>
|
||||||
{t('action.addCard', {
|
{t('action.addCard', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
|
@ -116,11 +121,6 @@ const ActionsStep = React.memo(
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Item className={styles.menuItem} onClick={hanndleEditColorClick}>
|
|
||||||
{t('action.editColor', {
|
|
||||||
context: 'title',
|
|
||||||
})}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item className={styles.menuItem} onClick={handleDeleteClick}>
|
<Menu.Item className={styles.menuItem} onClick={handleDeleteClick}>
|
||||||
{t('action.deleteList', {
|
{t('action.deleteList', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
|
@ -140,7 +140,11 @@ ActionsStep.propTypes = {
|
||||||
onSort: PropTypes.func.isRequired,
|
onSort: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
onColorEdit: PropTypes.func.isRequired,
|
onColorEdit: PropTypes.func.isRequired,
|
||||||
color: PropTypes.string.isRequired,
|
color: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
ActionsStep.defaultProps = {
|
||||||
|
color: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ActionsStep;
|
export default ActionsStep;
|
||||||
|
|
|
@ -122,12 +122,7 @@ const List = React.memo(
|
||||||
ref={innerRef}
|
ref={innerRef}
|
||||||
className={styles.innerWrapper}
|
className={styles.innerWrapper}
|
||||||
>
|
>
|
||||||
<div
|
<div className={styles.outerWrapper}>
|
||||||
className={classNames(
|
|
||||||
styles.outerWrapper,
|
|
||||||
globalStyles[`background${upperFirst(camelCase(color))}`],
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,
|
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,
|
||||||
jsx-a11y/no-static-element-interactions */}
|
jsx-a11y/no-static-element-interactions */}
|
||||||
<div
|
<div
|
||||||
|
@ -136,7 +131,16 @@ const List = React.memo(
|
||||||
onClick={handleHeaderClick}
|
onClick={handleHeaderClick}
|
||||||
>
|
>
|
||||||
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
||||||
<div className={classNames(styles.headerName, color && styles.whiteText)}>
|
<div className={styles.headerName}>
|
||||||
|
{color && (
|
||||||
|
<Icon
|
||||||
|
name="circle"
|
||||||
|
className={classNames(
|
||||||
|
styles.headerNameColor,
|
||||||
|
globalStyles[`color${upperFirst(camelCase(color))}`],
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{name}
|
{name}
|
||||||
</div>
|
</div>
|
||||||
</NameEdit>
|
</NameEdit>
|
||||||
|
@ -162,16 +166,11 @@ const List = React.memo(
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!isPersisted}
|
disabled={!isPersisted}
|
||||||
className={classNames(
|
className={styles.addCardButton}
|
||||||
styles.addCardButton,
|
|
||||||
globalStyles[`background${upperFirst(camelCase(color))}`],
|
|
||||||
)}
|
|
||||||
onClick={handleAddCardClick}
|
onClick={handleAddCardClick}
|
||||||
>
|
>
|
||||||
<PlusMathIcon
|
<PlusMathIcon className={styles.addCardButtonIcon} />
|
||||||
className={classNames(styles.addCardButtonIcon, color && styles.whiteText)}
|
<span className={styles.addCardButtonText}>
|
||||||
/>
|
|
||||||
<span className={classNames(styles.addCardButtonText, color && styles.whiteText)}>
|
|
||||||
{cardIds.length > 0 ? t('action.addAnotherCard') : t('action.addCard')}
|
{cardIds.length > 0 ? t('action.addAnotherCard') : t('action.addCard')}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -188,7 +187,7 @@ List.propTypes = {
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
index: PropTypes.number.isRequired,
|
index: PropTypes.number.isRequired,
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
color: PropTypes.string.isRequired,
|
color: PropTypes.string,
|
||||||
isPersisted: PropTypes.bool.isRequired,
|
isPersisted: PropTypes.bool.isRequired,
|
||||||
cardIds: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
cardIds: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
canEdit: PropTypes.bool.isRequired,
|
canEdit: PropTypes.bool.isRequired,
|
||||||
|
@ -198,4 +197,8 @@ List.propTypes = {
|
||||||
onCardCreate: PropTypes.func.isRequired,
|
onCardCreate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
List.defaultProps = {
|
||||||
|
color: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
export default List;
|
export default List;
|
||||||
|
|
|
@ -127,9 +127,9 @@
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.whiteText {
|
.headerNameColor {
|
||||||
color: #ffffff;
|
line-height: 1;
|
||||||
fill: #ffffff;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.innerWrapper {
|
.innerWrapper {
|
||||||
|
|
|
@ -183,7 +183,6 @@ export default {
|
||||||
deleteCard: 'Karte löschen',
|
deleteCard: 'Karte löschen',
|
||||||
deleteCard_title: 'Karte löschen',
|
deleteCard_title: 'Karte löschen',
|
||||||
deleteComment: 'Kommentar löschen',
|
deleteComment: 'Kommentar löschen',
|
||||||
deleteColor: 'Farbe löschen',
|
|
||||||
deleteImage: 'Bild löschen',
|
deleteImage: 'Bild löschen',
|
||||||
deleteLabel: 'Label löschen',
|
deleteLabel: 'Label löschen',
|
||||||
deleteList: 'Liste löschen',
|
deleteList: 'Liste löschen',
|
||||||
|
@ -214,6 +213,7 @@ export default {
|
||||||
moveCard_title: 'Karte bewegen',
|
moveCard_title: 'Karte bewegen',
|
||||||
remove: 'Löschen',
|
remove: 'Löschen',
|
||||||
removeBackground: 'Hintergrund löschen',
|
removeBackground: 'Hintergrund löschen',
|
||||||
|
removeColor: 'Farbe löschen',
|
||||||
removeCover_title: 'Vorschau löschen',
|
removeCover_title: 'Vorschau löschen',
|
||||||
removeFromBoard: 'Vom Board entfernen',
|
removeFromBoard: 'Vom Board entfernen',
|
||||||
removeFromProject: 'Vom Projekt entfernen',
|
removeFromProject: 'Vom Projekt entfernen',
|
||||||
|
|
|
@ -201,7 +201,6 @@ export default {
|
||||||
deleteCard: 'Delete card',
|
deleteCard: 'Delete card',
|
||||||
deleteCard_title: 'Delete Card',
|
deleteCard_title: 'Delete Card',
|
||||||
deleteComment: 'Delete comment',
|
deleteComment: 'Delete comment',
|
||||||
deleteColor: 'Delete color',
|
|
||||||
deleteImage: 'Delete image',
|
deleteImage: 'Delete image',
|
||||||
deleteLabel: 'Delete label',
|
deleteLabel: 'Delete label',
|
||||||
deleteList: 'Delete list',
|
deleteList: 'Delete list',
|
||||||
|
@ -235,6 +234,7 @@ export default {
|
||||||
moveCard_title: 'Move Card',
|
moveCard_title: 'Move Card',
|
||||||
remove: 'Remove',
|
remove: 'Remove',
|
||||||
removeBackground: 'Remove background',
|
removeBackground: 'Remove background',
|
||||||
|
removeColor: 'Remove color',
|
||||||
removeCover_title: 'Remove Cover',
|
removeCover_title: 'Remove Cover',
|
||||||
removeFromBoard: 'Remove from board',
|
removeFromBoard: 'Remove from board',
|
||||||
removeFromProject: 'Remove from project',
|
removeFromProject: 'Remove from project',
|
||||||
|
|
|
@ -197,7 +197,6 @@ export default {
|
||||||
deleteCard: 'Delete card',
|
deleteCard: 'Delete card',
|
||||||
deleteCard_title: 'Delete Card',
|
deleteCard_title: 'Delete Card',
|
||||||
deleteComment: 'Delete comment',
|
deleteComment: 'Delete comment',
|
||||||
deleteColor: 'Delete color',
|
|
||||||
deleteImage: 'Delete image',
|
deleteImage: 'Delete image',
|
||||||
deleteLabel: 'Delete label',
|
deleteLabel: 'Delete label',
|
||||||
deleteList: 'Delete list',
|
deleteList: 'Delete list',
|
||||||
|
@ -231,6 +230,7 @@ export default {
|
||||||
moveCard_title: 'Move Card',
|
moveCard_title: 'Move Card',
|
||||||
remove: 'Remove',
|
remove: 'Remove',
|
||||||
removeBackground: 'Remove background',
|
removeBackground: 'Remove background',
|
||||||
|
removeColor: 'Remove color',
|
||||||
removeCover_title: 'Remove Cover',
|
removeCover_title: 'Remove Cover',
|
||||||
removeFromBoard: 'Remove from board',
|
removeFromBoard: 'Remove from board',
|
||||||
removeFromProject: 'Remove from project',
|
removeFromProject: 'Remove from project',
|
||||||
|
|
|
@ -384,4 +384,46 @@
|
||||||
.backgroundRedCurtain {
|
.backgroundRedCurtain {
|
||||||
background: radial-gradient(circle 371px at 2.9% 14.3%, rgba(255, 0, 102, 1) 0%, rgba(80, 5, 35, 1) 100.7%) !important;
|
background: radial-gradient(circle 371px at 2.9% 14.3%, rgba(255, 0, 102, 1) 0%, rgba(80, 5, 35, 1) 100.7%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Colors */
|
||||||
|
|
||||||
|
.colorBerryRed {
|
||||||
|
color: #e04556 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorPumpkinOrange {
|
||||||
|
color: #f0982d !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorLagoonBlue {
|
||||||
|
color: #109dc0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorPinkTulip {
|
||||||
|
color: #f97394 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorLightMud {
|
||||||
|
color: #c7a57b !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorOrangePeel {
|
||||||
|
color: #fab623 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorBrightMoss {
|
||||||
|
color: #a5c261 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorAntiqueBlue {
|
||||||
|
color: #6c99bb !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorDarkGranite {
|
||||||
|
color: #8b8680 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorLaguneBlue {
|
||||||
|
color: #00b4b1 !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
isIn: List.COLORS,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,6 +27,7 @@ const COLORS = [
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
SortTypes,
|
SortTypes,
|
||||||
|
COLORS,
|
||||||
|
|
||||||
attributes: {
|
attributes: {
|
||||||
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
||||||
|
@ -43,8 +44,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
allowNull: true,
|
|
||||||
isIn: COLORS,
|
isIn: COLORS,
|
||||||
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue