@propknot/shared-ui 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1530,9 +1530,14 @@ var CustomThemeProvider = ({ children }) => {
|
|
|
1530
1530
|
const { type, theme } = event.data;
|
|
1531
1531
|
if (type === "THEME_CHANGE" && theme && ["light", "dark"].includes(theme)) {
|
|
1532
1532
|
setCurrentTheme(theme);
|
|
1533
|
+
localStorage.setItem("embedded-theme", theme);
|
|
1533
1534
|
}
|
|
1534
1535
|
};
|
|
1535
1536
|
window.addEventListener("message", handleMessage);
|
|
1537
|
+
const storedTheme = localStorage.getItem("embedded-theme");
|
|
1538
|
+
if (storedTheme && ["light", "dark"].includes(storedTheme)) {
|
|
1539
|
+
setCurrentTheme(storedTheme);
|
|
1540
|
+
}
|
|
1536
1541
|
if (window.parent !== window) {
|
|
1537
1542
|
window.parent.postMessage({ type: "REQUEST_THEME" }, "*");
|
|
1538
1543
|
}
|