ISSUE-91 add lock icon indication for private events (#98)

This commit is contained in:
ducdonghiem
2025-09-11 14:17:54 +07:00
committed by GitHub
parent fbf4cf418c
commit 4b71a6e3c7
2 changed files with 96 additions and 3 deletions
+5 -2
View File
@@ -31,6 +31,7 @@ import { createSelector } from "@reduxjs/toolkit";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
import ClearIcon from "@mui/icons-material/Clear";
import AccessTimeIcon from "@mui/icons-material/AccessTime";
import LockIcon from '@mui/icons-material/Lock';
import { userAttendee } from "../../features/User/userDataTypes";
const computeStartOfTheWeek = (date: Date): Date => {
@@ -407,6 +408,7 @@ export default function CalendarApp() {
if (!calendars[arg.event._def.extendedProps.calId]) return;
const attendees = event._def.extendedProps.attendee || [];
const isPrivate = event._def.extendedProps.class === "PRIVATE" || event._def.extendedProps.class === "CONFIDENTIAL";
let Icon = null;
let titleStyle: React.CSSProperties = {};
const ownerEmails = new Set(
@@ -437,8 +439,9 @@ export default function CalendarApp() {
}
return (
<div>
{Icon && <Icon fontSize="small" />}
<div style={{ display: 'flex', alignItems: 'center' }}>
{isPrivate && <LockIcon data-testid="lock-icon" fontSize="small" style={{ marginRight: '4px' }} />}
{Icon && <Icon fontSize="small" style={{ marginRight: '4px' }}/>}
<span style={titleStyle}>{event.title}</span>
</div>
);