You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Break themes out into a separate file
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -16,18 +16,13 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import SettingController from "./SettingController";
|
||||
import {_td} from "../../languageHandler";
|
||||
|
||||
export const SUPPORTED_THEMES = {
|
||||
"light": _td("Light theme"),
|
||||
"dark": _td("Dark theme"),
|
||||
};
|
||||
import {DEFAULT_THEME, THEMES} from "../../themes";
|
||||
|
||||
export default class ThemeController extends SettingController {
|
||||
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
// Override in case some no longer supported theme is stored here
|
||||
if (!SUPPORTED_THEMES[calculatedValue]) {
|
||||
return "light";
|
||||
if (!THEMES[calculatedValue]) {
|
||||
return DEFAULT_THEME;
|
||||
}
|
||||
|
||||
return null; // no override
|
||||
|
||||
Reference in New Issue
Block a user