Skip to content

Commit 27037e0

Browse files
committed
💄(ui) make due date blocks more visual
1 parent 474a1cc commit 27037e0

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

client/src/components/CardModal/CardModal.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ const CardModal = React.memo(
433433
<button type="button" className="bare-button">
434434
<DueDate
435435
size="medium"
436-
withStatusIcon
437436
value={dueDate}
438437
isCompleted={isDueDateCompleted}
439438
onClick={() => {}}
@@ -442,12 +441,7 @@ const CardModal = React.memo(
442441
</DueDateEditPopover>
443442
</>
444443
) : (
445-
<DueDate
446-
size="medium"
447-
withStatusIcon
448-
value={dueDate}
449-
isCompleted={isDueDateCompleted}
450-
/>
444+
<DueDate size="medium" value={dueDate} isCompleted={isDueDateCompleted} />
451445
)}
452446
</div>
453447
</div>

client/src/ui/DueDate/DueDate.jsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,12 @@ const FULL_DATE_FORMAT_BY_SIZE = {
3737
const STATUS_ICON_PROPS_BY_STATUS = {
3838
[STATUSES.DUE_SOON]: {
3939
name: 'warning',
40-
color: 'var(--c--contextuals--border--semantic--warning--primary)',
4140
},
4241
[STATUSES.OVERDUE]: {
4342
name: 'hourglass_bottom',
44-
color: 'var(--c--contextuals--border--semantic--error--primary)',
4543
},
4644
[STATUSES.COMPLETED]: {
4745
name: 'check_box',
48-
color: 'var(--c--contextuals--border--semantic--success--primary)',
4946
},
5047
};
5148

@@ -67,7 +64,7 @@ const getStatus = (dateTime, isCompleted) => {
6764
return null;
6865
};
6966

70-
const DueDate = React.memo(({ value, size, isCompleted, isDisabled, withStatusIcon, onClick }) => {
67+
const DueDate = React.memo(({ value, size, isCompleted, isDisabled, onClick }) => {
7168
const [t] = useTranslation();
7269
const forceUpdate = useForceUpdate();
7370

@@ -109,15 +106,15 @@ const DueDate = React.memo(({ value, size, isCompleted, isDisabled, withStatusIc
109106
className={classNames(
110107
styles.wrapper,
111108
styles[`wrapper${upperFirst(size)}`],
112-
!withStatusIcon && statusRef.current && styles[`wrapper${upperFirst(statusRef.current)}`],
109+
statusRef.current && styles[`wrapper${upperFirst(statusRef.current)}`],
113110
onClick && styles.wrapperHoverable,
114111
)}
115112
>
116113
{t(`format:${dateFormat}`, {
117114
value,
118115
postProcess: 'formatDate',
119116
})}
120-
{withStatusIcon && statusRef.current && (
117+
{statusRef.current && (
121118
<Icon
122119
size="small"
123120
type="outlined"
@@ -143,17 +140,13 @@ DueDate.propTypes = {
143140
size: PropTypes.oneOf(Object.values(SIZES)),
144141
isCompleted: PropTypes.bool.isRequired,
145142
isDisabled: PropTypes.bool,
146-
withStatusIcon: PropTypes.bool,
147143
onClick: PropTypes.func,
148-
onCompletionToggle: PropTypes.func,
149144
};
150145

151146
DueDate.defaultProps = {
152147
size: SIZES.MEDIUM,
153148
isDisabled: false,
154-
withStatusIcon: false,
155149
onClick: undefined,
156-
onCompletionToggle: undefined,
157150
};
158151

159152
export default DueDate;

client/src/ui/DueDate/DueDate.module.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,35 @@
2626
margin-left: 4px;
2727
}
2828

29+
/* Statuses */
30+
31+
.wrapperDueSoon {
32+
background-color: var(--c--contextuals--background--semantic--warning--secondary);
33+
color: var(--c--contextuals--content--semantic--warning--secondary);
34+
35+
&:hover {
36+
background-color: var(--c--contextuals--background--semantic--warning--secondary-hover);
37+
}
38+
}
39+
40+
.wrapperOverdue {
41+
background-color: var(--c--contextuals--background--semantic--error--secondary);
42+
color: var(--c--contextuals--content--semantic--error--secondary);
43+
44+
&:hover {
45+
background-color: var(--c--contextuals--background--semantic--error--secondary-hover);
46+
}
47+
}
48+
49+
.wrapperCompleted {
50+
background-color: var(--c--contextuals--background--semantic--success--secondary);
51+
color: var(--c--contextuals--content--semantic--success--secondary);
52+
53+
&:hover {
54+
background-color: var(--c--contextuals--background--semantic--success--secondary-hover);
55+
}
56+
}
57+
2958
/* Sizes */
3059

3160
.wrapperTiny {

0 commit comments

Comments
 (0)