mirror of
https://github.com/plankanban/planka.git
synced 2025-08-09 07:25:24 +02:00
期限切れの場合に背景を赤に変更(ボード表示のカードのみ)
This commit is contained in:
parent
6ba243cbcf
commit
87e8c52971
3 changed files with 22 additions and 3 deletions
|
@ -86,6 +86,8 @@ const Card = React.memo(
|
|||
|
||||
const ActionsPopup = usePopup(ActionsStep);
|
||||
|
||||
const isExpiredDueDate = dueDate && dueDate.getTime() < new Date().getTime();
|
||||
|
||||
const contentNode = (
|
||||
<>
|
||||
{coverUrl && <img src={coverUrl} alt="" className={styles.cover} />}
|
||||
|
@ -119,7 +121,7 @@ const Card = React.memo(
|
|||
)}
|
||||
{dueDate && (
|
||||
<span className={classNames(styles.attachment, styles.attachmentLeft)}>
|
||||
<DueDate value={dueDate} size="tiny" />
|
||||
<DueDate value={dueDate} size="tiny" isExpired={isExpiredDueDate} />
|
||||
</span>
|
||||
)}
|
||||
{stopwatch && (
|
||||
|
|
|
@ -18,13 +18,15 @@ const FORMATS = {
|
|||
medium: 'longDateTime',
|
||||
};
|
||||
|
||||
const DueDate = React.memo(({ value, size, isDisabled, onClick }) => {
|
||||
const DueDate = React.memo(({ value, size, isDisabled, onClick, isExpired }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const wrapperClass = isExpired ? styles.wrapperExpired : styles.wrapper;
|
||||
|
||||
const contentNode = (
|
||||
<span
|
||||
className={classNames(
|
||||
styles.wrapper,
|
||||
wrapperClass,
|
||||
styles[`wrapper${upperFirst(size)}`],
|
||||
onClick && styles.wrapperHoverable,
|
||||
)}
|
||||
|
@ -50,12 +52,14 @@ DueDate.propTypes = {
|
|||
size: PropTypes.oneOf(Object.values(SIZES)),
|
||||
isDisabled: PropTypes.bool,
|
||||
onClick: PropTypes.func,
|
||||
isExpired: PropTypes.bool,
|
||||
};
|
||||
|
||||
DueDate.defaultProps = {
|
||||
size: SIZES.MEDIUM,
|
||||
isDisabled: false,
|
||||
onClick: undefined,
|
||||
isExpired: false,
|
||||
};
|
||||
|
||||
export default DueDate;
|
||||
|
|
|
@ -20,6 +20,18 @@
|
|||
vertical-align: top;
|
||||
}
|
||||
|
||||
.wrapperExpired {
|
||||
background: red;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
color: #ffffff;
|
||||
display: inline-block;
|
||||
outline: none;
|
||||
text-align: left;
|
||||
transition: background 0.3s ease;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.wrapperHoverable:hover {
|
||||
background: #d2d8dc;
|
||||
color: #17394d;
|
||||
|
@ -43,4 +55,5 @@
|
|||
line-height: 20px;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue