feat: Add RTL Support to Widget (#11022)
This PR adds RTL support to the web widget for improved right-to-left language compatibility, updates colors, and cleans up code. Fixes https://linear.app/chatwoot/issue/CW-4089/rtl-issues-on-widget https://github.com/chatwoot/chatwoot/issues/9791 Other PR: https://github.com/chatwoot/chatwoot/pull/11016
This commit is contained in:
@@ -10,11 +10,6 @@ const getSystemPreference = () =>
|
||||
const calculatePrefersDarkMode = (mode, systemPreference) =>
|
||||
isDarkModeAuto(mode) ? systemPreference : isDarkMode(mode);
|
||||
|
||||
const calculateThemeClass = (mode, light, dark) => {
|
||||
if (isDarkModeAuto(mode)) return `${light} ${dark}`;
|
||||
return isDarkMode(mode) ? dark : light;
|
||||
};
|
||||
|
||||
/**
|
||||
* Composable for handling dark mode.
|
||||
* @returns {Object} An object containing computed properties and methods for dark mode.
|
||||
@@ -28,12 +23,8 @@ export function useDarkMode() {
|
||||
calculatePrefersDarkMode(darkMode.value, systemPreference.value)
|
||||
);
|
||||
|
||||
const getThemeClass = (light, dark) =>
|
||||
calculateThemeClass(darkMode.value, light, dark);
|
||||
|
||||
return {
|
||||
darkMode,
|
||||
prefersDarkMode,
|
||||
getThemeClass,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user