-
+
{dateLabel}
diff --git a/src/components/Timezone/TimezoneAutocomplete.tsx b/src/components/Timezone/TimezoneAutocomplete.tsx
index 35a5151..92a878d 100644
--- a/src/components/Timezone/TimezoneAutocomplete.tsx
+++ b/src/components/Timezone/TimezoneAutocomplete.tsx
@@ -1,4 +1,4 @@
-import { Autocomplete, TextField } from "@mui/material";
+import { Autocomplete, TextField } from "twake-mui";
import { PublicOutlined as TimezoneIcon } from "@mui/icons-material";
import { useMemo } from "react";
diff --git a/src/features/Events/AttendanceValidation/AttendanceValidation.tsx b/src/features/Events/AttendanceValidation/AttendanceValidation.tsx
index e3dce1f..b1a7e5c 100644
--- a/src/features/Events/AttendanceValidation/AttendanceValidation.tsx
+++ b/src/features/Events/AttendanceValidation/AttendanceValidation.tsx
@@ -1,4 +1,4 @@
-import { Box, Typography } from "@mui/material";
+import { Box, Typography } from "@linagora/twake-mui";
import { Dispatch, SetStateAction } from "react";
import { useI18n } from "twake-i18n";
import { Calendar } from "../../Calendars/CalendarTypes";
diff --git a/src/features/Events/AttendanceValidation/RSVPButton.tsx b/src/features/Events/AttendanceValidation/RSVPButton.tsx
index 2c29c53..8c308d4 100644
--- a/src/features/Events/AttendanceValidation/RSVPButton.tsx
+++ b/src/features/Events/AttendanceValidation/RSVPButton.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@mui/material";
+import { Button } from "@linagora/twake-mui";
import { Dispatch, SetStateAction } from "react";
import { useI18n } from "twake-i18n";
import { useAppDispatch } from "../../../app/hooks";
diff --git a/src/features/Events/EventDisplayPreview.tsx b/src/features/Events/EventDisplayPreview.tsx
index 757104d..ed3e70e 100644
--- a/src/features/Events/EventDisplayPreview.tsx
+++ b/src/features/Events/EventDisplayPreview.tsx
@@ -13,7 +13,7 @@ import PeopleAltOutlinedIcon from "@mui/icons-material/PeopleAltOutlined";
import RepeatIcon from "@mui/icons-material/Repeat";
import SubjectIcon from "@mui/icons-material/Subject";
import VideocamIcon from "@mui/icons-material/Videocam";
-import { Box, Typography } from "@mui/material";
+import { Box, Typography } from "@linagora/twake-mui";
import EventPopover from "./EventModal";
import {
Button,
@@ -23,8 +23,8 @@ import {
Menu,
MenuItem,
Tooltip,
-} from "@mui/material";
-import AvatarGroup from "@mui/material/AvatarGroup";
+} from "@linagora/twake-mui";
+import { AvatarGroup } from "@linagora/twake-mui";
import { useEffect, useState, useRef } from "react";
import { useAppDispatch, useAppSelector } from "../../app/hooks";
import { CalendarName } from "../../components/Calendar/CalendarName";
@@ -49,7 +49,6 @@ import { userAttendee } from "../User/models/attendee";
import { browserDefaultTimeZone } from "../../utils/timezone";
import { AttendanceValidation } from "./AttendanceValidation/AttendanceValidation";
import { Calendar } from "../Calendars/CalendarTypes";
-import { userData } from "../User/userDataTypes";
import { createEventContext } from "./createEventContext";
export default function EventPreviewModal({
@@ -100,7 +99,7 @@ export default function EventPreviewModal({
const attendeePreview = makeAttendeePreview(event.attendee, t);
const hasCheckedSessionStorageRef = useRef(false);
- const [toggleActionMenu, setToggleActionMenu] = useState
(
+ const [toggleActionMenu, setToggleActionMenu] = useState(
null
);
const mailSpaUrl = (window as any).MAIL_SPA_URL ?? null;
@@ -369,7 +368,7 @@ export default function EventPreviewModal({
`${mailSpaUrl}/mailto/?uri=mailto:${event.attendee
.map((a) => a.cal_address)
.filter((mail) => mail !== user.email)
- .join(",")}?subject=${event.title}`
+ .join(",")}?subject=${encodeURIComponent(event.title ?? "")}`
)
}
>
@@ -402,18 +401,28 @@ export default function EventPreviewModal({
eventId
)
);
- setOpenEditModePopup("edit");
+ setOpenEditModePopup("delete");
} else {
onClose({}, "backdropClick");
- await dispatch(
- deleteEventAsync({
- calId,
- eventId,
- eventURL: event.URL,
- })
- );
+ try {
+ const result = await dispatch(
+ deleteEventAsync({
+ calId,
+ eventId,
+ eventURL: event.URL,
+ })
+ );
+
+ // For compatibility with tests that may not mock unwrap
+ if (result && typeof result.unwrap === "function") {
+ await result.unwrap();
+ }
+
+ updateTempList();
+ } catch (error) {
+ console.error("Failed to delete event:", error);
+ }
}
- updateTempList();
}}
>
{t("eventPreview.deleteEvent")}
@@ -616,7 +625,15 @@ export default function EventPreviewModal({
}
text={t("eventPreview.alarmText", {
trigger: t(`event.form.notifications.${event.alarm.trigger}`),
- action: t(`event.form.notifications.${event.alarm.action}`),
+ action: (() => {
+ if (!event.alarm.action) return "";
+ const translationKey = `event.form.notifications.${event.alarm.action}`;
+ const translated = t(translationKey);
+ // If translation returns the key itself, it means translation not found, use raw value
+ return translated === translationKey
+ ? event.alarm.action
+ : translated;
+ })(),
})}
style={{
fontSize: "16px",
diff --git a/src/features/Events/EventModal.tsx b/src/features/Events/EventModal.tsx
index b737700..9b1e4a7 100644
--- a/src/features/Events/EventModal.tsx
+++ b/src/features/Events/EventModal.tsx
@@ -1,5 +1,5 @@
import { CalendarApi, DateSelectArg } from "@fullcalendar/core";
-import { Box, Button } from "@mui/material";
+import { Box, Button } from "twake-mui";
import AddIcon from "@mui/icons-material/Add";
import React, {
useEffect,
diff --git a/src/features/Events/EventUpdateModal.tsx b/src/features/Events/EventUpdateModal.tsx
index 2a1bba4..6ce1e2b 100644
--- a/src/features/Events/EventUpdateModal.tsx
+++ b/src/features/Events/EventUpdateModal.tsx
@@ -1,4 +1,4 @@
-import { Box, Button } from "@mui/material";
+import { Box, Button } from "twake-mui";
import AddIcon from "@mui/icons-material/Add";
import { useEffect, useState, useMemo, useCallback, useRef } from "react";
import { useAppDispatch, useAppSelector } from "../../app/hooks";
diff --git a/src/features/Search/SearchResultsPage.tsx b/src/features/Search/SearchResultsPage.tsx
index 895bf5d..a255838 100644
--- a/src/features/Search/SearchResultsPage.tsx
+++ b/src/features/Search/SearchResultsPage.tsx
@@ -2,8 +2,7 @@ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import RepeatIcon from "@mui/icons-material/Repeat";
import SquareRoundedIcon from "@mui/icons-material/SquareRounded";
import VideocamIcon from "@mui/icons-material/Videocam";
-import { Box, Button, IconButton, Stack, Typography } from "@mui/material";
-import CircularProgress from "@mui/material/CircularProgress";
+import { Box, Button, IconButton, Stack, Typography, CircularProgress } from "twake-mui";
import { useI18n } from "twake-i18n";
import { useState } from "react";
import { useAppDispatch, useAppSelector } from "../../app/hooks";
diff --git a/src/features/Settings/SettingsPage.tsx b/src/features/Settings/SettingsPage.tsx
index c846e40..4d5128b 100644
--- a/src/features/Settings/SettingsPage.tsx
+++ b/src/features/Settings/SettingsPage.tsx
@@ -15,7 +15,7 @@ import {
Snackbar,
Switch,
FormControlLabel,
-} from "@mui/material";
+} from "twake-mui";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import SettingsIcon from "@mui/icons-material/Settings";
// import SyncIcon from "@mui/icons-material/Sync";
diff --git a/src/theme/ThemeProvider.tsx b/src/theme/ThemeProvider.tsx
deleted file mode 100644
index cad62ff..0000000
--- a/src/theme/ThemeProvider.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React from "react";
-import { ThemeProvider } from "@mui/material/styles";
-import { CssBaseline } from "@mui/material";
-import { customTheme } from "./theme";
-
-interface CustomThemeProviderProps {
- children: React.ReactNode;
-}
-
-export function CustomThemeProvider({ children }: CustomThemeProviderProps) {
- return (
-
-
- {children}
-
- );
-}
-
-export { customTheme };
diff --git a/src/theme/theme.ts b/src/theme/theme.ts
deleted file mode 100644
index fd23305..0000000
--- a/src/theme/theme.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { createTheme } from "@mui/material/styles";
-
-// Custom theme for Twake Calendar
-export const customTheme = createTheme({
- palette: {
- text: {
- primary: "#000000",
- secondary: "#717D96",
- secondaryContainer: "#243B55",
- },
- },
- typography: {
- caption: {
- fontSize: "0.75rem",
- fontWeight: 400,
- lineHeight: 1.4,
- color: "#8C9CAF", // Custom secondary text color
- },
- },
- components: {
- // Custom Typography component
- MuiTypography: {
- styleOverrides: {
- // Custom variant for event info text
- caption: {
- fontSize: "13px",
- color: "#717D96",
- },
- },
- },
- // Custom Button component
- // Custom Dialog component
- // Custom DialogActions component
- },
-});
-
-// Export theme type for TypeScript
-export type CustomTheme = typeof customTheme;