fix calendar events styles

This commit is contained in:
Dobromir Popov
2024-04-28 01:10:26 +03:00
parent a0b09320c0
commit 8fe1b182f1
2 changed files with 20 additions and 21 deletions

View File

@ -305,22 +305,22 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => {
}
if (event.isActive) {
switch (event.type) {
case 'assignment':
// backgroundColor = '#48bb78' // always green-500 as we don't pass isConfirmed correctly
//backgroundColor = event.isConfirmed ? '#48bb78' : '#f6e05e'; // green-500 and yellow-300 from Tailwind CSS
break;
case 'recurring':
backgroundColor = '#63b3ed'; // blue-300 from Tailwind CSS
break;
default: // availability
//backgroundColor = '#a0aec0'; // gray-400 from Tailwind CSS
break;
}
} else {
backgroundColor = '#a0aec0'; // Default color for inactive events
// if (event.isActive) {
switch (event.type) {
case 'assignment':
// backgroundColor = '#48bb78' // always green-500 as we don't pass isConfirmed correctly
//backgroundColor = event.isConfirmed ? '#48bb78' : '#f6e05e'; // green-500 and yellow-300 from Tailwind CSS
break;
case 'recurring':
backgroundColor = '#63b3ed'; // blue-300 from Tailwind CSS
break;
default: // availability
//backgroundColor = '#a0aec0'; // gray-400 from Tailwind CSS
break;
}
// } else {
// backgroundColor = '#a0aec0'; // Default color for inactive events
// }
return {
style: {
@ -343,16 +343,14 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => {
const handleMouseLeave = () => setIsHovered(false);
if (currentView !== 'agenda') {
//if event.type is availability show in blue. if it is schedule - green if confirmed, yellow if not confirmed
//if event is not active - show in gray
let bgColorClass = 'bg-gray-500'; // Default color for inactive events
var bgColor = event.isActive ? "" : "bg-gray-500";
var bgColor = "";
//ToDo: fix this. maybe we're missing some properties
// if (event.isFromPreviousMonth) {
// // set opacity to 0.5
// bgColor = "bg-orange-500";
// }
if (event.type === "assignment") {
bgColor = event.isBySystem ? "bg-red-500" : (event.isConfirmed || true ? "bg-green-500" : "bg-yellow-500");
// bgColor = event.isBySystem ? "bg-red-500" : (event.isConfirmed || true ? "bg-green-500" : "bg-yellow-500");
//event.title = event.publisher.name; //ToDo: add other publishers names
//event.title = common.getTimeFomatted(event.startTime) + " - " + common.getTimeFomatted(event.endTime);
@ -360,7 +358,6 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => {
if (event.start !== undefined && event.end !== undefined && event.startTime !== null && event.endTime !== null) {
try {
if (event.type === "recurring") {
//bgColor = "bg-blue-300";
event.title = common.getTimeFomatted(event.startTime) + " - " + common.getTimeFomatted(event.endTime);
}
else {