Skip to content

Commit e8ec80b

Browse files
committed
fix(CSCalendar): add effect to strip native titles from calendar cells on value change
1 parent 1a58fb8 commit e8ec80b

2 files changed

Lines changed: 38 additions & 37 deletions

File tree

src/assets/scss/components/_event-popup.scss

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
background: linear-gradient(180deg, var(--bg-color-alt, #fff), #fbfbfb);
9999
border-radius: 10px;
100100
box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
101-
padding: 16px;
101+
padding: 18px 20px;
102102
color: var(--text-color);
103103
font-size: 14px;
104104
direction: rtl;
@@ -131,7 +131,7 @@
131131
align-items: center;
132132
justify-content: space-between;
133133
gap: 12px;
134-
margin-bottom: 10px;
134+
margin-bottom: 14px;
135135
}
136136
.event-popup__subtitle {
137137
font-size: 12px;
@@ -200,53 +200,47 @@
200200
.event-popup__row {
201201
display: flex;
202202
gap: 12px;
203-
margin-bottom: 10px;
204-
align-items: center;
203+
margin-bottom: 12px;
204+
align-items: flex-start;
205+
line-height: 1.5;
206+
207+
&:last-child {
208+
margin-bottom: 0;
209+
}
205210
}
206211
.event-popup__label {
207-
min-width: 84px;
212+
min-width: 96px;
208213
color: rgba(0, 0, 0, 0.58);
209214
font-weight: 700;
210215
text-align: right;
211216
letter-spacing: 0.2px;
212217
flex: 0 0 auto;
218+
padding-top: 2px;
213219
}
214220
.event-popup__value {
215221
flex: 1 1 auto;
216222
word-break: break-word;
217-
color: rgba(0, 0, 0, 0.8);
223+
color: rgba(0, 0, 0, 0.86);
218224
}
219225

220226
.event-popup__link {
221-
color: var(--link-color, #2f6fed);
222-
text-decoration: none;
223-
font-weight: 700;
224-
display: inline-block;
225-
padding: 6px 10px;
226-
border-radius: 8px;
227-
transition:
228-
background 120ms ease,
229-
transform 80ms ease;
230-
}
231-
.event-popup__link--primary {
232-
background: linear-gradient(
233-
90deg,
234-
rgba(47, 111, 237, 0.12),
235-
rgba(47, 111, 237, 0.06)
236-
);
237-
border: 1px solid rgba(47, 111, 237, 0.1);
238-
color: var(--link-color, #2f6fed);
239-
}
240-
.event-popup__link:hover {
241-
background: rgba(47, 111, 237, 0.06);
242-
transform: translateY(-1px);
227+
color: #1677ff;
243228
text-decoration: none;
229+
font-weight: 600;
230+
display: inline-flex;
231+
align-items: center;
232+
gap: 6px;
233+
234+
&:hover {
235+
color: #165bad;
236+
text-decoration: underline;
237+
}
244238
}
245239

246240
.event-popup__footer {
247241
display: flex;
248242
justify-content: space-between;
249-
margin-top: 12px;
243+
margin-top: 14px;
250244
align-items: center;
251245
gap: 12px;
252246
}
@@ -264,17 +258,11 @@
264258

265259
.event-popup__actions {
266260
display: flex;
267-
gap: 8px;
268-
}
269-
.event-popup__actions .ant-btn {
270-
padding: 8px 14px;
271-
border-radius: 8px;
272-
font-weight: 600;
273-
box-shadow: none;
261+
gap: 10px;
274262
}
275263

276264
.event-popup__creator {
277-
margin-top: 10px;
265+
margin-top: 14px;
278266
display: flex;
279267
justify-content: flex-end;
280268
}

src/components/CSCalendar.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,19 @@ const CSCalendar = ({ setAnnouncementData, addToCurrentWeek }) => {
288288
setYearMonth(currentMonth.toString() + currentYear.toString());
289289
}, [value]);
290290

291+
useEffect(() => {
292+
const stripNativeTitles = () => {
293+
document
294+
.querySelectorAll(
295+
".ant-picker-cell[title], .ant-picker-cell-inner[title]"
296+
)
297+
.forEach((node) => node.removeAttribute("title"));
298+
};
299+
300+
const raf = requestAnimationFrame(stripNativeTitles);
301+
return () => cancelAnimationFrame(raf);
302+
}, [value, yearMonth]);
303+
291304
return (
292305
<Flex justify="space-between" vertical className="calendar-section">
293306
<Calendar

0 commit comments

Comments
 (0)