diff --git a/__test__/features/Events/EventDisplay.test.tsx b/__test__/features/Events/EventDisplay.test.tsx index e67ab99..1d315c2 100644 --- a/__test__/features/Events/EventDisplay.test.tsx +++ b/__test__/features/Events/EventDisplay.test.tsx @@ -1957,7 +1957,8 @@ describe("Helper functions", () => { it("stringAvatar returns correct props", () => { const result = stringAvatar("Alice"); expect(result.children).toBe("A"); - expect(result.style.backgroundColor).toMatch(/^#/); + expect(result.color).toBeDefined(); + expect(typeof result.color).toBe("string"); }); it("InfoRow renders text and link if url is valid", () => { diff --git a/package-lock.json b/package-lock.json index fe589f2..4380626 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@fullcalendar/moment-timezone": "^6.1.19", "@fullcalendar/react": "^6.1.17", "@fullcalendar/timegrid": "^6.1.17", - "@linagora/twake-mui": "1.1.0", + "@linagora/twake-mui": "1.1.1", "@mui/icons-material": "^7.1.2", "@mui/material": "^7.1.2", "@mui/x-date-pickers": "^8.14.0", @@ -82,7 +82,6 @@ "../twake-ui/packages/twake-mui": { "name": "@linagora/twake-mui", "version": "1.1.0", - "extraneous": true, "license": "MIT", "dependencies": { "react": "^18.2.0", @@ -3165,23 +3164,8 @@ } }, "node_modules/@linagora/twake-mui": { - "version": "1.1.0", - "resolved": "https://npm.pkg.github.com/download/@linagora/twake-mui/1.1.0/1c08eca803bbaec80c54c317427cb6090600a27c", - "integrity": "sha512-ryO3L0cgokp1ald3DdviY/QFjkSEfjqADZYeKaG52aE0ubHVY4eV73usIIJ0QDny5IaSZ8dHk38YPWVEOgtUNQ==", - "dependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" - }, - "engines": { - "node": "24.x" - }, - "peerDependencies": { - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@mui/material": "^7.1.2", - "react": "^18.2.0", - "react-dom": "^18.2.0" - } + "resolved": "../twake-ui/packages/twake-mui", + "link": true }, "node_modules/@module-federation/error-codes": { "version": "0.21.6", diff --git a/package.json b/package.json index 0638fc9..2e47625 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@fullcalendar/moment-timezone": "^6.1.19", "@fullcalendar/react": "^6.1.17", "@fullcalendar/timegrid": "^6.1.17", - "@linagora/twake-mui": "1.1.0", + "@linagora/twake-mui": "1.1.1", "@mui/icons-material": "^7.1.2", "@mui/material": "^7.1.2", "@mui/x-date-pickers": "^8.14.0", diff --git a/src/components/Event/EventChip/EventChip.tsx b/src/components/Event/EventChip/EventChip.tsx index d67a9d5..ac3b6e7 100644 --- a/src/components/Event/EventChip/EventChip.tsx +++ b/src/components/Event/EventChip/EventChip.tsx @@ -110,7 +110,7 @@ export function EventChip({ event._def.extendedProps.organizer?.cn ?? event._def.extendedProps.organizer?.cal_address ) - : { style: {}, children: null }; + : { color: undefined, children: null }; return ( {user?.name && user?.family_name @@ -333,17 +332,15 @@ export function Menubar({ }} > {user?.name && user?.family_name ? `${user.name[0]}${user.family_name[0]}` diff --git a/src/features/Settings/SettingsPage.tsx b/src/features/Settings/SettingsPage.tsx index aba7332..e01112a 100644 --- a/src/features/Settings/SettingsPage.tsx +++ b/src/features/Settings/SettingsPage.tsx @@ -418,11 +418,7 @@ export default function SettingsPage() { )} {activeSettingsSubTab === "notifications" && ( - + {t("settings.notifications.deliveryMethod") || "Delivery method"} diff --git a/src/utils/avatarUtils.ts b/src/utils/avatarUtils.ts new file mode 100644 index 0000000..f5c1101 --- /dev/null +++ b/src/utils/avatarUtils.ts @@ -0,0 +1,11 @@ +import { nameToColor } from "@linagora/twake-mui"; + +/** + * Generate a gradient color from a string + * @param str - String to generate color from + * @returns Color name for gradient + */ +export function stringToGradient(str: string): string | undefined { + if (!str) return undefined; + return nameToColor(str); +}