refactor: widget theme color

This commit is contained in:
Tristan Yang
2023-02-08 22:36:45 +08:00
parent c6f9cc2cef
commit 4435d83580
9 changed files with 78 additions and 16 deletions
+3 -1
View File
@@ -18,7 +18,9 @@ const styles = {
boxShadow: `rgb(0 0 0 / 25%) 0px 25px 50px -12px`
};
Object.assign(wrapper.style, styles);
wrapper.src = `${new URL(_src).origin}/widget.html?host=${hostId}&themeColor=${themeColor}`;
wrapper.src = `${new URL(_src).origin}/widget.html?host=${hostId}&themeColor=${encodeURIComponent(
themeColor
)}`;
wrapper.width = closeWidth;
wrapper.height = closeHeight;
wrapper.frameborder = 0;