Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3b061c0

Browse files
committed
Added bullet lists to selection checkbox and alerts tooltips.
1 parent b50ea7a commit 3b061c0

File tree

3 files changed

+36
-8
lines changed

3 files changed

+36
-8
lines changed

src/components/Tooltip/styles.module.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@
1717
box-shadow: 0px 5px 25px #c6c6c6;
1818
background: #fff;
1919

20+
ul {
21+
margin: 0;
22+
padding: 0;
23+
// list-style: disc inside;
24+
25+
li {
26+
margin: 0;
27+
padding: 0;
28+
29+
&::before {
30+
content: "\2022\00A0";
31+
display: inline;
32+
margin-right: 3px;
33+
}
34+
}
35+
}
36+
2037
.tooltipArrow {
2138
display: block;
2239
top: 100%;

src/routes/WorkPeriods/components/PeriodAlerts/index.jsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@ import styles from "./styles.module.scss";
1515
*/
1616
const PeriodAlerts = ({ alerts, className }) => {
1717
const alertsTooltipContent = useMemo(() => {
18-
return alerts
19-
? alerts.map((alertId) => (
20-
<div key={alertId}>{ALERT_MESSAGE_MAP[alertId]}</div>
21-
))
22-
: null;
18+
if (!alerts) {
19+
return null;
20+
}
21+
if (alerts.length === 1) {
22+
return ALERT_MESSAGE_MAP[alerts[0]];
23+
}
24+
return (
25+
<ul>
26+
{alerts.map((alertId) => (
27+
<li key={alertId}>{ALERT_MESSAGE_MAP[alertId]}</li>
28+
))}
29+
</ul>
30+
);
2331
}, [alerts]);
2432

2533
return (

src/routes/WorkPeriods/components/PeriodItem/index.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,20 +235,23 @@ const PeriodItem = ({
235235
* working period is disabled.
236236
*
237237
* @param {Array} reasonIds array of REASON_DISABLED values
238-
* @returns {?Array}
238+
* @returns {any}
239239
*/
240240
function formatReasonsDisabled(reasonIds) {
241241
if (!reasonIds) {
242242
return null;
243243
}
244+
if (reasonIds.length === 1) {
245+
return REASON_DISABLED_MESSAGE_MAP[reasonIds[0]];
246+
}
244247
const reasons = [];
245248
for (let i = 0, len = reasonIds.length; i < len; i++) {
246249
let reasonId = reasonIds[i];
247250
reasons.push(
248-
<div key={reasonId}>{REASON_DISABLED_MESSAGE_MAP[reasonId]}</div>
251+
<li key={reasonId}>{REASON_DISABLED_MESSAGE_MAP[reasonId]}</li>
249252
);
250253
}
251-
return reasons;
254+
return <ul>{reasons}</ul>;
252255
}
253256

254257
PeriodItem.propTypes = {

0 commit comments

Comments
 (0)