fix: make theme logic safe and add better e2e tests (#16959)

* fix: improve theme logic

* remove null from ThemeLabelProps value

* add better e2e tests
This commit is contained in:
Benny Joo authored and GitHub committed 2024-10-07 11:23:30 +01:00
1 parent b0bfec7247
commit 21dd44733f
6 files changed
+127 -23

No files matched your search

+4
View File
@@ -8,6 +8,10 @@ type CssVariables = Record<string, string>;
const useCalcomTheme = (theme: Record<string, CssVariables>) => {
useEffect(() => {
Object.entries(theme).forEach(([key, value]) => {
if (!value) {
// should not be reached
return;
}
if (key === "root") {
const root = document.documentElement;
Object.entries(value).forEach(([key, value]) => {