From 40d30ec3a57559201ea1e805ebb48cf052081de2 Mon Sep 17 00:00:00 2001 From: Giuseppe Del Campo Date: Tue, 10 Oct 2023 11:11:06 +0200 Subject: [PATCH] Few adjustments - Enable SSR load theme - Fix tutors' groups label and href --- pages/_app.tsx | 10 ++++++++-- services/LocalizationService.ts | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index e6a89caa..133f1d64 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -6,10 +6,11 @@ import { CookiesProvider } from 'react-cookie'; import { ThemeProvider, useTheme } from '@fluentui/react'; import { Theme } from '../services/Utils'; import { initializeIcons } from '@fluentui/react/lib/Icons'; -import { registerIcons, setIconOptions } from '@fluentui/react/lib/Styling'; +import { loadTheme, registerIcons, setIconOptions } from '@fluentui/react/lib/Styling'; import { registeredIcons } from 'services/Icons'; import { GlobalProvider } from 'services/GlobalContext'; import { useContext } from 'react'; +import { buildLightTheme } from 'services/Themes'; import GlobalContext from '../services/GlobalContext'; import Script from 'next/script'; import Head from 'next/head'; @@ -19,7 +20,12 @@ import PrivacyPolicyDialog from 'components/Atoms/PrivacyPolicyDialog'; import LocalizationChangeDialog from 'components/Atoms/LocalizationChangeDialog'; import LocalizationService from 'services/LocalizationService'; -LocalizationService.localize("it"); // Enable SSR localized fields (italian by default) +/** + * Enables SSR localization and theme. + */ +LocalizationService.localize("it"); +loadTheme(buildLightTheme("a")); + setIconOptions({ disableWarnings: true }); registerIcons({ icons: registeredIcons }); initializeIcons(); diff --git a/services/LocalizationService.ts b/services/LocalizationService.ts index 62869776..b34e266d 100644 --- a/services/LocalizationService.ts +++ b/services/LocalizationService.ts @@ -279,7 +279,7 @@ class LocalizationService { websites: 'Siti web', mainGroup: 'Gruppo principale', mainGroupDescription: 'Gruppo principale per qualsiasi tipo di discussione inerente al corso di laurea.', - tutorsGroupDescription: 'ATTENZIONE: Questo gruppo non è gestito dal network StudentiUniMi ma dai tutor di processo nominati dal Dipartimento di Informatica.', + tutorsGroupDescription: 'ATTENZIONE: Questo gruppo non è gestito dal network StudentiUniMi ma dai tutor peer to peer nominati dal Dipartimento di Informatica.', groupNotAvailable: 'Gruppo non presente', contactAdmin: " Contatta un amministratore se vuoi essere aggiunto al gruppo, oppure chiedilo direttamente su @unimichat.", degreesNotFound: 'Nessun corso di laurea trovato.', @@ -677,7 +677,7 @@ class LocalizationService { websites: 'Websites', mainGroup: 'Main group', mainGroupDescription: 'Main group for any type of discussion about this degree.', - tutorsGroupDescription: 'WARNING: This group is not managed by network StudentiUniMi but by tutors nominated by the computer science department.', + tutorsGroupDescription: 'WARNING: This group is not managed by network StudentiUniMi but by tutors peer to peer nominated by the computer science department.', groupNotAvailable: 'Group not available', contactAdmin: " Contact an administrator if you would like to be added to this group, or ask directly on @unimichat.", groupsNotFound: 'Groups not found.',